Home TI-Nspire Authoring ← Advanced Techniques 3

           

Creating Interactive Documents using TI-Nspire

Advanced Techniques 3

Steve Arnold
TNS sampler document


3. Making Calculations Appear and Disappear

This advanced technique was first developed by Mark Howell and later refined by Marc Garneau, and represents a very clever and sneaky way to attach variable values to points, which can then by controlled by conditions. It is relatively simple to make text labels appear and disappear, but quite another matter to do the same for varying amounts, such as the results of calculations. For this, we build a segment whose slope is the same as the value we wish to show, and control the appearance of the segment! In a sense, this document represents a culmination of the previous techniques, allowing us to put it all together into an interesting and interactive document. Before commencing, take a deep breath.

Suppose that we wish to generate some random numbers (advanced technique 1) and then to use these in a step-by-step solution (advanced technique 2), as follows.


Top of Page
The first line is fine - these are just the results of the randomInt command along with the question variable as a trigger. It is the numbers in the second and third lines that are interesting, since these are the results of calculations, and yet they appear and disappear as we change the value of step.

We will continue from the page built in advanced techniques 1, where we have three numbers randomly generated, with a plus and a multiplication sign between them. We want a copy of the first number to appear directly below it, and the product of the second two numbers to appear below the x sign. We will begin with the first number: a copy of the left-hand value from line 1 (call this val for later reference).

Begin by inserting a slider called step, and set it to run from 1 to 3 in steps of 1. 

Turn on both axes and grid, and drop a Point On to a grid point at the location we want our value to appear. As described in Advanced Techniques 2, use a when statement (when(step>1,1)) to construct a circle centered on this point, and place a Point On this circle. Right-click (ctrl-menu) on the point to get the Coordinates (call them (xx, yy)). This will be our appearing and disappearing point. You can hide the center point of the circle, and set the radius to be very small so that all that appears now is a point (in this case at (-7, -2)). Use step to check that it does, in fact, disappear when step = 1.



Top of Page
We also need some text added to construct our segment: three text items, for which I use xx + dx, yy + val*dx, and 1 (the value of dx, which will be the displacement from our starting point to build our segment). Using Calculate, click on xx + dx, then click on the dx value (1) and the x-coordinate of our point (xx = -7 in the example shown here). This gives an x-value 1 unit to the right of our base point. Place this value near the x-axis.

Next, Calculate again: click on yy + val*dx - first click on dx (1), next on our val (in the example, this is first 2, which outputs a value very close to 0, which is a bit confusing, so I changed it to 3, which outputs a value of 1) and finally on yy (-2). Drop the result near the y-axis, as shown.


Top of Page
Use Measurement Transfer from the Constructions menu to place the first value on the x-axis (-6) and the second value on the y-axis (1). if this value happens to lie off the screen, click the question spinner until you get a suitable value as I did previously to get a more suitable value.

Use Perpendicular from the Constructions menu to construct perpendiculars from these two measurement transfers, and you will see that these lines meet at a point. Join this intersection to your original (base) point (-7, -2) and you have constructed a segment whose slope is the same as the value you wish to use! At this stage, it may be useful to hide everything you no longer need from this construction - leave just the base point (-7,-2) and the segment.

The next step eluded me for a long time, until Marc Garneau worked it out: now that you have the segment needed, unless you want your resulting value jumping around as it changes, you should endeavour to set the slope of the segment now to be zero, before you measure it. You could keep clicking up and down the question spinner until eventually a 0 value pops up - or you can reveal your hidden formula and change it to run, not from 1 to 10 but from 0 to 1, so that you increase your chances of a zero value!



Top of Page
Now Measure the slope of your segment and click to place it where you want it to appear. Usually it is best to just place it on top of the point that marks your desired location. Change the dx value to something small (from 1 to 0.0001) and your variable value is done! 

NOTE: when you change your dx value back to 1 for later calculations, your carefully placed value will jump - do NOT be tempted to grab it and move it back into position - this will cause its later behavior to be unpredictable! Just leave it until you have finished and dx again becomes very small - it should then go back to the right spot - and stay there!

If you were finished, you would hide all the extra stuff, change your randInt value back and you would be done, but we need to do this two more times for this example.


Use our base point to construct a perpendicular (horizontal) line and place a Point On that line below the "x" for our second value (you will also place a point on that line for the "+" - remember, this line and everything on it will disappear when step = 1 since the point it depends upon is controlled by our when statement).

The next value we need will be the product of the second two numbers on the top line, so use the Text tool to drop a product, say "aa*bb", calculate to get the result. This result will be our val. Get the coordinates for our location point to serve as xx and yy and we are ready to repeat the steps outlined above.


Top of Page
This is a good example to repeat the procedure two more times to ensure that you are getting it. With enough practise, this will become easy, but the first few times it seems very slow and complicated.

So from this point:

  1. Calculate from xx+dx to get the new x-value - place it near the x-axis;

  2. calculate from yy+val*dx to get the new y-value - place it near the y-axis.

  3. Use Measurement Transfer to place these values on their axes, and

  4. draw Perpendiculars from these to meet in a point.

  5. Join this intersection point to your base point with a segment.

  6. Hide all the constructions and non-essential values, leave just the base point and segment.

  7. Adjust your randInt to get a 0 value for the segment slope.

  8. Measure this slope and place this value carefully.

  9. Change dx to 0.0001 and hide non-essentials.


You may want to use Symmetry to place a point for the third row as described in Advanced Techniques 2 (first place a point directly under the first number in the first row (5 in our last example), and repeat the steps above one more time to give the final result, visible when step > 2.

Remember - this is meant to be fun! Enjoy!

Top of Page

           

©2009 Compass Learning TechnologiesHome TI-Nspire Authoring ← Advanced Techniques 3