Install !Locus on the Icon Bar by double clicking on the !Locus icon in
the filer window. When the Locus icon appears on the Icon Bar click with
SELECT (the left mouse button) on the icon. This will open the main
Locus window. This is the control centre of the application. At the top
of this window you will see a control panel (called the 'button bar')
containing three rows of icons. These control the settings and most of
the input for the application. At first they may seem to be rather
bewildering but all will become clear very soon as most of them are
fairly self explanatory.
Look first at the bottom row of icons. You will notice that when the
main window opens the caret will be in the large writable icon. Type the
letter ‘x’ (upper or lower case) and either click on the <Plot> icon or
press the RETURN key. A straight line will appear running from the
bottom left hand corner of the screen to the right hand corner. You
might notice that this doesn’t look much like ‘y=x’ which should run at
45 degrees to each axis. So I shall now explain how to edit the graph so
that it looks right.
Look at the rightmost icon of the second row. This is the 'squaring up'
button and should contain a picture of an ellipse. Click on this button
and watch what happens. First the picture on this icon will change to a
circle and then the Hourglass will come on for a few seconds. When the
Hourglass stops the graph will redraw and you will see that it is now
square shape and the graph of y=x will be as you would expect it to
look.
Let us now add a grid so we will have a more accurate view of the
coordinates in the graph. Press MENU (the middle mouse button) and
click on 'Settings'. This will open the 'Settings' dialogue box. Click
on the button to the left of the item 'grid' so that it is ticked and
then click on the <OK> button. Again the Hourglass will come on for a
few moments and the graph is redrawn showing a grid.
You may wish to experiment with the ‘squaring up’ icon to see how this
toggles the graph back and forth between rectangular and square, both
showing the grid and the graph.
You can now superimpose other related graphs on top of the one already
drawn. With Locus this is easily done. There are two methods you can use
for this but at this point I shall only describe the simpler of them.
To the left of the ‘squaring up’ icon is the ‘auto-scaling’ icon which
should be on; that is, it should appear recessed or pushed in. When
this is on each time a new graph is drawn the previous one is erased,
but if it is off each new graph is drawn over the old ones until the
'clear' icon (the third button from the left on the top row) is clicked
or auto-scaling is turned back on. Click on this to switch it off. The
button will move to the 'off' position, that is, it will appear to stand
out from the background. Now the ymin and ymax writable icons will
become active and the graph will be redrawn. Now Click with SELECT in
the formula input icon (the large writable icon in the centre of
the bottom row) and add the symbols ‘+1’ to the ‘x’ already there. Now
press RETURN or click on the <Plot> button. The graph of y=x+1 will be
superimposed onto the graph already drawn but in a different colour.
To superimpose a third graph, for example, y=x+2, simply replace the
‘+1’ in the formula icon with ‘+2’ and press RETURN again. This process
can be repeated as often as you like.
You may also like to try changing the coefficient of x to see how the
gradient of the line changes. For example try y=2x+1.
To clear the screen without changing the axes or the grid click on the
'clear screen ' button with SELECT.
Exercise 2. Domain and Ranges
We shall now try some trigonometric functions. Set ‘auto-scaling’ to
'on' and ‘squaring up’ to 'off', that is, the auto scaling button should
be 'in' and squaring up 'out'.
Ensure that Locus is set to degrees mode. There are two buttons on the
top row, one showing a full circle, representing degrees, and the other a
broken circle, representing radian measure. Check that the degrees
button is 'on', and if not click on it.
Check that the 'xmin' icon reads ‘-180’ and the ‘ymin’ icon reads ‘180’.
(If they do not contain these figures then click in the appropriate
icon, press Ctrl U to clear the icon, and type in the correct values.)
There is a choice of two different methods for entering formulae. For
the first you just type the required formula in the formula input icon
(the method used in the previous exercise). The second method lets you
select a formula from a menu. Click on the 'menu' button to the right
of the formula input icon and a long menu will appear containing the
preset formulae. The first entry should be ‘sinx’. Click on this and it
will appear in the formula icon. Now press RETURN or click on the <Plot>
button to plot the graph of ‘y=sinx’.
If you look at the formula menu you will see that !Locus can recognise
most standard algebraic forms of input. An exception is powers where the
‘^’ symbol is used for powers greater than 3. For squares and cubes, use
the appropriate button on the icon bar.For a full list of the functions
Locus will recognise see Appendix A at the end of the manual.
You could now return to Exercise 1 change the period of the graph by
superimposing the graphs of y=sin2x and y=sin3x on top of y=sinx. Don't
forget to turn off auto-scaling or the previous graphs will be erased
before drawing the new one.
We shall now consider 'domains' and 'ranges'. It is possible to use
Locus without worrying about ranges, but you will have to understand
domains. These are the values fed into a function. For instance,
using the example 'y=sinx', the values which are given to the variable
'x' represent the domain of the function. In this example, all possible
values of 'x' can be fed into the function, but there are functions such
as 'y=1/(x+1)' where the value 'x=-1' has no meaning to the function.
However you do not need to worry about this as Locus will deal with it
automatically and draw asymptotes at the undefined point(s).
Look at the icons on the middle row. t-min and t-max are greyed out at
the moment and do not concern us until we move on to polar and
parametric graphs. Whatever the default settings you will need to change
these manually at various times. Click with SELECT in the x-min icon and
press Ctrl U which will clear the icon (as with all other RISC OS
applications.) Now type in the new x-min value and press RETURN which
will move the caret into the x-max icon where you can also change the
value.
Example exercises
1. Turn on auto-scaling
2. Draw the graph of y=sinx as before
3. Click in the x-min icon and Press Ctrl U to clear the icon
4. Enter the value -360 and press RETURN to move the caret to the
x-max icon
7. Press Ctrl U to clear this icon and enter the value 360
9. Press RETURN or click on the <Plot> button.
The graph of y=sinx will be redrawn using the domain -360 to 360
degrees. This has doubled the domain of x from the previous values of
-180 to +180.
With this example a simpler method would be to use the negative zoom
facility.
1. Draw the graph of y=sinx using the domain -180<=x<=180
2. Click on the button on the top row containing the picture of a magnifying glass
and a minus sign.
As before the domain will double and, if auto-scaling is on, Locus will
rescale the y axis appropriately. This could cause problems if xmin is
greater than zero or xmax is less than zero as the graph would be drawn
progressively further and further away from the origin.
In these situations the Move Graph icon can be used. This is the icon
with blue arrows pointing out from the centre which will be found in the
same group as the negative zoom icon. If you click on this the button
will depress. Now move the pointer into the main window and you will
find that you if you hold down the SELECT button you can drag the graph
to a new position.
Exercise 3. More on Zooms and Rescaling.
Ensure that Locus is set up as follows.
1. 'auto-scaling' should be 'on'.
2. ‘squaring up’ should be 'off'
3. Set the domain to -0.1<x<0.1
Now draw the graph of y=xsin(1/x) (this can be found on the formula
menu.)
This is a fascinating function which becomes interesting for values of x
which are very close to zero, so we shall use the manual zoom facility
to see what it looks like close to zero.
5. Click on the icon showing a picture of a magnifying glass and
a plus sign.
6. Click <Select> and hold at the point (-0.002,0.003)
7. Drag the box to the right and down to the point (0.002,-0.003)
8. Release the mouse button.
9. Zoom in a few more times to see what happens.
Because of the way Locus works you may find that the oscillations become
wild and inaccurate. It would take a very long time to plot every point
on the graph and this would normally not be necessary. However there are
times when accuracy is desirable.
In the middle of the top row of buttons you will see a writable icon
flanked by a pair of ‘bump’ icons. This should normally contain a number
in the range 128-512. This is the Plot Step value. (For more information
see the manual). If you are drawing graphs with lots of asymptotes or
wild oscillations then the number should be large, but the larger the
value the more slowly the graph will be drawn.
Clicking on the small, triangular, button arrow to the right of this
icon increases the number and clicking on the similar button on the left
decreases the number.
Click on the right hand button until the number rises to 4096 (you can
do this by typing the number if you prefer.) and then click on the
<Plot> icon. You should see an immediate change in plotting speed but
also note the change in accuracy.
If you want to zoom out again you can use the negative zoom button but
it is best to reduce the plotting step first so that this does not take
too long.
If you get bored waiting for the graph to plot, pressing ESCAPE will
stop the plot and return control to the user.
Exercise 4. Constants and Families
Many graphs are related to each other and Locus lets you study the
effect of changing one or more constants in your formula definitions and
to plot several graphs at one time.
This Exercise will describe one example and then you can experiment for
yourself.
If you are studying the shapes of simple quadratics you might be
interested in the effect of changing the coefficient of x.
1. Turn off auto-scaling
2. Set the axes as follows:
xmin: -7
xmax: 5
ymin: -10
ymax: 30
3. Click on <Plot> to set the axes
4. Type x²+bx into the formula input icon.
5. Click on the constants button. (This is the one with ‘abc’
written on it.)
6. Type 0 into the second field, marked ‘b’
7. Click on <OK>
8. Click on the Family button which is to the right of
the constants button.
9. Type 5 into the field at the top (This sets the number of
graphs to be drawn.)
10 Type 1 into the ‘b’ field on the increment pane (This sets the
amount of the increment.)
11 Click on <OK>
It is acceptable to set several constants and change them simultaneously
if you wish, although this is normally regarded as bad practice.
As an example, let us suppose you are doing some work on projectiles.
It is possible that you will want to set several constants at the start
and then alter them one at a time.
In order to examine this we need to consider how Locus deals with
parametric equations. If you already understand parametric equations
you may prefer to skip the following paragraph.
A pair of parametric equations is a mathematical construct where,
instead of the more familiar case where we define y in terms of x,
we define both x and y in terms of a third variable (in this case ‘t’
which represents time.)
When considering the motion of a ball thrown into the air, the standard
cartesian equation of the path is very awkward to use and does not
contain all of the information that we need, for example, it makes
no mention of time. By using parametric equations we are able to
define the path and analyse the motion taking time into consideration.
As an example.
1. Click on the Clear Screen button
2. Turn off auto-scaling
3. Make sure you are in ‘degrees’ mode (the full circle is 'on')
4. Click on the button on the top row of the main window pane
which contains the letters x,y,t
5. Set the axes as follows:
tmin:0
tmax:4
xmin:-2
xmax:50
ymin:-5
ymax:30
6. Click on <Plot> to set the axes
7. Select the equation set utcos(a),y+utsin(a)-9.8t² on the
Formulae menu
There are two things you should take note of at this point. Firstly,
both the x and y equations are written on the same line separated by a
comma. Secondly, if you are finding trigonometric functions of constants
Locus requires that you put parentheses around them.
8. Click SELECT on the constant ('abc') icon
9. Set a=5;u=25;y=0 and click on the <OK> button
10. Click on the family icon next to it
11. Type 9 into the ‘Number of Graphs’ icon.
12. Type 10 into the ‘a’ increment icon
13. Click on <OK>
You should see a series of negative quadratics which get progressively
higher but d not travel as far horizontally. You should note which angle
gives the maximum horizontal range.
As an exercise try using the same equation set, but this time set the
value of a to 45 and only increment the value of y. Draw seven graphs
incrementing y by 1 each time. Using different values of a and y is a
good way of demonstrating why an Olympic shot putter does not release
the shot at 45 degrees to the horizontal.
Exercise 5. Polar graphs
So far we have only examined standard cartesian or rectangular graph
shapes. We will now consider Polar graphs.
Instead of defining the coordinates of a point in the x-y plane in terms
of its horizontal and vertical coordinates, it is also possible to
define the same point in terms of its distance from the origin and the
angle that this line makes with the horizontal axis. Most mathematics
students find this difficult at first as they have become used to the
cartesian model. In fact we tend to base real life directions more on
the polar than the cartesian model. For example, bearings .
1. Click on the icon on the top row containing a picture of
‘r=sin2t’. This is the fourth icon from the left.
2. Turn on auto-scaling.
Note that all of the x and y range fields are now ‘greyed’ out but the t
fields are now selectable. If you are in degrees mode, enter '0' in the
tmin icon and 360 in the tmax icon, otherwise set the range to 0 to 2p.
Locus uses 'p' as a constant which represents the value of pi.)
3. Set the t range
3. Click on the formula menu icon
4. Click on ‘t’ which should be the first entry.
5. Click on <Plot>
The graph will be drawn correctly for the given range.
You should now experiment with changing the various settings to get
different effects and try drawing other similar graphs both from the
menu and of your own devising.
Exercise 6. Implicit Graphs
Sometimes formulae may not have ‘y’ neatly defined in terms of ‘x’ as in
‘y=sin2x+4cos3x’. You may encounter expressions which have x’s and y’s
mixed on the same side of the equals sign, for example ‘x²-xy+y³=23’.
This type of equation is called ‘Implicit’ and this exercise describes
how Locus implements them.
The example given above is rather complicated, and is not the type of
problem that would concern most people. However, simple implicit
equations are often used at G.C.S.E. level. Consider the following
problem:
Solve the following pair of simultaneous equations
3x + 5y = -1
2x - 3y = 12
This is the type of problem that Intermediate and Higher level G.C.S.E.
students will be required to solve at some time, either graphically or
algebraically. In fact, this is a pair of Implicit equations as the x’s
and y’s are on the same side of the equals sign.
The reason simultaneous equations are written like this is to avoid the
added algebraic complication of having fractional coefficients in the
equation.
To examine the above set of equations first turn the grid on by ensuring
that the 'Grid' option in the Settings window is ticked. Now set an
appropriate domain and plot the first graph with auto-scaling switched
on. Then turn auto-scaling off and type in the formula for the other
equation. You will then be able to use Zoom to determine where the lines
cross.
The Implicit routines are not yet complete, but they are adequate for
plotting one to one, one to two and two to one mappings. However Locus
may become confused if asked to do anything more complex. The reason for
including this incomplete facility in the first release is that it is
very useful for teaching linear simultaneous equations.
Exercise 7. Data Sets.
One of the most powerful aspects of Locus is its ability to deal with
imported sets of numerical data in two variables. You can import data
in one of three formats.
1. Text
2. CSV
3. SID
There are various ways these data sets can be produced both from within
Locus and by other means. I shall describe how to create these data sets
shortly, but first let us see how they are displayed.
Look in the directory 'Data Files' which accompanies Locus and find the
CSV file ‘SpanHeight’. This is a small data set which examines the
correlation between the arm span and height of a few pupils. Now make
sure that auto-scaling is on and drag the file ‘SpanHeight’ onto the
main window.
You will notice that the axis titles have changed to show the headers
for each of the variables in the data file and that Locus sets the scale
so all of the points are plotted.
This is may not be the best scale to analyse the data so you may wish to
alter the scale to see the data better.
1. Turn off auto-scaling
2. Change the scales as follows:
xmin=1200
xmax=1900
ymin=1200
ymax=2000
3. Click on the <Plot> button.
You may wish to change the appearance of the data set and to do this you
must to go to the ‘Effects’ item in the main window menu. Click MENU
over the main window and click on the item 'Effects’ on the menu which
will appear. This opens a dialogue box which enables you to set the
Locus display. For a full description of this please see the manual.
The entries half way down the box let you set the colour of the various
objects that Locus deals with, axes, graphs etc. Part way down this pane
you will find five entries called Mark 1, Mark 2, etc.. These refer to
data sets. It is important to note that you are not restricted to
displaying only five data sets simultaneously, it is just that there are
only five colours available and so these will be used in turn, repeating
after all five have been used.
The only restriction on the number of data sets that can be loaded at
any one time is the amount of memory in your computer.
Click with MENU on the Mark 1 colour icon and select the colour you
want to use.
Towards the bottom of the Effects dialogue box is the section which
defines the Marks, this has two items. Mark style, which controls the
shape of the mark, and Connect Marks, which controls whether the marks
are joined together .
To change the Mark style -
1. Click <Menu> on the mark style menu icon.
2. Choose a different mark
3. Press on <OK> to effect your changes.
Producing Data Sets
Firstly they can be produced using a spreadsheet. Most Spreadsheets can
export data in CSV or SID format. Another method is to write files
manually using a text editor such as Edit, Zap or StrongEd. The
structure of the files that Locus will recognise is as follows:
1. The top line consists of the titles you want to appear on the
horizontal and vertical axes. Text may be enclosed in inverted
commas. For example this line in the example is “Arm
Span”,“Height” but could have been Arm Span,Height.
2. The data follows, two items on each line, an x-coordinate and a
y-coordinate, separated by a comma.
3. You must ensure is that if you are writing the data to a text
file you should press RETURN at the end of the last line of data.
The second way of generating these files is to save them from Locus.
This may seem a little pointless at first but as you will see later
there are uses for this.
As a simple example let us plot the graph of y=x² as we have done
above.
1. Set auto-scaling to 'on' and a domain -4<=x<=4.
2. Click MENU over the main window and move the mouse to the right
to the sub-menu File.Save.
3. Move down to the item CSV and move the mouse to the right and a
save dialogue box will open.
4. Fill in the Start,End and Step fields as -4,4,0.1 respectively.
5. Change the name to ‘xsqu’
6. Drag the file icon to a filer directory window.
7. Click on the clear screen icon
8. Drag the CSV file onto the main Locus window.
9. Open the effects dialogue box and change the Mark style to Dot,
select the Connect marks option icon and click on the <OK> button.
The resulting curve should look almost identical to your original graph
of y=x². The reason for this more complex method is that you can now apply
different transformations to your graph in either matrix or described
form in order to analyse the function. This is the subject of the next
exercise.
Exercise 8. Fitting curves
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.)
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.
The student could now try out different functions to see whether they fit the points.
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.
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.
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.
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.
Exercise 9. Transformations
When you first load Locus the two main menu items Transform and Matrix
will be greyed out and will remain so until a data set is dragged into
Locus. This is because transforming formula drawn graphs would be too
slow and therefore this is not implemented.
Let us examine various transformations on a simple irregular shape.
1. Find the textfile entitled ‘Flag’ in the DataFiles directory.
2. Turn ‘auto-scaling’ off and ‘squaring up’ on.
3. Set the domain and range as follows:
xmin: -5
xmax: 5
ymin: -5
ymax: 5
5. Click on the <Plot> button set set the axes.
6. Make sure that you are in Degrees mode.
7. Drag the ‘Flag’ file onto the main Locus window.
8. Make sure that the ‘Connect Marks’ option in the Effects
dialogue box, is on.
9. Click MENU over the main Locus window and move the mouse
down to Transform. Here you will see four transformational
options. We will only look at Rotation and Reflection in this
exercise, but for details of the others see the manual.
10. Type 45 into the Angle field
11. Type 0,0 into the Centre field
12. Click on the <Apply> button. The flag will be duplicated but
this time rotated through +45 degrees.
13. Now click on <Apply> again. A third flag will appear. You will
see that the transformation is applied this time not to the
original flag but to the last one drawn. Hence the third flag
is at 90 degrees to the original. If you continue to repeat
this process you should end up with a full circle of flags
centred around the origin.
Reflection is a little bit more complex but only marginally so.
There are two options -
i) y=mx+c which is used to produce any linear function
ii) x=c which is used to produce vertical lines
1. Click on the clear screen button
2. Import the ‘Flag’ file as previously described
3. Open the Transform box
4. Select the x=c icon
4. Type -1 into the mirror line field. (To the right of 'x=' )
5. Click on <Apply>
Now try selecting the y=mx+c icon
1. Click on the clear screen button
2. Import the ‘Flag’ file again
3. Ensure that the Transform box is open
4. Select the y=mx+c icon
5. Click in the field to the right of ‘y=’
6. Type -2 and press RETURN
7. Type -1
8. Click on the <Apply> button.
9. Using the main function plotting facilities plot the line
y=-2x-1.
Notice that the image flag is reflected using the mirror line y=-2x-1.
You can now experiment with this facility. You may like to see what
happens when you transform the ‘xsqu’ file that you created in the last
exercise.
The Matrix item in the main menu does operates in a similar manner but
the transformations are entered in 2x2 matrix form instead of the
descriptive form previously described. With this you can examine eigen
values and vectors and the dimension crushing that some matrix
transformations exhibit.
It is also possible to enter the data without using CSV, SID or Text
files and for small numbers of data points this is often the preferred
method of data entry. On the top row of the main control pane there is
an icon showing two crosses joined with a line. Click on this icon and
a window will open containing 21 writable icons. The first of these
contains the axis titles. Dy default these are ‘x’ and ‘y' and can be
changed if you wish. The coordinate pairs can be entered in the other
twenty icons, separating them with a comma.
For example, type the following pairs into the first 4 icons.
1,1
1,4
2,3
1,2
Now click on the plot button to produce the flag which you have been
using during the earlier part of this exercise.
You can also drop small data files (<20 pairs) onto the arrow icon in
the coordinates window to load them if you wish.
Exercise 10. Calculus
This exercise is only relevant if you are engaged in post 16
mathematics.
There are three Calculus tools available for analysis of cartesian
functions.
A tangent drawing tool
An option to draw the derived function automatically
An option to draw the integral function automatically
1. Set Radian mode and set the domain to -2pi to 2pi. (Remember
that the constant p contains the value of pi, so typing -2p and
2p will do the trick.)
2. Draw the graph of y=sinx
3. Now click on the coordinates icon which is on the top row of the
main pane and contains a picture containing ‘(x,y)’. This will
open the coordinates window. If you click on the ‘toggle size’
icon this will also give you information on the polar
coordinates of points on the graph and the gradient of the curve
at particular points.
4. Click on the ‘Tangent’ icon which is to the right of the coordinate
icon.
5. Clicking the mouse in the main window will draw the tangent to the
curve at the x-coordinate where you clicked.
6. You can also hold the mouse button down and drag the tangent along
the curve.
This facility is useful for examining how the tangent changes along the
length of a curve enabling the gradient function to be sketched.
Note that the coordinates window does not need to be open for the
tangent facility to operate.
The second and third tools are much simpler to use. Select the two
buttons on the right of the top row showing pictures of dy/dx and an
integral sign. Now draw the draw of y=sinx and observe what happens. The
original graph is drawn and then the derivative and integral functions
are superimposed onto it.
Exercise 11. Saving your work
We have already dealt with the saving of data sets but there are two
other file formats that Locus can use to save data, LocFiles and
DrawFiles.
LocFiles are a special file format used only by Locus. They contain all
the original settings, graphs and/or families of graphs that were on
screen when the file was saved.
DrawFiles are the standard graphic format for all Acorn applications and
should therefore be used if you want to the export graphs into a DTP
document or have it displayed separately from the main Locus program.
Saving in drawfile format also has the advantage that you can load the
file into !Draw and add other data or text to it.
Everything that you see in the main Locus window will be saved as you
see it and in the correct colours. Note that Locus does not use the
draw module to display its graphs as the screen redraw is rather slow
compared to the method actually used so saving a graph as a Drawfile
will take a few seconds while the data is being converted.