RANMAP
Iterated Weighted Affine Mappings
RANMAP
is a FORTRAN90 program which
carries out iterated weighted
affine mappings and creates EPS images of the results.
The program is interactive, allowing the user to choose
some predefined mappings, including
-
the cross;
-
the dragon;
-
the fern;
-
the leaf;
-
the Levy dragon;
-
the tree;
-
the triangle;
-
a random mapping;
-
a user-defined mapping;
Thanks to Marc Berger of Carnegie Mellon University for
introducing me to this topic!
Licensing:
The computer code and data files described and made available on this web page
are distributed under
the GNU LGPL license.
Languages:
RANMAP is available in
a FORTRAN90 version.
Related Data and Programs:
EPS,
a data directory which
contains examples of the Encapsulated PostScript format, used to store the
files created by this program.
FERN,
a MATLAB program which
uses MATLAB graphics to display the Barnsley fractal fern.
FERN_OPENGL,
a C++ program which
uses OpenGL to display the Barnsley fractal fern.
Reference:
-
Scott Bailey, Theodore Kim, Robert Strichartz,
Inside the Levy Dragon,
American Mathematical Monthly,
Volume 109, Number 8, October 2002, pages 689-703.
-
Michael Barnsley, Alan Sloan,
A Better Way to Compress Images,
Byte Magazine,
Volume 13, Number 1, January 1988, pages 215-224.
-
Michael Barnsley,
Fractals Everywhere,
Academic Press, 1988,
ISBN: 0120790696,
LC: QA614.86.B37.
-
Michael Barnsley, Lyman Hurd,
Fractal Image Compression,
Peters, 1993,
ISBN: 1568810008,
LC: TA1632.B353
-
Alexander Dewdney,
Mathematical Recreations,
Scientific American,
Volume 262, Number 5, May 1990, pages 126-129.
-
Bernt Wahl, Peter VanRoy, Michael Larsen, Eric Kampman,
Exploring Fractals on the Mac,
Addison Wesley, 1995,
ISBN: 0201626306,
LC: QA614.86.W34.
Source Code:
Examples and Tests:
A run of the cross data was made for 2000 points.
Files you may copy include:
-
cross.txt,
the output from the program;
-
cross.txt,
the sequence of points generated by random mappings;
-
cross.png,
a PNG image of
the points;
A run of the dragon data was made for 2000 points.
Files you may copy include:
A run of the fern data was made for 2000 points.
Files you may copy include:
-
fern.txt,
the output from the program;
-
fern.txt,
the sequence of points generated by random mappings;
-
fern.png,
a PNG image of
the points;
A run of the leaf data was made for 2000 points.
Files you may copy include:
-
leaf.txt,
the output from the program;
-
leaf.txt,
the sequence of points generated by random mappings;
-
leaf.png,
a PNG image of
the points;
A run of the Levy dragon data was made for 2000 points.
Files you may copy include:
A run of the tree data was made for 2000 points.
Files you may copy include:
-
tree.txt,
the output from the program;
-
tree.txt,
the sequence of points generated by random mappings;
-
tree.png,
a PNG image of
the points;
A run of the triangle data was made for 2000 points.
Files you may copy include:
List of Routines:
-
MAIN is the main program for RANMAP.
-
CH_CAP capitalizes a single character.
-
CROSS_MAP sets the cross map matrix.
-
DOT_PLOT plots the individual points.
-
DRAGON_MAP sets the dragon map matrix.
-
EPS_FILE_HEAD writes header information to an encapsulated PostScript file.
-
EPS_FILE_TAIL writes trailer information to an encapsulated PostScript file.
-
FERN_MAP sets the fern map matrix.
-
GET_UNIT returns a free FORTRAN unit number.
-
I4_SWAP swaps two I4's.
-
I4_UNIFORM returns a scaled pseudorandom I4.
-
LEAF_MAP sets the leaf map matrix.
-
LEVY_DRAGON_MAP sets the Levy dragon map matrix.
-
POINT_INSIDE_BOX_2D determines if a point is inside a box in 2D.
-
PS_COLOR_LINE handles the line color.
-
PS_COLOR_LINE_SET sets the line color.
-
PS_COMMENT inserts a comment into the PostScript file.
-
PS_DEFAULT sets the internal settings to their default values
-
PS_FILE_OPEN opens a new version of a PostScript file with a given name.
-
PS_FILE_CLOSE closes a PostScript file.
-
PS_LINE_CLOSED adds the graph of a closed line to a PostScript file.
-
PS_MARK_POINT marks a point with a tiny point.
-
PS_PAGE_HEAD writes header information on a new page.
-
PS_PAGE_TAIL writes tail information at the end of a page.
-
PS_SETTING_INT sets, gets, or prints integer internal PS_WRITE parameters.
-
PS_SETTING_REAL sets, gets, or prints real internal PS_WRITE parameters.
-
R8_SWAP swaps two R8's.
-
R8_TO_BIN_UNEVEN places X in one of several unevenly spaced bins.
-
R8_UNIFORM_01 returns a unit pseudorandom R8.
-
R8VEC_ASCENDS determines if an R8VEC is (weakly) ascending.
-
RANDOM_MAP randomly applies one of several affine maps to a point.
-
S_EQI is a case insensitive comparison of two strings for equality.
-
TIMESTAMP prints the current YMDHMS date as a time stamp.
-
TREE_MAP sets the tree map matrix.
-
TRIANGLE_MAP sets the triangle map matrix.
You can go up one level to
the graphics source codes.
Last revised on 20 September 2005.