home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fish 'n' More 2
/
fishmore-publicdomainlibraryvol.ii1991xetec.iso
/
fish
/
math
/
plot_389
/
plot5.1.doc
< prev
next >
Wrap
Text File
|
1990-10-23
|
10KB
|
187 lines
Plot5.1, a 3-D function plotting program © 1990 by Terry W. Gintz.
Plot5.1 includes some enhancements and bug fixes to the previous version
of Plot. Provision is made for coordinate translation on both axis,
parametric equations, and standardized notation of the pow function (x^y --
which now works as specified.)
About the menus and new options:
On the main menu:
New Formula calls up a formula window containing two formula gadgets,
four parameter substitution gadgets and a title gadget. The main functions
are executed one after another, allowing equations with two solutions to be
plotted. Their length is 62 characters each. The four smaller string
gadgets are labeled D, F, J and K. Use these to enter mini-formulas (24 chars
maximum.) Thus, D might be entered as X+Y. The main
formula could be written SIN d. The program would then compute and plot the
equivalent formula sin(x+y), which could be used in the title gadget to
label the plot. Do not use forward referencing in the sustitution gadgets.
The mini-functions are calculated in real time, so d will be calculated
before k. K could be written as sin d, where d might have the formula x+y.
However if d were written as sin k, where k was X+Y, the plot would appear
to work, but it would jag due to inaccurate data on the previous pass. For
the same reason recursion does not work. Use of square root is now
supported anywhere in the main functions or mini-functions. Use
parenthesis to avoid ambiguitity. Parenthesis may used with any trig
operator.
Mini-formulas D and F can alteratively be used for coordinate-translation
on both axis, provided they are not used in either of the main formulas.
The value of D is applied to the x-coordinate before a point is plotted.
The value of F is applied to the y-coordinate before a point is plotted.
Mini-formulas J and K can alternatively be used to plot parametric
equations of the form x=sin(T) and y=cos(T), provided they are not used in
either of the main formulas. The Miny-Maxy range is used for 'T'. You
enter the x-parametric equation via J and the y-parametric equation via K.
See the cycloid options below for a special application of parametric
equations.
Stop Plotting halts the drawing after New Plot or New
Formula have initialized a new drawing cycle.
Use erase screen to clear the background before drawing a new plot.
The screen is not cleared automatically before each plot to allow one to
compare similiar plots side-by-side. The plot title is printed on the screen
for subsequent plots one line up from the previous one, until the screen is
erased. The title will then be drawn at the bottom left of the screen.
Use save function to save a configuration for future recall. This saves
all the slider options described below, all the substitution formulas and
the main formulas plus the plot title, so that unusual plots can be easily
shared between Plot users.
Load function loads a previously saved function configuration. After
the file is loaded, the set-options window is displayed. Click on Okay to
set the new options. Then the formula window is shown. Click on Okay to
set the new formula. Use New Plot to show the new function.
The 'Set Options' window called up by the second menu, contains 13 slider-
type gadgets for setting up variables to handle most plotting requirements.
Roll, pitch and yaw are used to describe the rotations. Roll turns the plot
sideways; pitch tips the plot forward or backward; and yaw spins the plot on
the viewing axis.
Magx and Magy determine the overall magnification on the x and y
dimensions. Some formulas require more or less magnification to view well.
Limits are .1 to 100X.
X Steps and Y Steps determine the spacing between dots and rows on the
screen. Vary 1-600 for increasing resolution. Generally a much smaller
number of Y steps than X Steps is required for clarity. Use 1 step to see
the function in two rather than three dimensions.
Minx, Miny, Maxx, Maxxy are the ranges for the loops that determine which
numbers (angles) are scanned to produce the plot. Provision is made for PI
-PI, -2*PI and 2*PI on the sliders, so accurate plotting can be made on trig
functions. Limits are -20 to 20 radians.
Minz and Maxz set the maximum z factor. This is usually the value of the
main formula before scaling occurs. Therefore, it is possible to plot cones
that look like textbook examples without the exponential curl at the edges.
Limits can be set from -50 to 50.
When plotting new formulas with 'New Plot' and 'New Formula' use the
green cursor to locate the plot on the screen, clicking the left mouse
button to start plotting. The plot may be stopped at any time by also
clicking the left mouse button.
Use 'New Formula' to enter your own formula. The program now interprets
up to 10 levels of parenthesis.
The trig and exponential functions translated include sine (sin), arc sine
(asn), cosine (cos), arc cosine(acs), tangent (tan), hyperbolic tangent (th),
hyperbolic sine (sh), hyperbolic cosine (ch), log (log), natural log (ln),
power (pow), arc tangent (atn), absolute value (abs), exponential (exp)
and square root (sqr.)
The math functions are ²(square),³(cube),*(multiply),-(subtract),/(divide),
and +(add). The square and cube operators are keyboard-acessible via Alt-2
and Alt-3, respectively. Use '-' to enter a negative number where necessary.
The constants are PI and E (ln (1)), plus any floating-point number up to 9
digits (including the decimal point).
The power function (x to the y power) is entered in standard notation:
'xpowy or x^y', with optional parenthesis necessary around complex exponents
or variables.
Note: Range limits exist for arguments to these functions: arc sine,
hyperbolic sine, arc cosine, hyperbolic cosine, arc tangent, and hyperbolic
tangent (+/-348.6 for the hyperbolic functions, +/-1.0 for the arc
functions), the log functions (must be >0) and the power function (x must be
integral and non-zero when y<0, and 0^0 is undefined). Square root is
undefined for x<0. No computations or plotting are done when these limits
are exceeded.
Syntax for an acceptable formula is AS([XY])+bs([xy])...
.up to 62 characters per formula. Algebraic notation is supported to a
limited degree. E.G. you can enter a variable as 2x², instead of 2*x*x. Some
trig notation, such as sin²x is now supported.
A and B are optional constants.
S is an optional trig function (1 to three letters: 1 will work for sine,
cosine and tangent, but use the above abreviations for the other functions.
X and Y are the standard variables (or use d,f,j,k to denote a mini-function.)
The '+' could be any of the math functions.
Use parenthesis to separate complex expressions. Use parenthesis to embed
trig functions within other trig functions, etc. Missing parenthesis or
extraneous operators that do nothing may result in inaccurate or incomplete
plots. Runtime checks are made for division-by-zero and over-nested
parenthesis. Use algebraic notation for speed and to avoid ambiguity with
math operators. '*' and '\' are executed before '+' or '-' in simple
expressions like x+y*sinx, but don't rely on this in more complicated
expressions (use parenthesis when in doubt).
Use Line Plot to produce a plot that connects the space between dots.
Generally, you reverse the amount of x and y steps from a point-by-point
plot. The advantages of a line plot are a faster plot(though cruder with
fewer steps), and more continuity (some plots do not become continuous
even with the maximum number of steps on a point-by-point basis.)
Use Two Pass to plot a cross pattern on the previous one to enhance
viewability on some plots.
Use Polar Plot to plot polar functions such as 1-cos(2y).
Use Hypocycloid to equate the x and y coordinates with the cycloid
formulas:
x = (J-K)cos(T)+Kcos(((J-K)/K)T)
y = (J-K)sin(T)-Ksin(((J-K)/K)T)
where J and K are entered via the J and K mini-formula gadgets.
T is derived from the Miny and Maxy range (the Y variable).
These are usually integral values,non-zero, where J>K.
Use Epicycloid to equate the x and y coordinates with the cycloid
formulas:
x = (J+K)cos(T)-Kcos(((J+K)/K)T)
y = (J+K)sin(T)-Ksin(((J+K)/K)T)
where J and K are entered via the J and K mini-formula gadgets.
T is derived from the Miny and Maxy range (the Y variable).
These are also usually integral values,non-zero, where J>K.
Use Hidden Line #1 for plotting functions with only one solution, in one
continuous plane. This algorithm removes lines which fall between the
minimum and maximum (visible) points of lines or points already printed. It
won't work for cone functions or hyperbolic functions of two connected
planes. Use Hidden Line #2 for these functions. Hidden Line #2 works as
Hidden Line #1 for the first (positive) solution to a function, then resets
the upper limit to plot the negative solution. No points are plotted on the
second pass that exceed or equal the lower limits established on the first
pass. There are some functions which don't work with either hidden-line
routine, or work only at a certain viewing angle. Hidden-line removal is
not available yet on polar plots, Two-Pass, or the cycloid plots.
Any questions, comments or donations should be sent to:
Terry W. Gintz
4237 Marcum Lane
Eugene, OR 97402
A donation of $20 or more for Plot will get you the docs for all my
current programs, plus any one of them for $5 off their suggested price,
and update privileges for $10.