home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
450a.lha
/
AmigaPlot_v2.1a
/
APlot_Docs
< prev
next >
Wrap
Text File
|
1990-12-04
|
17KB
|
421 lines
Amiga Plot V2.1 Joe Martin 11/90 (C)Copyright 1990
**************************** *** NOTICE *** **************************
This program is Shareware. All rights retained. Permision is
granted to freely distribute this program as long as all documentation
and notices remain intact. Charges for such distribution are NOT
permitted except as a nominal disk charge(ex. Fred Fish) !!
If you find this program useful, entertaining or educational,
please register and send the $20 to the author.
**********************************************************************
Amiga Plot is a three dimesional mathematical function plotter. It
takes a function, derived by the user, parses it into a partially
compiled form and then calculates coordinates to be placed in the xyz
system. AmigaPlot use hidden line removal based on a principle known
as the painters algorithm. Each time AmigaPlot goes to the screen it
places a filled polygon. Starting from the most distant part of the
plot it is constantly placing filled polygons in front of other
polygons there by covering the hidden portions of the plot. Many
aspects of the plot are user variable so that almost any combination
of rotations, perspectives, and parameters for any function can
produce infinite results. AmigaPlot is not intended for statistical
analysis and the precision of the plot or its scale are not guaranteed.
The use of color in the plot can produce very pleasing effects
especially when a feathered pallet is used. The idea of AmigaPlot is to
provide an artistic approach to the sometimes dry subjects of Analytical
Geometry and Trigonometry.
**** Minimum memory 512K - it uses most of it *****
************ 1 or 2 meg recommended **************
Address any questions, comments or bugs to:
Joe Martin
Hobbit Hole 1-904-243-6219 8N1
or
Joe Martin
2702 Willow Grove Ln.
Ft. Walton Bch. Fl 32548
******************* updates and bug fixes ***************************
2.1a-
Amiga Dos 2.0 compatible.
Paser completely overhauled
Paser error checking added
user defined variables
More flexibility with screen arrangement
Full support for overscan via morerows or 2.0
Pen Colors are now completely configurable
Better axis rendering during plot
2.0c- BUG/BUG/BUG fix
Uhh..Uhh, guess what I discovered. Nobody said anything, but the
parser has not been doing its' job very well.(:-( I discovered that much
to my suprise, simple functions like 'x^2 - 6*x + 9' and '(x-3)^2' which
should yield identical results didn't. Mucho hair pulling later, they do
now. Actually only lately have I looked into the simplier 2d functions
that some wish to plot. I'm adding the 2d plotting by request. Anyway
the parser wasn't handling multiple(more than 2) operations, on the same
level, correctly. Some other parsers I've looked at lately don't all
work right either. Try calcs like, 2^4/2*3/2, 12, these are hard to
parse.
Added menu item to quickly set up parms for 2d plotting. This is not
finished but you can experiment.
2.0b-
Found a few more bugs(fixed).
Overall speed increased(10-15%).
Menu structure adjusted for easier choice.
Ability to save plot window, as apposed to screen.
2.0a-
All three windows share the same message port so you do not
have to have the Parms window active in order to use the pull down
menus. This was in 1.3a but I took it out after using some of the
sunmouse utilities that abound. I had tried to save a little memory
by taking it out of 2.0, my mistake, it's back in! This is the only
difference between 2.0a and 2.0.
Enhancements from version 1.4 to 2.0:
1- No Keyboard entry required. (Adjustable gadgets)
2- Some parameters can be adjusted during plot.
3- Solid, Line or Point plots.
4- Coordinate axes for visual rotation adjustments.
5- Full 3 axis rotations and scaling.
6- Radian and Degree units.
7- Limit for 'Z' axis.
8- Full Clipping routines. This helps a lot.
9- New look(Big deal right).
10- Manual clear screen allows multiple functions on same screen.
11- Version 2.0 is more memory efficient(about 70K less chip ram).
**********************************************************************
******* First MAKE SURE YOUR STACK IS SET TO AT LEAST 10000 **********
**********************************************************************
Amiga Plot can be run from the workbench with the icons provided,
and in that case the stack is set automatically.
Amiga Plot is initialized at the CLI by 'Run APlot' (don't forget to set
stack 10000 first !)
For convenience, the directory 'aparms' is included and includes
numerous function examples. These can be loaded from the 'Files' menu
and make it extremely easy to play with and to alter different
functions known to yield satisfatory results.
Also the directory 'apic' is included with examples of Iff
pics. These pictures can be viewed with any showiff program.
******************************* NOTICE *******************************
Version aplot1.4 parm files are not compatible with V2.0+ parm
files. I have included all previous parm files in the new format.
Sorry for this inconvienence.
**********************************************************************
Four windows appear-
1- Amiga Plot window - for the plots.
2- Perspective window - Viewing parameters.
3- Control window - Plot controling features.
4- Function window - for function input only.
There are two menus available for some parmameter changes, color etc.
In version 2.0+, no keyboard input is necessary, nor provided for,
in the perspective window. Each parameter is located in an adjustable
gadget. If you point to the right half of the gadget and hold the left
mouse button down the values will increase. Likewise, the left half
decreases the value. You can adjust the rate of increase/decrease if
you push and hold either the SHIFT key(increase rate by factor of
ten), or the CTRL key(decrease rate by factor of 1/10) before pressing
left mouse button.
AXIS:
When Amiga Plot is first run, you will see the coordinate axes in
the plot window. The axes serve two purposes. They show the user the
orientation of the plot(rotations) and the relative size of the plot.
If the rotations are all set to zero then the axes are positioned as
follows:
X axis points from left to right with negative to the left of the
origin and positive to the right.
Y axis represents depth with the negative portion in the
foreground and positive to the rear.
Z axis runs up and down with negative down and positive up.
The rotation of each axis is governed by the corresponding gadget
in the parms window under the label 'Rotate'. Try these gadgets and
watch the corresponding changes in the coordinate system axes.
The 'Axis' gadget will toggle the axes on and off as well as clear
the plot window.
NOTE --The 'Y' and 'Z' rotations always spin about their respective
axes relative to their current position. This is as it should be. The
'X' rotation is about a fixed imaginery axis which is stuck in the
horizontal position. I've checked my matrix formulas and cannot seem
to dispell this problem although it really does not limit the relative
positions possible.
SCALE:
The 'X' and 'Z' scaling factors affect the on screen size of each
axis and subsequently the size of the plot. The 'Y' scale has a
slightly different effect. Since the 'Y' axis represents depth,
scaling this axis has a profound affect on perspective. Try these
gadgets on the coordinate axes to see the results before plotting a
surface.
HINT --Overall size and perspective is better adjusted with the
'Object' and 'Image' gadgets discussed later.
MINIMUM/MAXIMUM(x,y,z)
It is important to understand the Domain and Range of a function.
The Domain is said to be the set of all first components from a set of
ordered pairs and the Range, a set of all second components from the
set of ordered pairs(x,y). This set of ordered pairs is going to be
fed to our function(f(x,y)) which will yield values(Z). These
values(Z) will become part of a set of ordered triples(x,y,z) and will
then be plotted in our 3d coordinate system.
What actually happens in Amiga Plot is this. Starting with the
maximum of the 'RangeY', this value is placed together with each
value from the DomainX(low to high) yielding that 'Z' value and all
those ordered triples(x,y,z). These points are plotted, then the
RangeY is decremented and the process repeats until it reaches the low
RangeY value. Then the plot is complete. If I explain any further,
you'll just get tired of reading this so try a plot and see for
yourself!
RESOLUTION:
Simple, the X and Y segments are the number of increments across
the axis. In other words, how many points(X) you want graphed on each
pass, and how many passes(Y) to run through.
OBJECT and IMAGE:
Object and Image represent distances from your eye to the actual
surface(object) in 3d space and to the objects 2d projection(Image) on
your screen. Adjust these for sizing the overall image as well as
perspective. Experimentation is the best way, so try it.
TRANSLATION:
'X' will move the axes left or right on the screen while 'Y' moves
them up or down.
PLOT and STOP:
says it all!!
CLEAR:
This gadget clears the screen. If you don't clear the screen
between plots you can create composites of different functons. Any
window sizing also clears te screen.
SOLID, LINE, and POINT:
Determines what type of plotting to construct. Solid for hidden
line removal and shading effect. Line and point for transparent
effects. These can be changed during a plot for interesting features.
Function Gadgets:
There are 3 string gadgets available for function input:
The function window can be sized, and at maximum allows for three
lines of variable and function declarations. These three lines should
be though of as continual(one long line). White space is ignored and
upper and lower case can be used, although all characters are
converted to lower case.
Parser Rules:
1- up to 12 variables or functions can be specified, using commas to
separate.
2- function(variable) names are up to 11 characters in length,
followed by '=' then mathematical expression.
3- A numerical constant may preceed a variable or paren. to indicate
multiplication. Ex '2x' means '2 * x'
4-Any function declaration may include any variable(function)
previouslly declared.
5- The last functon declared will be the one plotted.
The default function and parms are loaded when running aplot. The
default function declaration is a good tutor for introducing the
parser coding specs.
a=x^2, b=y^2, f=3sin(-.05(a-b))-2cos(.1(a+b))
The last declaration is considered the function to be plotted, in
the above case, this would be 'f'. 'a' and 'b' are variable(function)
declarations and may be included in any function which follows. Note
some of the short hand notations allowed by the parser.
Ex. 3sin -> 3 * sin
-.05() -> -0.5 * ()
This notation is available after a constant only, so 'ab' would be
considered as a variable name and not as 'a * b'. Use parentheses
liberally and whenever operator precedence is in doubt.
Editing : same as for any string gadget - cursor keys, del, backSp
etc.
operations : +,-,*,/ divsion by zero is trapped.
^ to the power of
grouping : ()
functions : ABS() absolute value of
SQRT() Square root of
SQR() Square of
SIN() Sine of
ASIN() ArcSine of
COS() Cosine of
ACOS() ArcCosine of
TAN() Tangent of
COT() Cotangent of
ATAN() Arctangent of
LN() Natural Logarithm of
LOG() Base 10 Log of
EXP() Exponential of
Note - 2 dimesional plots can be produced in the form
z=sin(x), z=3x+2 etc, if the rotations are all set to 0, the
YRange(low & high) are set to 0, and the Y segments are set
to 1. Use variable 'X' and plot 'Z' in terms of 'X'.
Menus:
File Menu
load
parms- this will load a set of parameters, functions, window sizes,
color map etc. When plot is first run 'Default.parms'
is loaded if available. If you have a favorite
function. then it can be loaded at startup by saving
its' parms as 'Default.parms'.
save
parms - this will save all parameters for easy retrieval. A file
requestor will prompt you for the file name. File name
extensions of '.parms' are recommended..
save IFF -
this will save the current visible screen or plot
window to an IFF format image. A file requestor will prompt
you for the file name and extensions of '.pic' are
recommended.
Quit - Quit Amiga Plot (bye)
Display Menu -
Color Map - User selects color palette
ColorSpan - User selects color position/span(what heigth you want
each color to kick in. Decimal fractions can be entered
for finer color resolution.
XHatch - Outlines complete polygon on screen
Radians/Degrees - This toggles the displayed DomainX and RangeY to
Degree units and back to radian units. A little
something extra.
Spec.Parms -
Clip TAN - This is an adjustment for the TAN function which usually
produces very high values(out of range). You can
adjust the tops of these spikes.
Scale/0 - This one can adjust any case of division by zero. In other
words, instead of dividing by zero(which is undefined)
you can divide by the scale value.
2D Plot - This automates the settings of the parms for 2d equation
plotting of the form 'z = 3x + 2'(linear) or
'z = 2x^2 + 3*x + 9'(quadratic) etc.
*************************** COMING SOON *****************************
Note: Soon a completely separate program called Amiga Plot 2D will be
released for plotting two dimensional functions. This new program will
include all the grids, scaled axes, auto grid markings etc., needed
for these plots. LOOK FOR APLOT2D !!!!
*********************************************************************
PenColors -
There is a file include called 'PenColors', that APlot loads on
startup. This is a text file that can be altered with an editor giving
the user flexibility to configure colors any way he/she wishes. This
can be very useful(I wish all programs included such a file) for
example if you want a different arrangement for example when printing
a screen dump. This is not the same as adjusting the pallett.
The file contains:
1 SDP /* Screen Detail Pen */
0 SBP /* Screen Back Pen */
1 WDP /* Window Detail Pen */
0 WBP /* Window Back Pen */
1 WINDTEXT /* Pen for all text placed in window (headings) */
7 WINDBACK /* Backgroud pen for Control and Perspective windwows */
4 PLOTBACK /* Backgroud pen for main plot window */
1 GADTEXT /* pen for any text within a gadget */
7 GADBACK /* pen for background color of gadget box */
2 GADHIGH /* pen for highlight color of gadget box */
1 INTUI_FP /* front pen for menu text */
0 INTUI_BP /* back pen for menu text */
5 AXISCOLOR /* pen for drawing axes */
1 PenMap /* pen arrangement for the shaded effect of function plot.
6 PenMap If you bring up the color requestor you will see the
5 PenMap colors in order of plot (z) depth. Use this color requestor
3 PenMap to choose these pen arrangements */
0 PenMap
7 PenMap
4 PenMap
2 PenMap
Make sure that the first character of each line contains the pen
number(0-7) and that there are no other numbers on the same line.
**** Have Fun ****