home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 1: Amiga
/
FrozenFish-Apr94.iso
/
bbs
/
alib
/
d8xx
/
d867
/
complexplot.lha
/
ComplexPlot
/
English
/
ComplexPlotter.doc
< prev
next >
Wrap
Text File
|
1993-04-10
|
26KB
|
722 lines
Documentation of ComplexPlotter
This is a translation of the documentation of the german version
of ComplexPlotter. The original text contains a lot of mathematical
expressions, and I often could only guess how they are translated.
So please excuse the mistakes.
1. Introduction
This program is a "complex function plotter", with which sets of
complex numbers can be pictured by a function.
Because you now probably think "oh no, that´s too complex for me",
I want to describe this: Complex Numbers can be compared with
two-dimensional points (x- and y-coordinate are called real and
imaginary part), and so sets of complex numbers can be interpreted
as drawings or pictures. On complex numbers you can use functions
in the same way as on the commonly used real (or rational) numbers.
Most of the functions which are used for real numbers are defined
for complex numbers, too (for example the sinus- or the exponential
function). As the real functions distribute all numbers (of the
definition set) to other numbers, the complex functions put
two-dimensional points to other points. From the original
picture is created a new picture. And this is the core of the
matter: this function plotter is a flexible tool for picture
metamorphosis.
For example you can distort pictures, bend them, "mirror the
inner parts out", enlarge them at different points etc. The
results are often interesting, or even amusing.
To input the original drawing (also called definition area) the
program has an editor, in which you for example can paint
freehandedly with your mouse. Then there are two figure generators
(cartesic and polar nets), which are useful for more systematic
studies about what a specific function does. Drawings can be saved
to disk. Also you can copy the drawing which was already changed
by a complex function back to the editor to change it again (if
you repeat this there can be some kind of film effect, and you
can for example watch the convergency of the function).
So this program is suitable for experiments and play-around, but
for distinct mathematic tasks as well (e.g. study of convergency,
fix points, singularities, periodicy etc).
Just to make it even more useful it is possible to emulate other
types of function plotters, for example the "normal" plotter, which
produces the well-known pictures of parabolas, sinus-waves etc.
More in chapter "Emulation of other plotter-types" (4.2).
The used mathematical background of course is no general knowledge.
Who is interested in knowing more can try to read books of higher
mathematics or function theory. But as well you can let that be and
just experiment with this program (for comparison: the pictures
of fractal geometry are widely known and liked, but how many
people really understand, how they are created).
2. How the program is used
The program can be started from CLI with
Plotter/English/ComplexPlotter
or from the workbench (the program was written under version
1.3 but should run under 2.0 or higher as well). It needs the
"MathTrans.library" (it is to be found in the directory libs of
your system disk). Then there should be at least 1MB RAM (I
think it could run with 512KB if there is nothing else in memory,
but I don´t guarantee).
If the program doesn´t start either there isn´t the MathTrans.
library or there isn´t enough RAM left.
The program has three screen-sized windows, between which can
be freely switched. In the first window "Main parameters" you
can type the function to plot and the borders of the two other
windows, where the original drawing is defined ("definition
area"/"definition window") and the picture, which was changed
by the function, is shown ("result area"/"result window").
Every window has its own menu bar, which are activated by the
richt mouse button, as usual. Some features can be accessed from
all three windows, while most can be used from only one window.
Most features can also be accessed by key-commands which are
shown at the appropriate menu items (right amiga-key plus
letter key).
A typical function plot goes this way: first you type in the
wanted function term and define the borders of the definition
area. Then you switch to that window and choose a drawing
(either by using the mouse, using the generators or loading from
disk). Then you order the Amiga to "plot" the drawing and can then
look at the result. You can choose to let determine the borders
of the result window every time a plot is done by switching to
"Automatic" in the main parameters window.
After that you can zoom different parts of the result picture
to watch details. You can copy the result picture back into
the editor of the definition area in order to use that picture
for a next plot. If you use the right function it is possible
to create a film-like picture series.
In the next sections of this documentation follows a complete
list of the program´s features.
2.1 Main parameters window
Here you can define the complex function with which shall
be worked. To do that you click on the marked input field
and type in the function. Used as the variable is "z". More
about the term syntax below.
Secondly you can set the borders of the two other windows.
Be sure that the right border has a greater value than the
left one, and the top border has a greater value than the
bottom border, otherwise you get an error message when
switching to that window.
For the result window you can choose if the borders shall be
determined by the computer or the given values shall be used.
Normally you´ll select "Automatic". This means, that every
time the result window is selected its borders are calculated
automatically. The numbers which are displayed in the main
parameters window are changed accordingly. If you don´t like
that, choose "Manual".
The menu bar offers the following:
1) Commands:
a) Plot (Amiga-P)
This starts the calculation of the result picture out of
the definition drawing. After this the result window is
activated to show the result.
b) Quit program
With this command you quit the program (after a safety
check).
2) Windows:
a) Definition area (Amiga-D)
To switch to the definition window where you define the
original drawing.
b) Result area (Amiga-R)
To switch to the result window where you can watch the
calculated picture (when already plot).
c) Automatic (Amiga-A)
Same as the button "Automatic" (see above).
d) Manual (Amiga-M)
Same as the button "Manual" (see above).
2.2 Syntax of the floating point numbers and the functions
Numbers can be typed in normal and exponential writing. They
can range between +/- 1e-19 and +/- 9e18.
Imaginary parts are marked by an appended "i". Or you can put
"*i" behind or "i*" before the number, but with the first
method the numbers are read directly as imaginary parts, whereas
in the second and third method the program reads the number as
a real part and multiplies it with i, which of course takes
much more time.
Here some examples:
0.52578 equals .52578 or +.52578
-598.1245
1.42e6 equals 1.42*10^6
7.34e-8 equals 7.34*10^-8
6.345i equals 6.345*i or i*6.345
12+8i
3-.5i
There is a wide range of mathematical functions:
...+... Addition
...-... Subtraction
...*... Multiplication
.../... Division
...^... Potency
re(...) Real part of a complex number
im(...) Imaginary part of a complex number
abs(...) Absolute value ("length") of a complex number
arg(...) Argument ("angle") of a complex number
con(...) Conjugated complex number
sqrt(...) Square root
exp(...) Exponential function
log(...) Logarithm
sin(...) Sinus function
cos(...) Cosinus function
tan(...) Tangens function
sinh(...) Sinus Hyperbolicus
cosh(...) Cosinus Hyperbolicus
tanh(...) Tangens Hyperbolicus
arcsin(...) Arcus Sinus (inversion of sinus)
arccos(...) Arcus Cosinus (inversion of cosinus)
arctan(...) Arcus Tangens (inversion of tangens)
arsinh(...) Area Sinus (inversion of sinus hyp.)
arcosh(...) Area Cosinus (inversion of cosinus Hyp.)
artanh(...) Area Tangens (inversion of tanges Hyp.)
int(...) Rounded values of real and imaginary part
sgn(...) Signums of real and imaginary part
swap(...) Swaps real and imaginary part
More about these functions in the third chapter.
You can use the following symbols:
z The variable. It stands for the points of the
definition area.
x Real part of the variable (equals re(z)).
y Imaginary part of the variable (equals im(z)).
pi The famous constant 3.1415927...
Besides that you can use up to ten bracket levels. Spaces are
skipped, and you can use capital letters as you like. Finally
some examples (they demonstrate the syntax, but are not really
for trying out):
2*sin(z/(cos(z)+exp(z)))+6i
(i*z+exp(z))*(z^2)
(-z)^(x+y)
abs(z)*exp(i*(arg(z)+pi/4))
2.3 Definition window
In this window the points, which are to be pictured by the
complex function, are defined. For that an editor is implemented,
and some basic figures can be used. All features of the editor
are activated by the menu bar (or the equaling key-commands).
On the top window bar the position of the mouse pointer is always
shown in floating point format. If you, for example, move the
mouse pointer to the right bottom edge, the right and bottom
border values, which you have set in the main parameters window,
are shown.
Also the active drawing mode is shown, that´s normally "Freehand".
In this mode you can draw freely within the window area. Other
modes are "Lines", "Circles", "Fill" and "Zoom". In line mode
you can draw lines: start and end point will be put into the
definition area memory. In circle mode 36 points of the circle
edge, and in fill mode of course the fill point will be memoried.
When you have drawn some points, you can use the menu item "Zoom
complete" to adjust the window borders, so that the drawing
completely fits into the window (as is done in "automatic" mode).
With "Zoom out" the window borders are pushed outward, so that
the window area becomes larger, and the drawing looks smaller.
Often it is good to watch the drawing from some distance to see
it better.
Last not least you can use "Zoom a part" to enlarge a part of
the drawing by marking this part with the mouse.
If you´ve done something wrong you can take back the last made
part of the drawing by using "Undo". This is especially helpfull
when using the fill mode, because a wrong set fill point can easily
fill the whole window.
With "Load" and "Save" you can load a drawing from disk or save
the just created drawing. For that purpose a filerequester appears
which should be easy enough to use.
"Fishing net" and "Spiders web" are two figure generators which
are especially useful when systematically studying the effects
of a complex function. The fishing net (cartesic net) is an
array of horizontal and vertical lines, of which the cross points
are put into memory. In an extra parameter window you have to
determine the position and size of the net. You also have to
declare the number of horizontal and vertical sections (0-999).
With a number of sections of 1 a bar, and with a number of sections
of 0 a simple line appears. It´s easy to learn, just try around
a bit.
The spiders web looks as it is named. You define the center point
of the net, the radius, the number of rays (3 to 99) and the number
of circles (1 to 99). Here, too, is the best way of understanding
the use of the parameters experimenting.
Here the commands of the menu bar:
1) Commands:
a) Plot (Amiga-P)
With this menu item the computation of the result picture
is started. After that the result window is activated.
b) Copy Res->Def (Amiga-K)
With this the content of the result area is copied into
the definition area. The old definition drawing will be
overwritten.
c) Clear ALL (Amiga-L)
With this item the complete contents of the definition area
will be erased (irrevocably) !
d) Quit program
To exit ComplexPlotter.
2) Windows:
a) Parameters (Amiga-E)
This is to switch back to the main parameters window,
e.g. to change the function.
b) Result area (Amiga-R)
To switch to the result window.
c) Zoom complete (Amiga-A)
With this command the borders of the window will be put
tightly around the drawing, so that it fits completely into
the window. For example that´s useful to take back zooms
done by the next to menu commands.
d) Zoom a part (Amiga-M)
If you want to work on a specific part of the drawing, you
can choose this menu command and then mark this area. The
window borders will then be set around the marked area.
e) Zoom out (Amiga-Z)
To get a better view of the whole drawing you can enlarge
the definition area by moving the borders some way outward.
A zoom complete with following zoom out often produces
the best view of the complete drawing.
3) Drawmode:
a) Freehand (Amiga-1)
This is the mode with which you can draw freely with the
mouse. With the left mouse button the points or lines
are set.
b) Lines (Amiga-2)
With this mode you can connect two points with a straight
line. For that purpose you move the mouse pointer to the
first point, press the left button, and move to the second
point while still pressing the button. Then you release the
button.
c) Circles (Amiga-3)
If you want to draw circles, you can use this drawmode. You
choose the center point and then move to a point on the circle
line while pressing the left mouse button. You should keep
in mind that these are circles in the definition area, and
can look like ellipses on the screen, just as the borders of
the window are defined.
d) Fill (Amiga-4)
To fill bordered parts of the drawing you can use this mode.
You should be carefull that the desired parts are really
completely bordered, otherwise the whole window is filled.
e) Undo (Amiga-U)
With this menu item the lastly drawn figure is undone
(freehand line, line, circle, fill, fishing net or spiders
web).
4. Figures:
a) Fishing net (Amiga-5)
With this item you activate the figure generator for cartesic
nets. An extra parameter window appears, where you can define
your desired net. The net will be generated if you click on
the "Start"-button or finish the last parameter with the
enter key. With the "Abort"-button the generation is canceled.
b) Spiders web (Amiga-6)
The generation of a spiders web (polar net) works in the same
way as the generation of a fishing net.
c) Load (Amiga-7)
Of course you can save completed drawings. With this command
you can load drawings from disk. An existing drawing will
be overwritten. The filerequester has features to walk
through directories, selection of the drive, scroll buttons,
direct input of path name and file name, and supports
double clicking of the file name.
d) Save (Amiga-8)
This item is for saving the drawings of the definition area.
It is used as the load item.
You should know that the drawing memory is limited to 3000 points,
but that should be sufficient for most purposes.
2.4 Result window
In this window the plotting result is being displayed. When
the automatic mode is selected the borders of this window will
be adjusted to the size of the picture. The border values are
displayed on the top window bar.
There exist the same window commands as in the definition window,
with the exception that the "Zoom a part"-feature is active all
the time. This means that you can zoom to selected parts of the
picture without calling a menu command, just by marking a rectangle
with your mouse.
With the Copy&Plot-feature you can copy the picture back into
the definition area and compute a new plot picture (the commands
Copy Res->Def and Plot are executed in succession). When repeating
this feature several times the picture can become "animated".
Sometimes this can look interesting, and it helps finding fix points
of the funtion (Fix points are points which aren´t changed by the
function. Often some areas of the picture move closer and closer
to such fix points - that´s called convergency).
So the items of the menu bar are quickly explained:
1. Commands:
a) Plot (Amiga-P)
As in the other two windows, the calculation of the picture
will be started.
b) Copy Res->Def (Amiga-K)
The picture of the result area is copied into the definition
area (the old drawing will be overwritten). Then the definition
window is activated.
c) Copy&Plot (Amiga-R)
This feature does the commands Copy Res->Def and Plot in
succession (without switching the windows).
d) Quit program
This command is reserved for all who are sick of this program.
2. Windows:
a) Parameters (Amiga-E)
With this item you get back to the main parameters windows
where you can edit the function term and the window borders.
b) Definition area (Amiga-D)
To get back to the definition editor you should select this.
c) Zoom complete (Amiga-A)
With this you can adjust the window borders to the picture
borders. This command is called automatically if the automatic
mode is selected in the main parameters window.
d) Zoom out (Amiga-Z)
With this menu item the window borders are pushed outwards
so that the picture will become smaller. This is good to
take back zoomings into parts of the picture.
3. Descriptions of some complex functions
Of course you want to know what the complex functions do to your
drawings. I only can describe some basic mechanisms, because the
whole theory actually fills books. So with some complicated
functions you should "learn by trying".
3.1 Translations (moving the drawing to another place)
Moving the drawing around is simple: the addition of two complex
numbers is like the addition of vectors, so you have to add a
constant complex number which represents the translation. For
example to move the drawing 2 measures to the right and 1 measure
up you can use the function:
f(z) = z + 2+i
3.2 Making the drawing smaller/bigger
A scalar multiplication with real numbers accomplishes this.
For example the function
f(z) = 2*x + .5i*y
doubles the breadth and halves the height.
3.3 Simple mirrorings/rotations
To mirror the drawing at the real axis you can use the function
f(z) = con(z)
which produces the complex conjugated numbers (the imaginary
part is being negated).
If you negate the complex numbers the drawing will be mirrored
at the origin:
f(z) = -z
If you want to mirror the drawing at the 45 degree line you can do
this by swapping real and imaginary part:
f(z) = swap(z)
To rotate the figure 90 degree counterclockwise you can multiply
the points with i:
f(z) = i*z
3.4 Other rotations
Rotations with all kinds of angles kann be accomplished in different
ways. The first is to multiply the numbers with a constant complex
number. When multiplicating two complex numbers the angles (to the
real axis) will be added and the lengths (the distance of the point
to the origin = the absolute value) multiplied. For example to
rotate the drawing 45 degree counterclockwise you have to multiply
the points with that complex number which has the angle of 45
degree and the length of 1, and that is sqrt(.5)+sqrt(.5)*i:
f(z) = (sqrt(.5)+sqrt(.5)*i)*z
Another possibility is to use the polar coordinate writing of
the complex numbers and directly add the rotation angle:
f(z) = abs(z)*exp(i*(arg(z)+pi/4))
This function rotates with pi/4, which equals 45 degree counter-
clockwise.
And you can use the matrices of the special orthogonal group
which are related to the linear algebra. Here the function for
the 45 degree rotation:
f(z) = x*cos(pi/4)+y*sin(pi/4)+i*(y*cos(pi/4)-x*sin(pi/4))
Of course all three methods are mathematically equivalent.
3.5 The parabola z^2
To demonstrate the complex parabola use can use the following
fishing net:
Borders: Left: -3 Right: 3 Top: 2 Bottom: 1
Sections: Horizontal: 25 Vertical:1
This strip will be bend around the origin.
3.6 The hyperbola 1/z
To show some aspects of this function you can first use a
spiders web with the center in the origin. This drawing will
be pictured to a web-like thing where the circles are getting
more crowded at the mid. This is so, because the function isn´t
defined for z=0 and has a polar singularity there.
3.7 The trigonometric functions (sin, cos, etc.)
The trigonometric functions have several effects. Usually they
have the likeness to catapult points which have some distance
to the origin even farther away. So you should use drawings
near the origin, not farther away than ca. 4 measures.
If you for example use the sinus function the drawing will
be bend and enlarged in several directions.
The trigonometric and hyperbolic functions are related very
closely to the exponential function.
3.8 The exponential function und the logarithm
The exponential function rotates according to the imaginary
part of the number and enlarges exponentially according to
the real part of the number. This results in bending in direction
of the real axis and rotating in direction of the imaginary axis.
The logarithm puts everything into a horizontal strip with the
height of 2*pi, because im(log(z))=arg(z), and arg(z) being the
angle of the complex number can only have values between -pi and
pi.
4. Examples and ideas
4.1 Drawings already on disk
In the directoy "Plotter/DefPics" you find some example drawings
which can be loaded into the definition editor.
The drawings "Quadrants", "QuadrantsII" and "Bar" should demonstrate
that the generators for fishing net and spiders web can even be
used to produce some more complex drawings. They are suited for
directly studying complex functions.
The drawings "Tree", "Lemming" and "Binky" show that it is possible
to draw some nice pictures with the mouse. Especially the drawing
"Putzi" can demonstrate funny effects of most basic functions.
I advice to test this drawing with exp(z), log(z), sqrt(z), sin(z),
cos(z), tan(z/2), sinh(z), tanh(z), arsinh(z) u.a.
Now, isn´t that funny ?
4.2 Emulation of other plotter-types
Because the real numbers are just a part of the complex numbers,
it is possible to emulate some other types of function plotters.
This enhances the usefulness of this program even more.
4.2.1 "Classic" function plotter (Real --> Real)
If you want to display a real function g(x) in the interval
[a;b] with the usual method, you can do this in the following
way:
First you go to the definition editor and define this fishing
net:
Borders: Left: a Right: b Top: 0 Bottom: -1
Sections: Horizontal: 640 Vertical: 0
A horizontal line appears. Now you go to the main parameter
window and type in the function:
f(z) = x+i*g(x)
Of course you have to replace g(x), a and b with appropriate
terms (e.g. sin(x), -2*pi and 2*pi). And now you can plot the
function by selecting "Plot" from the commands menu.
If you use a smaller number of horizontal sections the computation
time will be shorter. The result is often good enough if you don´t
make this number smaller than 100.
4.2.2 "3D-" function plotter (Real x Real --> Real)
This kind of plotters produces those nice net graphics, in which
the x- and y- coordinates are to be interpreted as function
arguments, and the z-coordinate is to be interpreted as the
function value. This can be emulated, too.
For that purpose you must have a net in the definition area. A
simple fishernet will do most times. Spiders webs with their
center in the origin are good when using functions with rotation
symmetry. Or you can use every other drawing.
Then you define the following function:
f(z) = x+y/2+i*(y/2+g(x,y))
For g(x,y) you have to write the actual 3D-function, e.g.
sin(x+y)
1/(.5+x^2+y^2)
exp(x+y)
The only disadvantage is that the "hidden" lines will also be drawn.
4.2.3 Function plotter Real --> Real x Real
Relatively seldom are plotters which produce out of one real
variable a two-dimensional coordinate. Most prominent examples
are the so-called Lissajouz pictures which appear when the
function has periodicy.
If you want to display such functions with the ComplexPlotter
you can use the following path:
As in 4.2.1 you define a horizontal line. Then you input the
function:
f(z) = gx(x)+i*gy(x)
For example produces
f(z) = sin(x)+i*cos(1.2*x)
a closed Lissajouz picture (when the line of the definition
area lies in the right interval). Of couse you can also use
non-periodical functions.
I hope you have fun with my program or can use it for some
other nice purpose. Enjoy it !
Michael Gentner