Home ← TI-Nspire Authoring ← Advanced Techniques 3

## Creating Interactive Documents using TI-Nspire

## Advanced Techniques 3

Steve Arnold

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 PageThe first line is fine - these are just the results of the randomInt command along with thequestionvariable 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 ofstep.

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 thisvalfor later reference).

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

Turn on both axes and grid, and drop aPoint Onto a grid point at the location we want our value to appear. As described in Advanced Techniques 2, use awhenstatement (when(step>1,1)) to construct a circle centered on this point, and place aPoint Onthis circle. Right-click (ctrl-menu) on the point to get theCoordinates(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)). Usestepto check that it does, in fact, disappear whenstep= 1.

Top of PageWe also need some text added to construct our segment: three text items, for which I usexx + dx, yy + val*dx, and1(the value of dx, which will be the displacement from our starting point to build our segment). UsingCalculate, click onxx + dx, then click on thedxvalue (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,Calculateagain: click onyy + val*dx- first click ondx(1), next on ourval(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 onyy(-2). Drop the result near the y-axis, as shown.

Top of PageUseMeasurement Transferfrom theConstructionsmenu 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 thequestionspinner until you get a suitable value as I did previously to get a more suitable value.

UsePerpendicularfrom theConstructionsmenu 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 thequestionspinner 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 PageNowMeasurethe 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 thedxvalue to something small (from 1 to 0.0001) and your variable value is done!

NOTE: when you change yourdxvalue 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 anddxagain 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 Onthat 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 whenstep= 1 since the point it depends upon is controlled by ourwhenstatement).

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

Top of PageThis 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:

Calculate from

xx+dxto get the new x-value - place it near the x-axis;calculate from

yy+val*dxto get the new y-value - place it near the y-axis.Use Measurement Transfer to place these values on their axes, and

draw Perpendiculars from these to meet in a point.

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

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

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

Measure this slope and place this value carefully.

Change

dxto 0.0001 and hide non-essentials.

You may want to useSymmetryto 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 whenstep> 2.

Remember - this is meant to be fun! Enjoy!

Top of Page

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