home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Share Gallery 1
/
share_gal_1.zip
/
share_gal_1
/
GA
/
GA028.ZIP
/
READ.ME
< prev
next >
Wrap
Text File
|
1986-08-27
|
7KB
|
149 lines
HOPALONG
Version 1.1
August 27, 1986
(****************************************************)
(* COPYRIGHT (C) 1986 by Kevin McCarty. *)
(* All commercial use prohibited. *)
(* Permission is granted for copying, distribution, *)
(* adaptation, and incorporation into other works, *)
(* but for personal or educational use only, *)
(* and this notice is to be preserved. *)
(****************************************************)
Files Included:
READ.ME This is it
HOPALONG.COM Program file
HOPALNG7.COM Same program, compiled with 8087
support, for the impatient.
HOPALONG.PAS Turbo Pascal source plotting driver
PLOT.INC Graphics machinery
HOP.PAS The function to be iterated
The program displays succesive iterates of a mapping
function from the plane to the plane. The particular function is
described in the Computer Recreations column in the September
1986 issue of Scientific American (titled "Wallpaper for the
Mind"), where it is attributed to Barry Martin at Aston
University in Birmingham, England. Specifically--
X <- Y - sign(X) * sqrt(abs(B * X - C))
Y <- A - X
The initial setup prompts should be pretty self-
explanatory. The program allows you to specify values for the
coefficients A, B, and C; the program defaults to one of the
sets of values suggested in the Sci. Amer. article, namely
A = -3.14
B = 0.3
C = 0.3
The starting values of X and Y are 0. You also specify
the plotting window in terms of X and Y coordinates, allowing you
to zoom in on fine details. All points are calculated, but only
those falling within the plot window are displayed (obviously).
Because of the way user input prompts are handled, you
can change the plot window without disturbing the values of the
coefficients A, B, & C, by just hitting carriage return when
prompted for them.
After you have specified all the inputs, the program
switches to a suitable graphics mode and starts plotting. It
will continue to plot forever, if left alone. If you're watching
in color, the colors will change every several thousand
iterations. When in graphics mode, you can cycle back to change
coefficients or plotting window, by striking any key not defined
in the setup display.
You can exit the program from graphics mode, after
becoming sufficiently bored with the drab scenes, by hitting the
Esc key. (The only polite way to exit the program is from
graphics mode; the Esc key doesn't do anything in the setup
display.) If you become dizzy, Control Break will also bail you
out, provided your are seated at the time.
As an aid in helping to set the plotting window, you can
get a grid to plot on top the figure in the graphics display, by
hitting the letter 'G' (or 'g'). If you were paying attention to
all those numbers back in the setup screen, you will have noticed
that some of them told what the X and Y spacing of the grid dots
was going to be. Those of you who rushed headlong past this
information in your mad rush to see the neat stuff will have to
to return to the setup screen.
----------------------------------------------------------------
CHANGES IN VERSION 1.1
- Cleaned up and reorganized the code some. A separate
include file now contains all details pertaining to the
specific function under study. Substantially revised
and expanded the graphics driver in PLOT.INC.
- The Color Graphics Adapter (CGA) is supported now,
(but there has only been limited testing). You get to choose
which graphics mode you want, allowing you to trade off
resolution for many dazzling colors. The graphics mode
to be used will be displayed, as well as the text mode.
If these don't look right to you, you now can bail out
while you still have your cursor. Sorry, no PCJr support
yet, but it shouldn't be that hard to adapt the source for that.
- The plot coordinates have been rotated by 45 degrees to
make the symmetry axis of the patterns vertical. Much nicer.
- During color plotting, if you touch the space bar, the
palette values are cycled through all possible values
supported by the graphics mode in effect. This gives rise
to the "waterfall effect", which some people claim can
generate a quite startling three-dimensional animation effect.
It's at least good for dazzling the socks off someone you're
trying to impress. Just tape down the space bar, or lean a
brick against the keyboard-- don't forget to wear your
airtight goggles.
----------------------------------------------------------------
I've included the source code for several reasons:
1) Not because I'm particularly proud of it, but if you
had to wait for it to be perfect before I released it, I'd have
all the fun and you wouldn't have any, for a long time. For
example, the code in PLOT.INC works, but could benefit from a
rewrite (it's in the midst of being expanded and generalized).
2) Very few people (not even me) will be satisfied with
the way I've handled the sequencing of colors (they should change
in a different sequence, more or less often, etc., etc.) This
way, if you don't like it, it's your fault.
3) Martin's function is only a few lines. All the rest
of the code is there to make it easy to look at it. This nifty
tool should not be confined to only Martin's function, although
it's worth many days study. This same machinery can be used to
study
-Mandelbrot sets
-Julia sets
-arbitrary 2-dimensional maps, for example the "Henon
attractor", a so-called "strange attractor", which is
associated with the equations
X <= 1 + B*Y - A*X*X (A = 1.4)
Y <= X (B = 0.3)
I'll expand on these references in a later version.
4) If you make improvements and corrections, you'll be
more inclined to send them on to me,
Kevin McCarty
7544 Fallenleaf Lane
Cupertino, CA 95014