home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / education / a / locus / Docs / Text / Tutorial < prev   
Encoding:
Text File  |  1997-01-02  |  30.7 KB  |  701 lines

  1.  
  2.  
  3.  
  4.    _                           _____      _             _       _ 
  5.   | |    ___   ___ _   _ ___  |_   _|   _| |_ ___  _ __(_) __ _| |
  6.   | |   / _ \ / __| | | / __|   | || | | | __/ _ \| '__| |/ _` | |
  7.   | |__| (_) | (__| |_| \__ \   | || |_| | || (_) | |  | | (_| | |
  8.   |_____\___/ \___|\__,_|___/   |_| \__,_|\__\___/|_|  |_|\__,_|_|
  9.  
  10.  
  11.  
  12.                  Contents
  13.                  
  14.         
  15.         Exercise 1      Getting Started
  16.         Exercise 2.     Domain and Ranges
  17.         Exercise 3.     More Zooms and rescaling
  18.         Exercise 4.     Constants & Families    
  19.         Exercise 5.     Polar Graphs
  20.         Exercise 6.     Implicit Graphs
  21.         Exercise 7.     Data Sets
  22.         Exercise 8.     Fitting Curves
  23.         Exercise 9.     Transformations
  24.         Exercise 10.     Calculus
  25.         Exercise 11.    Saving your work
  26.  
  27.  
  28.  
  29.         Exercise 1.  Getting Started
  30.         
  31. Install !Locus on the Icon Bar by double clicking on the !Locus icon in
  32. the filer window. When the Locus icon appears on the Icon Bar click with
  33. SELECT  (the left mouse button) on the icon. This will open the main
  34. Locus window. This is the control centre of the application. At the top
  35. of this window you will see a control panel (called the 'button bar')
  36. containing three rows of icons. These control the settings and most of
  37. the input for the application. At first they may seem to be rather
  38. bewildering but all will become clear very soon as most of them are
  39. fairly self explanatory.
  40.  
  41. Look first at the bottom row of icons. You will notice that when the
  42. main window opens the caret will be in the large writable icon. Type the
  43. letter ‘x’ (upper or lower case) and either click on the <Plot> icon or
  44. press the RETURN key. A straight line will appear running from the
  45. bottom left hand corner of the screen to the right hand corner. You
  46. might notice that this doesn’t look much like ‘y=x’ which should run at
  47. 45 degrees to each axis. So I shall now explain how to edit the graph so
  48. that it looks right.
  49.  
  50. Look at the rightmost icon of the second row. This is the 'squaring up'
  51. button and should contain a picture of an ellipse. Click on this button
  52. and watch what happens. First the picture on this icon will change to a
  53. circle and then the Hourglass will come on for a few seconds. When the
  54. Hourglass stops the graph will redraw and you will see that it is now
  55. square shape and the graph of y=x will be as you would expect it to
  56. look.
  57.  
  58. Let us now add a grid so we will have a more accurate view of the
  59. coordinates in the graph.  Press MENU (the middle mouse button) and
  60. click on 'Settings'.  This will open the 'Settings' dialogue box. Click
  61. on the button to the left of the item 'grid' so that it is ticked and
  62. then click on the <OK> button.  Again the Hourglass will come on for a
  63. few moments and the graph is redrawn showing a grid.
  64.  
  65. You may wish to experiment with the ‘squaring up’ icon to see how this
  66. toggles the graph back and forth between rectangular and square, both
  67. showing the grid and the graph.
  68.  
  69. You can now superimpose other related graphs on top of the one already
  70. drawn.  With Locus this is easily done. There are two methods you can use
  71. for this but at this point I shall only describe the simpler of them.
  72.  
  73. To the left of the ‘squaring up’ icon is the ‘auto-scaling’ icon which
  74. should be on; that is, it should appear recessed or pushed in. When
  75. this is on each time a new graph is drawn the previous one is erased,
  76. but if it is off each new graph is drawn over the old ones until the
  77. 'clear' icon (the third button from the left on the top row) is clicked
  78. or auto-scaling is turned back on. Click on this to switch it off. The
  79. button will move to the 'off' position, that is, it will appear to stand
  80. out from the background. Now the ymin and ymax writable icons will
  81. become active and the graph will be redrawn.  Now Click with SELECT in
  82. the formula input icon (the large writable icon in the centre of
  83. the bottom row) and add the symbols ‘+1’ to the ‘x’ already there. Now
  84. press RETURN or click on the <Plot> button. The graph of y=x+1 will be
  85. superimposed onto the graph already drawn but in a different colour.
  86.  
  87. To superimpose a third graph, for example, y=x+2, simply replace the
  88. ‘+1’ in the formula icon with ‘+2’ and press RETURN again. This process
  89. can be repeated as often as you like.
  90.  
  91. You may also like to try changing the coefficient of x to see how the
  92. gradient of the line changes. For example try y=2x+1.
  93.  
  94. To clear the screen without changing the axes or the grid click on the
  95. 'clear screen ' button with SELECT.
  96.  
  97.  
  98.         Exercise 2.   Domain and Ranges
  99.  
  100. We shall now try some trigonometric functions. Set ‘auto-scaling’ to
  101. 'on' and ‘squaring up’ to 'off', that is, the auto scaling button should
  102. be 'in' and squaring up 'out'.
  103.  
  104. Ensure that Locus is set to degrees mode. There are two buttons on the
  105. top row, one showing a full circle, representing degrees, and the other a
  106. broken circle, representing radian measure. Check that the degrees
  107. button is 'on', and if not click on it.
  108.  
  109. Check that the 'xmin' icon reads ‘-180’ and the ‘ymin’ icon reads ‘180’.
  110. (If they do not contain these figures then click in the appropriate
  111. icon, press Ctrl U to clear the icon, and type in the correct values.)
  112.  
  113. There is a choice of two different methods for entering formulae. For
  114. the first you just type the required formula in the formula input icon
  115. (the method used in the previous exercise). The second method lets you
  116. select a formula from a menu.  Click on the 'menu' button to the right
  117. of the formula input icon and a long menu will appear containing the
  118. preset formulae. The first entry should be ‘sinx’.  Click on this and it
  119. will appear in the formula icon. Now press RETURN or click on the <Plot>
  120. button to plot the graph of ‘y=sinx’.
  121.  
  122. If you look at the formula menu you will see that !Locus can recognise
  123. most standard algebraic forms of input. An exception is powers where the
  124. ‘^’ symbol is used for powers greater than 3. For squares and cubes,  use
  125. the appropriate button on the icon bar.For a full list of the functions
  126. Locus will recognise see Appendix A at the end of the manual.
  127.  
  128. You could now return to Exercise 1 change the period of the graph by
  129. superimposing the graphs of y=sin2x and y=sin3x on top of y=sinx. Don't
  130. forget to turn off auto-scaling or the previous graphs will be erased
  131. before drawing the new one.
  132.  
  133. We shall now consider 'domains' and 'ranges'. It is possible to use
  134. Locus without worrying about ranges, but you will have to understand
  135. domains. These are the values fed into a function.   For instance,
  136. using the example 'y=sinx',  the values which are given to the variable
  137. 'x' represent the domain of the function.  In this example,  all possible
  138. values of 'x' can be fed into the function,  but there are functions such
  139. as    'y=1/(x+1)' where the value 'x=-1' has no meaning to the function.
  140. However you do not need to worry about this as Locus will deal with it
  141. automatically and draw asymptotes at the undefined point(s).
  142.  
  143. Look at the icons on the middle row.  t-min and t-max are greyed out at
  144. the moment and do not concern us until we move on to polar and
  145. parametric graphs. Whatever the default settings you will need to change
  146. these manually at various times. Click with SELECT in the x-min icon and
  147. press Ctrl U which will clear the icon (as with all other RISC OS
  148. applications.) Now type in the new x-min value and press RETURN which
  149. will move the caret into the x-max icon where you can also change the
  150. value.
  151.  
  152. Example exercises
  153.  
  154.   1.    Turn on auto-scaling
  155.   2.    Draw the graph of y=sinx as before
  156.   3.    Click in the x-min icon and  Press Ctrl U to clear the icon
  157.   4.    Enter the value  -360 and press RETURN to move the caret to the
  158.         x-max icon
  159.   7.    Press Ctrl U to clear this icon and enter the value  360
  160.   9.    Press RETURN or click on the <Plot> button.
  161.  
  162. The graph of y=sinx will be redrawn using the domain -360 to 360
  163. degrees. This has doubled the domain of x from the previous values of
  164. -180 to +180.
  165.  
  166. With this example a simpler method would be to use the negative zoom
  167. facility.
  168.  
  169. 1.      Draw the graph of y=sinx using the domain -180<=x<=180
  170. 2.      Click on the button on the top row containing the picture of a magnifying glass
  171.         and a minus sign.
  172.         
  173.  
  174.  
  175. As before the domain will double and, if auto-scaling is on, Locus will
  176. rescale the y axis appropriately. This could cause problems if xmin is
  177. greater than zero or xmax is less than zero as the graph would be drawn
  178. progressively further and further away from the origin.
  179.  
  180. In these situations the Move Graph icon can be used. This is the icon
  181. with blue arrows pointing out from the centre which will be found in the
  182. same group as the negative zoom icon. If you click on this the button
  183. will depress. Now move the pointer into the main window and you will
  184. find that you if you hold down the SELECT button you can drag the graph
  185. to a new position.
  186.  
  187.  
  188.        Exercise 3.   More on Zooms and Rescaling.
  189.        
  190. Ensure that Locus is set up as follows.
  191.        1.     'auto-scaling' should be 'on'.
  192.        2.     ‘squaring up’ should be 'off'
  193.        3.     Set the domain to  -0.1<x<0.1
  194.        
  195. Now draw the graph of y=xsin(1/x)  (this can be found on the formula
  196. menu.)
  197.  
  198. This is a fascinating function which becomes interesting for values of x
  199. which are very close to zero, so we shall use the manual zoom facility
  200. to see what it looks like close to zero.
  201.  
  202.   5.     Click on the icon showing a picture of a magnifying glass and
  203.          a plus sign.
  204.   6.     Click <Select> and hold at the point (-0.002,0.003)
  205.   7.     Drag the box to the right and down to the point (0.002,-0.003)
  206.   8.     Release the mouse button.
  207.   9.     Zoom in a few more times to see what happens.
  208.  
  209. Because of the way Locus works you may find that the oscillations become
  210. wild and inaccurate. It would take a very long time to plot every point
  211. on the graph and this would normally not be necessary. However there are
  212. times when accuracy is desirable.
  213.  
  214. In the middle of the top row of buttons you will see a writable icon
  215. flanked by a pair of ‘bump’ icons. This should normally contain a number
  216. in the range 128-512. This is the Plot Step value. (For more information
  217. see the manual). If you are drawing graphs with lots of asymptotes or
  218. wild oscillations then the number should be large, but the larger the
  219. value the more slowly the graph will be drawn.
  220.  
  221. Clicking on the small, triangular, button arrow to the right of this
  222. icon increases the number and clicking on the similar button on the left
  223. decreases the number.
  224.  
  225. Click on the right hand button until the number rises to 4096 (you can
  226. do this by typing the number if you prefer.) and then click on the
  227. <Plot> icon. You should see an immediate change in plotting speed but
  228. also note the change in accuracy.
  229.  
  230. If you want to zoom out again you can use the negative zoom button but
  231. it is best to reduce the plotting step first so that this does not take
  232. too long.
  233.  
  234. If you get bored waiting for the graph to plot,  pressing ESCAPE will
  235. stop the plot and return control to the user.
  236.  
  237.  
  238.         Exercise 4.  Constants and Families
  239.  
  240. Many graphs are related to each other and Locus lets you study the
  241. effect of changing one or more constants in your formula definitions and
  242. to plot several graphs at one time.
  243.  
  244. This Exercise will describe one example and then you can experiment for
  245. yourself.
  246.  
  247. If you are studying the shapes of simple quadratics you might be
  248. interested in the effect of changing the coefficient of x.
  249.  
  250.   1.    Turn off auto-scaling
  251.   2.    Set the axes as follows:
  252.                xmin:  -7
  253.                xmax:   5
  254.                ymin:  -10
  255.                ymax:   30
  256.                
  257.   3.   Click on  <Plot>  to set the axes
  258.   4.   Type  x²+bx  into the formula input icon.
  259.   5.   Click on the constants button.  (This is the one with ‘abc’
  260.        written on it.)
  261.   6.   Type  0  into the second field,  marked ‘b’
  262.   7.   Click on <OK>
  263.   8.   Click on the Family button which is to the right of
  264.        the constants button.
  265.   9.   Type 5 into the field at the top  (This sets the number of
  266.        graphs to be drawn.)
  267.   10   Type 1 into the ‘b’ field on the increment pane (This sets the
  268.        amount of the increment.)
  269.   11   Click on <OK> 
  270.  
  271. It is acceptable to set several constants and change them simultaneously
  272. if you wish, although this is normally regarded as bad practice.
  273.  
  274. As an example,  let us suppose you are doing some work on projectiles.
  275. It is possible that you will want to set several constants at the start
  276. and then alter them one at a time.
  277.  
  278. In order to examine this we need to consider how Locus deals with
  279. parametric equations. If you already understand parametric equations
  280. you may prefer to skip the following paragraph.
  281.  
  282. A pair of parametric equations is a mathematical construct where,
  283. instead of the more familiar case where we define y in terms of x,
  284. we define both x and y in terms of a third variable (in this case ‘t’
  285. which represents time.)
  286. When considering the motion of a ball thrown into the air, the standard
  287. cartesian equation of the path is very awkward to use and does not
  288. contain all of the information that we need, for example, it makes
  289. no mention of time. By using parametric equations we are able to
  290. define the path and analyse the motion taking time into consideration.
  291.  
  292. As an example.
  293.  
  294.   1.     Click on the Clear Screen button
  295.   2.     Turn off auto-scaling
  296.   3.     Make sure you are in ‘degrees’ mode (the full circle is 'on')
  297.   4.     Click on the button on the top row of the main window pane
  298.          which contains the letters x,y,t
  299.   5.     Set the axes as follows:
  300.              tmin:0
  301.              tmax:4
  302.              xmin:-2
  303.              xmax:50
  304.              ymin:-5
  305.              ymax:30
  306.   6.     Click on <Plot> to set the axes
  307.   7.     Select the equation set  utcos(a),y+utsin(a)-9.8t²  on the
  308.          Formulae menu
  309.  
  310. There are two things you should take note of at this point. Firstly,
  311. both the x and y equations are written on the same line separated by a
  312. comma. Secondly, if you are finding trigonometric functions of constants
  313. Locus requires that you put parentheses around them.
  314.  
  315.   8.      Click SELECT on the constant ('abc') icon
  316.   9.      Set a=5;u=25;y=0 and click on the <OK> button
  317.   10.     Click on the family icon next to it
  318.   11.     Type 9 into the ‘Number of Graphs’ icon.
  319.   12.     Type 10 into the ‘a’ increment icon
  320.   13.     Click on  <OK>
  321.  
  322. You should see a series of negative quadratics which get progressively
  323. higher but d not travel as far horizontally. You should note which angle
  324. gives the maximum horizontal range.
  325.  
  326. As an exercise try using the same equation set, but this time set the
  327. value of a to 45 and only increment the value of y. Draw seven graphs
  328. incrementing y by 1 each time.  Using different values of a and y is a
  329. good way of demonstrating why an Olympic shot putter does not release
  330. the shot at 45 degrees to the horizontal.
  331.  
  332.  
  333.         Exercise 5.   Polar graphs
  334.         
  335. So far we have only examined standard cartesian or rectangular graph
  336. shapes. We will now consider Polar graphs.
  337.  
  338. Instead of defining the coordinates of a point in the x-y plane in terms
  339. of its horizontal and vertical coordinates, it is also possible to
  340. define the same point in terms of its distance from the origin and the
  341. angle that this line makes with the horizontal axis.  Most mathematics
  342. students find this difficult at first as they have become used to the
  343. cartesian model. In fact we tend to base real life directions more on
  344. the polar than the cartesian model. For example, bearings .
  345.  
  346.   1.      Click on the icon on the top row containing a picture of
  347.           ‘r=sin2t’.  This is the fourth icon from the left.
  348.   2.      Turn on auto-scaling.
  349.  
  350. Note that all of the x and y range fields are now ‘greyed’ out but the t
  351. fields are now selectable. If you are in degrees mode, enter '0' in the
  352. tmin icon and 360 in the tmax icon, otherwise set the range to 0 to 2p.
  353. Locus uses 'p' as a constant which represents the value of pi.)
  354.  
  355.   3.      Set the t range
  356.   3.      Click on the formula menu icon
  357.   4.      Click on ‘t’ which should be the first entry.
  358.   5.      Click on <Plot>
  359.  
  360. The graph will be drawn correctly for the given range.
  361.  
  362. You should now experiment with changing the various settings to get
  363. different effects and try drawing other similar graphs both from the
  364. menu and of your own devising.
  365.  
  366.  
  367.         Exercise 6.   Implicit Graphs
  368.         
  369. Sometimes formulae may not have ‘y’ neatly defined in terms of ‘x’ as in
  370. ‘y=sin2x+4cos3x’. You may encounter expressions which have x’s and y’s
  371. mixed on the same side of the equals sign, for example ‘x²-xy+y³=23’.
  372. This type of equation is called ‘Implicit’ and this exercise describes
  373. how Locus implements them.
  374.  
  375. The example given above is rather complicated, and is not the type of
  376. problem that would concern most people. However, simple implicit
  377. equations are often used at G.C.S.E. level. Consider the following
  378. problem:
  379.  
  380. Solve the following pair of simultaneous equations
  381.  
  382.                          3x + 5y = -1
  383.                          2x - 3y = 12
  384.  
  385. This is the type of problem that Intermediate and Higher level G.C.S.E.
  386. students will be required to solve at some time,  either graphically or
  387. algebraically. In fact, this is a pair of Implicit equations as the x’s
  388. and y’s are on the same side of the equals sign.
  389.  
  390. The reason simultaneous equations are written like this is to avoid the
  391. added algebraic complication of having fractional coefficients in the
  392. equation.
  393.  
  394. To examine the above set of equations first turn the grid on by ensuring
  395. that the 'Grid' option in the Settings window is ticked. Now set an
  396. appropriate domain and plot the first graph with auto-scaling switched
  397. on. Then turn auto-scaling off and type in the formula for the other
  398. equation. You will then be able to use Zoom to determine where the lines
  399. cross.
  400.  
  401. The Implicit routines are not yet complete, but they are adequate for
  402. plotting one to one, one to two and two to one mappings. However Locus
  403. may become confused if asked to do anything more complex. The reason for
  404. including this incomplete facility in the first release is that it is
  405. very useful for teaching linear simultaneous equations.
  406.  
  407.  
  408.         Exercise 7.   Data Sets.
  409.         
  410. One of the most powerful aspects of Locus is its ability to deal with
  411. imported sets of numerical data in two variables. You can import data
  412. in one of three formats.
  413.  
  414.   1.     Text
  415.   2.     CSV
  416.   3.     SID
  417.   
  418. There are various ways these data sets can be produced both from within
  419. Locus and by other means. I shall describe how to create these data sets
  420. shortly, but first let us see how they are displayed.
  421.  
  422. Look in the directory 'Data Files' which accompanies Locus and find the
  423. CSV file ‘SpanHeight’. This is a small data set which examines the
  424. correlation between the arm span and height of a few pupils. Now make
  425. sure that auto-scaling is on and drag the file ‘SpanHeight’ onto the
  426. main window.
  427.  
  428. You will notice that the axis titles have changed to show the headers
  429. for each of the variables in the data file and that Locus sets the scale
  430. so all of the points are plotted.
  431.  
  432. This is may not be the best scale to analyse the data so you may wish to
  433. alter the scale to see the data better.
  434.  
  435.   1.      Turn off auto-scaling
  436.   2.      Change the scales as follows:
  437.                 xmin=1200
  438.                 xmax=1900
  439.                 ymin=1200
  440.                 ymax=2000
  441.   3.      Click on the <Plot> button.
  442.  
  443. You may wish to change the appearance of the data set and to do this you
  444. must to go to the ‘Effects’ item in the main window menu. Click MENU
  445. over the main window and click on the item 'Effects’ on the menu which
  446. will appear. This opens a dialogue box which enables you to set the
  447. Locus display. For a full description of this please see the manual.
  448.  
  449. The entries half way down the box let you set the colour of the various
  450. objects that Locus deals with, axes, graphs etc. Part way down this pane
  451. you will find five entries called Mark 1,  Mark 2,  etc.. These refer to
  452. data sets. It is important to note that you are not restricted to
  453. displaying only five data sets simultaneously, it is just that there are
  454. only five colours available and so these will be used in turn, repeating
  455. after all five have been used.
  456.  
  457. The only restriction on the number of data sets that can be loaded at
  458. any one time is the amount of memory in your computer.
  459.  
  460. Click with MENU on the Mark 1 colour icon and select the colour you
  461. want to use.
  462.  
  463. Towards the bottom of the Effects dialogue box is the section which
  464. defines the Marks, this has two items. Mark style, which controls the
  465. shape of the mark, and  Connect Marks, which controls whether the marks
  466. are joined together .
  467.  
  468. To change the Mark style -
  469.  
  470.   1.     Click <Menu> on the mark style menu icon.
  471.   2.     Choose a different mark
  472.   3.     Press on <OK> to effect your changes.
  473.  
  474.  
  475. Producing Data Sets
  476.  
  477. Firstly they can be produced using a spreadsheet. Most Spreadsheets can
  478. export data in CSV or SID format. Another method is to write files
  479. manually using a text editor such as Edit, Zap or StrongEd. The
  480. structure of the files that Locus will recognise is as follows:
  481.  
  482.   1.     The top line consists of the titles you want to appear on the
  483.          horizontal and vertical axes. Text may be enclosed in inverted
  484.          commas. For example this line in the example is “Arm
  485.          Span”,“Height” but could have been Arm Span,Height.
  486.   2.     The data follows, two items on each line, an x-coordinate and a
  487.          y-coordinate,  separated by a comma.
  488.   3.     You must ensure is that if you are writing the data to a text
  489.          file you should press RETURN at the end of the last line of data.
  490.          
  491. The second way of generating these files is to save them from Locus.
  492. This may seem a little pointless at first but as you will see later
  493. there are uses for this.
  494.  
  495. As a simple example let us plot the graph of y=x² as we have done
  496. above.
  497.  
  498.   1.    Set auto-scaling to 'on' and a domain -4<=x<=4.
  499.   2.    Click MENU over the main window and move the mouse to the right
  500.         to the sub-menu File.Save.
  501.   3.    Move down to the item CSV and move the mouse to the right and a
  502.         save dialogue box will open.
  503.   4.    Fill in the Start,End and Step fields as -4,4,0.1 respectively.
  504.   5.    Change the name to ‘xsqu’
  505.   6.    Drag the file icon to a filer directory window.
  506.   7.    Click on the clear screen icon
  507.   8.    Drag the CSV file onto the main Locus window.
  508.   9.    Open the effects dialogue box and change the Mark style to Dot,
  509.         select the Connect marks option icon and click on the <OK> button.
  510.  
  511. The resulting curve should look almost identical to your original graph
  512. of y=x². The reason for this more complex method is that you can now apply
  513. different  transformations to your graph in either matrix or described
  514. form in order to analyse the function. This is the subject of the next
  515. exercise.
  516.  
  517.  
  518. Exercise 8.   Fitting curves
  519.  
  520. Another use which can be made of data sets is in curve fitting.  Let us suppose that you are studying cubic graphs and the principle of dominance.  The teacher could set up a data set file with points from the graph of y=x³-3x²+x-4  (such a file is supplied in the DataSets folder which comes with the application: it is called Cubic.)
  521.  
  522. Make sure that Auto-Scaling is switched on and drag the file to the main Locus window.  Locus will scale the axes appropriately and a series of points will be plotted.
  523.  
  524. The student could now try out different functions to see whether they fit the points.
  525.  
  526. A first guess might be y=x³ which could be plotted in the usual way.  Obviously this does not fit so a second guess might be y=x³-4 which would show that the student has understood the idea of the constant value in the equation corresponding to the y-intercept.
  527.  
  528. By altering the formula in a methodical way the student should eventually come up with the correct formula.   Of course this is a fairly complicated example and this facility can be used at a much lower level: for example to fit the graph of y=x+2.
  529.  
  530. You can plot the graphs with auto-scaling switched on or off,  though the main window will become a bit messy after a while if it is off.
  531.  
  532. Of course it perfectly possible to press the clear button and then reload the data set file though it would be a nuisance to have to do this.  So to alleviate this problem you should click on the clear button with ADJUST (the right hand mouse button) and this will remove the graphs without deleting the data set.
  533.  
  534.  
  535.         Exercise 9.   Transformations
  536.  
  537. When you first load Locus the two main menu items Transform and Matrix
  538. will be greyed out and will remain so until a data set is dragged into
  539. Locus. This is because transforming formula drawn graphs would be too
  540. slow and therefore this is not implemented.
  541.  
  542. Let us examine various transformations on a simple irregular shape.
  543.  
  544.   1.     Find the textfile entitled ‘Flag’ in the DataFiles directory.
  545.   2.     Turn ‘auto-scaling’ off and ‘squaring up’ on.
  546.   3.     Set the domain and range as follows:
  547.                       xmin:  -5
  548.                       xmax:   5
  549.                       ymin:  -5
  550.                       ymax:   5
  551.   5.     Click on the <Plot> button set set the axes.
  552.   6.     Make sure that you are in Degrees mode.
  553.   7.     Drag the ‘Flag’ file onto the main Locus window.
  554.   8.     Make sure that the ‘Connect Marks’ option in the Effects
  555.          dialogue box, is on.
  556.   9.     Click MENU over the main Locus window and move the mouse
  557.          down to Transform. Here you will see four transformational
  558.          options. We will only look at Rotation and Reflection in this
  559.          exercise, but for details of the others see the manual.
  560.   10.    Type 45 into the Angle field
  561.   11.    Type 0,0 into the Centre field
  562.   12.    Click on the <Apply> button. The flag will be duplicated but
  563.          this time rotated through +45 degrees.
  564.   13.    Now click on <Apply> again. A third flag will appear. You will
  565.          see that the transformation is applied this time not to the
  566.          original flag but to the last one drawn.  Hence the third flag
  567.          is at 90 degrees to the original. If you continue to repeat
  568.          this process you should end up with a full circle of flags
  569.          centred around the origin.
  570.  
  571. Reflection is a little bit more complex but only marginally so.
  572.  
  573. There are two options -
  574.  
  575.  i)     y=mx+c which is used to produce any linear function
  576.  ii)    x=c which is used to produce vertical lines
  577.  
  578.   1.     Click on the clear screen button
  579.   2.     Import the ‘Flag’ file as previously described
  580.   3.     Open the Transform box
  581.   4.     Select the x=c icon
  582.   4.     Type -1 into the mirror line field.  (To the right of 'x=' )
  583.   5.     Click on <Apply>
  584.  
  585. Now try selecting the y=mx+c icon
  586.  
  587.   1.     Click on the clear screen button
  588.   2.     Import the ‘Flag’ file again
  589.   3.     Ensure that the Transform box is open
  590.   4.     Select the y=mx+c icon
  591.   5.     Click in the field to the right of ‘y=’
  592.   6.     Type -2 and press RETURN
  593.   7.     Type -1
  594.   8.     Click on the <Apply> button.
  595.   9.     Using the main function plotting facilities plot the line
  596.          y=-2x-1.
  597.  
  598. Notice that the image flag is reflected using the mirror line y=-2x-1.
  599.  
  600. You can now experiment with this facility. You may like to see what
  601. happens when you transform the ‘xsqu’ file that you created in the last
  602. exercise.
  603.  
  604. The Matrix item in the main menu does operates in a similar manner but
  605. the transformations are entered in 2x2 matrix form instead of the
  606. descriptive form previously described. With this you can examine eigen
  607. values and vectors and the dimension crushing that some matrix
  608. transformations exhibit.
  609.  
  610. It is also possible to enter the data without using CSV,  SID or Text
  611. files and for small numbers of data points this is often the preferred
  612. method of data entry. On the top row of the main control pane there is
  613. an icon showing two crosses joined with a line.  Click on this icon and
  614. a window will open containing 21 writable icons. The first of these
  615. contains the axis titles. Dy default these are ‘x’ and ‘y' and can be
  616. changed if you wish. The coordinate pairs can be entered in the other
  617. twenty icons, separating them with a comma.
  618.  
  619. For example, type the following pairs into the first 4 icons.
  620.  
  621.          1,1
  622.          1,4
  623.          2,3
  624.          1,2
  625.          
  626. Now click on the plot button to produce the flag which you have been
  627. using during the earlier part of this exercise.
  628.  
  629. You can also drop small data files (<20 pairs) onto the arrow icon in
  630. the coordinates window to load them if you wish.
  631.  
  632.  
  633.         Exercise 10.   Calculus
  634.  
  635. This exercise is only relevant if you are engaged in post 16
  636. mathematics.
  637.  
  638. There are three Calculus tools available for analysis of cartesian
  639. functions.
  640.  
  641.      A tangent drawing tool
  642.      
  643.      An option to draw the derived function automatically
  644.      
  645.      An option to draw the integral function automatically
  646.  
  647.   1.     Set Radian mode and set the domain to -2pi to 2pi.  (Remember
  648.          that the constant p contains the value of pi, so typing -2p and
  649.          2p will do the trick.)
  650.   2.     Draw the graph of y=sinx
  651.   3.     Now click on the coordinates icon which is on the top row of the
  652.          main pane and contains a picture containing ‘(x,y)’.  This will
  653.          open the coordinates window.  If you click on the ‘toggle size’
  654.          icon this will also give you information on the polar
  655.          coordinates of points on the graph and the gradient of the curve
  656.          at particular points.
  657.   4.     Click on the ‘Tangent’ icon which is to the right of the coordinate
  658.          icon.
  659.   5.     Clicking the mouse in the main window will draw the tangent to the
  660.          curve at the x-coordinate where you clicked.
  661.   6.     You can also hold the mouse button down and drag the tangent along
  662.          the curve.
  663.  
  664. This facility is useful for examining how the tangent changes along the
  665. length of a curve enabling the gradient function to be sketched.
  666.  
  667. Note that the coordinates window does not need to be open for the
  668. tangent facility to operate.
  669.  
  670. The second and third tools are much simpler to use. Select the two
  671. buttons on the right of the top row showing pictures of dy/dx and an
  672. integral sign. Now draw the draw of y=sinx and observe what happens. The
  673. original graph is drawn and then the derivative and integral functions
  674. are superimposed onto it.
  675.  
  676.  
  677.         Exercise 11.   Saving your work
  678.  
  679. We have already dealt with the saving of data sets but there are two
  680. other file formats that Locus can use to save data, LocFiles and
  681. DrawFiles.
  682.  
  683. LocFiles are a special file format used only by Locus. They contain all
  684. the original settings, graphs and/or families of graphs that were on
  685. screen when the file was saved.
  686.  
  687. DrawFiles are the standard graphic format for all Acorn applications and
  688. should therefore be used if you want to the export graphs into a DTP
  689. document or have it displayed separately from the main Locus program.
  690. Saving in drawfile format also has the advantage that you can load the
  691. file into !Draw and add other data or text to it.
  692.  
  693. Everything that you see in the main Locus window will be saved as you
  694. see it and in the correct colours. Note that Locus does not use the
  695. draw module to display its graphs as the screen redraw is rather slow
  696. compared to the method actually used so saving a graph as a Drawfile
  697. will take a few seconds while the data is being converted.
  698.  
  699.  
  700.  
  701.