POLARPLOT
~~~~~~~~~
For the Hewlett-Packard 28S Advanced Scientific Calculator.
This program and its component routines are intended to approximate
polar graphs of simple polar functions.
It is neither fast nor capable of graphing functions involving radicals,
but it can give you a reasonable, and often invaluable sketch of most
polar functions. PPLOT can be fooled, but has shown many a math student
a careless error or two. I hope you find it useful.
USAGE:
The user will create a program called 'PEQ' which shall manipulate
the independent variable theta into 'r', using standard RPN.
For example, to graph the function: r = 1 + COS (5 * theta)
one would create 'PEQ' as:
<< 5 * COS 1 + >>
'PPLOT' also requires the step size (in degrees) to be on the stack.
Depending on the amount of free memory, the step size must be greater
than about 1.5 degrees. Very unusual step increments usually create the
clearest graphs. (i.e. 3.57234353 rather than 2.0)
The program consists of:
PPLOT, the rather simple main program
PDRAW, which actually sketches the data
PURGVARS, to clean up after itself
and GENARRAY, which does the bulk of the work.
Here they are:
PEQ
~~~
<< you make this one yourself, as described above, but must be present. >>
PPLOT
~~~~~
<< CL(sigma) CLLCD "Calculating" 58 CHR + 1 DISP
GENARRAY 440 .1 BEEP
PDRAW 1500 .1 BEEP
DGTIZ PURGEVARS
>>
PDRAW
~~~~~
<< CLLCD SCL(sigma) 4.2 *W DRW(sigma) >>
PURGEVARS
~~~~~~~~~
<< DROP
'PPAR' PURGE
'(sigma)PAR' PURGE
'(sigma)DAT' PURGE
'T' PURGE
>>
GENARRAY
~~~~~~~~
<< MINR ->NUM 360 FOR A
A DUP 2 DISP DUP
PEQ
SWAP R->C P->R C->R 2 ->ARRY (sigma)+ DUP
STEP
>>
Note: '->' represents the right arrow symbol, and (sigma) is, of course,
the sigma symbol.
Pretty simple stuff, eh? I wrote it to give me a hint of what the polar
graph should look like for some functions, and a few other people have
found it useful in some math courses. I usually start with a step size
of about 5 degrees, and try again with a smaller one if the graph isn't
clear enough.
Feel free to pass it around, modify it, use pieces or ideas from it, etc.
No, you can't sell it. (I don't see who would buy it.)
If you make any significant improvements to it, I would appreciate a
copy of your code.
Many thanks to Hewlett-Packard for making many lives a lot easier!
Steve Haehnichen
shaehnichen@ucsd.edu
(and ucsd.BITNET, etc...)
October 8, 1989
-Strip mining prevents forest fires.