Difference between revisions of "Comments:Slider Tool"

From GeoGebra Manual
Jump to: navigation, search
(create public page)
 
(added flexible bounds tip)
Line 1: Line 1:
 
<!-- DO NOT EDIT -->{{:Manual:{{PAGENAME}}}}<!-- END: DO NOT EDIT -->
 
<!-- DO NOT EDIT -->{{:Manual:{{PAGENAME}}}}<!-- END: DO NOT EDIT -->
  
[[Category:Commands]]
+
== Tips ==
 +
=== Flexible Bounds ===
 +
A normal slider can just be defined for a constant interval, i.e. the interval can't be influenced by worksheet variables. But sometimes it's necessary to create a slider for the user with flexible bounds, let's say from ''a'' to ''b''. That's not possible directly, but one can achieve a similar effect:
 +
# Create a slider ''t'' in the interval [0, 1]
 +
# Use interpolation to calculate the "real value" ''c'' (in the interval [''a'', ''b'']): <pre>c = a + (b - a) * t</pre>
 +
# Hide the label of the slider
 +
# Place a text object with the content <code>"c = " + c</code> at the old label's position
 +
Such a slider works almost exactly like the normal one (exception: the label isn't moving, that needs some additional work), so your users probably won't notice.

Revision as of 11:39, 11 October 2010

Manual:Slider Tool

Tips

Flexible Bounds

A normal slider can just be defined for a constant interval, i.e. the interval can't be influenced by worksheet variables. But sometimes it's necessary to create a slider for the user with flexible bounds, let's say from a to b. That's not possible directly, but one can achieve a similar effect:

  1. Create a slider t in the interval [0, 1]
  2. Use interpolation to calculate the "real value" c (in the interval [a, b]):
    c = a + (b - a) * t
  3. Hide the label of the slider
  4. Place a text object with the content "c = " + c at the old label's position

Such a slider works almost exactly like the normal one (exception: the label isn't moving, that needs some additional work), so your users probably won't notice.

© 2024 International GeoGebra Institute