home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ARM Club 3
/
TheARMClub_PDCD3.iso
/
hensa
/
maths
/
b061_1
/
!ReadMe
Wrap
Text File
|
1990-03-12
|
12KB
|
463 lines
!Graph
Overview
This Risc OS application produces graphs of mathematical functions. It
is fully multitasking and obeys Acorns rules for Risc Os applications.
It can graph cartesian, parametric and polar functions.
Axes can be manually set or automatically calculated.
Multiple graphs of any one type can be produced on the same set of
axes.
Zooming of cartesian functions is possible by using the mouse to
define the zoom area. This is useful for solving equations.
The coordinates of the pointer can be displayed for cartesian and
parametric graphs. This is useful for identifying the position of
features of interest.
Functions and axes values can be saved to disc.
The graphs produced can be saved as a draw file for loading into !draw
for enhancement and for exporting to D.T.P. applications.
Functions are checked for errors before plotting.
Functions can be entered in true algebraic form.
A large number of inbuilt functions are provided such as hyperbolic
trig functions and a factorial function.
Operation in degrees or radians.
The displayed graph will be scaled instantly as the display window is
resized. This means that the full graph will be displayed irrespective
of the window size.
Help messages are produced if !help is installed.
Page 1
Loading
The application can be loaded in one of two ways.
1 Insert and mount the disc. Double click on the !graphs icon. This
will install the application on the right of the icon bar.
Clicking once with select will cause the graph window to be
opened.
2 Insert and mount the disc. Double click on a graph data file.
These can be identified by having f(x)= on their icon.
This will cause the application to load and the graph file to be
loaded. The graph icon will appear on the icon bar. There will be
a pause whilst the functions are evaluated. A window will open
and the graphs will be displayed.
A minimum of 200k must be available to load !graph
Main menu
The main menu can be popped up at any time by clicking menu whilst
over the graphs window.
The menu has the following options:-
1 Save data.
This allows the functions and axes ranges to be saved to disc.
Follow the arrow to the right of the menu. A standard Risc Os
save window will appear. Enter the file name in the text box or
change the existing name. Then either drag the file icon to a
directory viewer or, if a full path name exists in the text box
click on OK
2 Save graph
This saves the current graph, as displayed in the graph window,
as a draw file for loading into other applications such as !Draw
and D.T.P. The size of the graph saved does not depend upon the
window size. It may be rescaled within !draw.
Follow the arrow to the right of the menu. A standard Risc Os
save window will appear. Enter the file name in the text box or
change the existing name. Then either drag the file icon to a
directory viewer or, if a full path name exists in the text box
click on OK
Files saved in this form cannot be loaded back into !graph.
3 Coordinates
When selected this opens a small window which shows the current
coordinates of the tip of the pointer in the coordinate system of
the the current axes. This is not available with polar graphs and
only operates when the pointer is over the graph window. This may
be cancelled either by clicking on the close window icon for the
Page 2
coordinates window or by selecting it again from the menu.
4 Axes
This causes the axes window to be opened, or brought to the top.
The axes window contains information about the current values
being used for drawing the graph. It is also used to determine if
some of the values are to be calculated automatically. A value
may be entered by moving to the box containing a value and
entering the new value.
Shaded values may not be entered since these will be calculated
automatically.
Clicking on the Auto Yes/No icon switches between the automatic
calculation of axes or the manual entering of all ranges.
Minimum values should be less than maximum values otherwise. If
they are entered the wrong way around they will be swapped. If
they are equal they will be adjusted. Values are given to a
maximum of six places of decimals.
The automatic calculation of axes values means that
re-calculation time is somewhat longer. Automatic calculation may
give unpredictable results if the function goes to infinity in
the graphed region.
5 Functions
This allows the function which is to be graphed to be entered and
edited.
The long box is used to enter the function (see the section on
functions)
The plot option can be set to yes or no. It must be set to yes if
the graph is to be displayed.
Up to six cartesian and three polar and parametric functions can
be entered. Each function is numbered. The function displayed can
be changed by clicking on the left or right arrow. The box at the
top right indicates in which colour the function will be drawn.
6 Cartesian
This selects cartesian functions and axes. Other types are stored
internally. Any present cartesian functions are calculated and
displayed.
7 Polar
This selects polar functions and axes. Other types are stored
internally. Any present polar functions are calculated and
displayed.
8 Parametric
This selects parametric functions and axes. Other types are
stored internally. Any present parametric functions are
calculated and displayed.
9 Degrees
This selects between degrees and radian angular measure.
This may be ticked (to indicate degrees are to be used) or
unticked (to indicate the use of radians). Select changes the
state of the tick. (Default not ticked)
Page 3
10 Show axes
This selects between displaying and not displaying the axes. When
ticked the axes will be displayed. (Default is ticked)
Redrawing the graphs
Since the redrawing of a graph takes a little while (depending on the
complexity of the graph) the display is only recalculated when
required. To force re-calculation press select whist over the graph
window. The standard hour glass will be displayed whist re-calculation
takes place. Any regions of the graph where the function evaluations
are not possible (E.G. square roots of negative values) will result in
slower computation.
Loading a file
With the application loaded a graph data file may be loaded either
by:-
1 Double clicking on the file in a directory viewer.
2 Dragging the file and dropping it on the !graph icon on the icon
bar.
In both cases the graph data file will be loaded and the functions
recalculated. Any previous functions will be lost.
Functions
Cartesian functions are entered in terms of the variable x.
Polar and parametric functions are entered in terms of the variable t.
Functions can be entered in true algebraic form.
For example
cos 3x sin 2x
will be evaluated as (cos(3*x)) * (sin(2*x))
If in doubt about the order of evaluation add brackets to force
correct evaluation order. Functions may be entered in upper or lower
case and spaces are not important.
Help
By installing the application !help the program will give relevant
help depending upon the position of the mouse.
Page 4
Operators and functions used
+ Addition
- Subtraction
* Multiplication
/ Division
^ is used to raise to a power. EG x^3 for x cubed.
DIV The integer part of the division eg x DIV 5
MOD The remainder part of the division eg x MOD 5
INT The integer part of the following expression. eg INT x
SGN The sign of the expression. -1 for negative, 0 for zero 1
for positive.
ABS The absolute value of the following expression eg ABS x
PI The constant 3.14159265
RND A pseudo random number in the range 0 to 1
SQR The square root of the following expression eg SQR x
LN The natural logarithm of the following expression eg LN x
LOG The logarithm to base ten of the following expression. eg
LOG x
EXP e raised to the power of the expression. eg EXP x
FACT The factorial of the expression in brackets eg FACT6
COSH The hyperbolic cosine of the expression. eg COSHx
SINH The hyperbolic sine of the expression. eg SINHx
TANH The hyperbolic tangent of the expression. eg TANHx
ARCCOSH The inverse hyperbolic cosine of the expression. eg ARCCOSHx
ARCSINH The inverse hyperbolic sine of the expression. eg ARCSINHx
ARCTANH The inverse hyperbolic tangent of the expression. eg
ARCTANHx
The following take notice of the degree\radian mode selection.
SIN The sine of the expression eg SIN x
COS The cosine of the expression eg COS x
TAN The tangent of the expression eg TAN x
ASC The inverse sine (arc sine) of the expression eg ASC x
ACS The inverse cosine (arc cosine) of the expression eg ACS x
ATN The inverse tangent (arc tangent) of the expression eg ATN x
Zooming
When cartesian axes are being used it is possible to zoom in on an
area. Move to the bottom left of the boundary of the region to be
zoomed. Press adjust.
A bounding box will be drawn from where the pointer is to where the
pointer was when adjust was clicked.
Move to the top right of the area so that the bounding box contains
the area to be zoomed. Press adjust again.
Page 5
The graph will now be re-drawn with the new axes range.
Saving as a sprite
It is usually preferable to export the graph as a draw file, it may be
saved as a sprite by using the grab sprite option on !paint and
grabbing the graph from the window.
Page 6
Note
The file type 777 has been used for a graph data file.
A F Lane
3 Lansdowne Gardens
Hailsham
East Sussex
BN27 1LQ
February 1990
Page 7