home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fred Fish Collection 1.5
/
ffcollection-1-5-1992-11.iso
/
ff_disks
/
300-399
/
ff345.lzh
/
Roses
/
Roses.doc
< prev
next >
Wrap
Text File
|
1990-04-16
|
8KB
|
203 lines
*************
* ROSES *
*************
by
Carmen Artino
&
The CDAUG Modula-2 SIG
This program is copyrighted by the CDAUG Modula-2 sig but may be
freely distributed. We hope that all who use it find it both enjoyable and
useful. If you do please send a small donation ($5 or $10) to:
The DAUG House BBS Fund
c/o The Captital District Amiga Users Group
P.O. Box 14353
Albany, NY 12212
Please feel free to give us a call. We are a totally Amiga BBS that
runs the Atredes BBS software with Skypix protocol. We operate 24 hours a
day at up to 2400 baud. We may be reached at
The DAUG House
(518) 370-5207
**************************************************************************
This program is an enhanced version of the AmigaBasic program of
the same name I wrote and that appeared in the April, 1989 issue of
JumpDisk Magazine for the Amiga. This version was written using Benchmark
Modula-2.
This program draws sine roses and is an implementation of algorithm
2 given in the article, "A Rose is a Rose ..." by Peter M. Maurer, see the
reference in the "About Roses" item in the Project menu. Sine roses are
graphs of the polar equation r = sin(n*d).
To use the program simply double click its icon or type
run >nil: Roses
from the CLI. Make sure that Garnet font is in your current Fonts:
directory before doing so. When the program starts, the "About Roses"
screen will appear. After you've read the message, click the OK gadget.
You can interact with the program in various ways using the three
menus. Here are their respective descriptions.
Project
About Roses - The openning screen message
Show Authors - Very Important. Tells who we are!
Quit - Exit the program; no choice is given to
continue.
Choices
Watch Evolution - This selection brings up a submenu allowing
you to either use n = 2 (the default) or to
change n to a different value via a
requester. With this selection you can
observe the Rose patterns for the various
values of d; leave n set to 2 to start, you
can change it later. This will give you a
feel for what the program is doing.
Selecting the second submenu item, "Change
n" will bring up a requester. Enter a value
for n (4 is nice) and enjoy the evolution
in this case.
Change n & d values - This choice brings up a requester with two
string gadgets. The first is for the value
of n and the second for the value of d.
Keep in mind the following facts when make
these changes. 1. d is measured in degrees,
not radians. 2. Choose even integer values
for n. Odd values will work but the curves
tend to trace over themselves in these
cases and produce a hesitation effect. In
some instances, this can be used to produce
interesting effects. Some suggested values
for d and n follow these notes with my own
comments; you'll probably come up with your
own.
Change Circle Subdivisions - This will bring up yet another requester.
Enter the value you want (see below for
some suggestions) then hit RETURN. You will
still have to make one of the other choices
to see the effects of your change. Changing
the circle subdivisions can in some cases
produce some interesting results. Changing
to 359 degrees (from the default 360) is
rather dramatic in many instances; see the
comments below.
Type
Variation 1 - This is the actual implementation of
Maurer's algorithm.
Variation 2 - This is a modification of the algorithm my
own design. Watch the evolution using both
variations.
The evolution takes place starting at d = 15 degrees and progresses
in steps of 15 degrees up to 180 degrees. These parameters are visible on
the screen in the upper right hand corner.
Each time a Rose is drawn, several gadgets will appear along the
right hand side of the screen. All are self-explanatory. Clicking on "Save
Rose" will bring up a requester for a file name to save the Rose under. You
should provide a full path name; otherwise, the rose will be save to the
current directory. The screen is saved in compressed IFF format (including
the parameters but without the gadgets) and the resulting picture may be
manipulated with a paint program or an image processing program, etc. Some
of the gadgets will be ghosted depending on what choice was made from the
"Choices" menu. The "Save Rose" gadget, however, is never ghosted.
For the nitty gritty mathematics of the whole show and for those
with moderately strong hearts, I suggest reading Maurer's article. Enjoy!
What follows are some possible selections for values of d and n
that I found interesting. Even though variation 2 is not explicitly
mentioned in all of them, try it anyway; you might enjoy those as well. In
any event, explore to heart's content!
d = 59°, n = 60
Rotating equilateral triangle; rotates from bottom upwards to left;
produces a circle
d = 44°, n = 44
Produces fat double leafed roses in succession.
d = 44°, n = 45
Produces roses using a centrally rotating "star of David"-like
pattern.
d = 72°, n = 6
Very interesting pattern produced by a rotating pentatgram starting
at the top and rotating clockwise. One of the patterns suggested by Maurer.
Both variations are interesting though variation 2 does not produce the
pentagram.
d = 91°, n = 92
Produces an 8 leafed rose using a rotating line segment. Starts at
the top and rotates clockwise. Variation 2 is also interesting - produces
the 8 leaves "simultaneaously" using the rotating line segment.
d = 35°, n = 36
More interesting to watch. Produces the final pattern by rotating
pentagrams of various sizes on their centers.
d = 78°, n = 121
Produces 3 "circles" by rotating a pattern three times in a
clockwise fashion. Both the manner and the final pattern are interesting.
d = 120°, n = 4
Produces an 8 leafed roses using a rotating triangle in a manner
similar to the rotating pentagram, d = 72, n = 6. Very interesting.
Variation 2 of the combination is also interesting.
d = 16°, n = 92
Produces a rose with 8 interleaved petals. Variation 2 of this
combination produces the same rose, of course, but with an entirely
different effect!
d = 28°, n = 206
Very interesting pattern that is difficult to describe. Both
variations are pleasant to watch and observe.
d = 16°, n = 94
Produces a beautiful 16 leafed rose; this final pattern is more
interesting than the manner in which it is produced but watch variation 2
anyway.
d = 180°
When n is an even number, the results obtained here are
dramatically different than when is odd. Try n = 6 then n = 7.
In the following examples, the circle subdivisions should be set to
359°. Make this change from the Choices menu.
d = 90°, n = 181
Compare resulting pattern with that obtained when the circle
subdivisions is set to 360°. Better yet, for the same value of d choose n
= 180 for z = 360° (get nothing) and for z = 359°.
d = 92°, n = 120
Again compare this with z = 360°. Also compare with variation 2.
d = 50°, n = 216
Three loops with three inner loops.
d = 32°, n = 45
The pattern for z = 359° is dramatically different than the one for
z = 360°. For z = 359°, variation 2 is very interesting.
d = 90°, n = 91
Compare again to the pattern obtained when z = 360°. Variation 2
will given a different perspective on this pattern.
Carmen Artino
P.O. Box 43
Guilderland, NY 12084