1 @c -----------------------------------------------------------------------------
2 @c File : fractals.de.texi
3 @c License : GNU General Public License (GPL)
5 @c Original : fractals.texi revision 27.03.2011
7 @c Revision : 19.04.2011
9 @c This file is part of Maxima -- GPL CAS based on DOE-MACSYMA
10 @c -----------------------------------------------------------------------------
13 * Introduction to fractals::
14 * Definitions for IFS fractals::
15 * Definitions for complex fractals::
16 * Definitions for Koch snowflakes::
17 * Definitions for Peano maps::
20 @c -----------------------------------------------------------------------------
21 @node Introduction to fractals, Definitions for IFS fractals, fractals, fractals
22 @section Introduction to fractals
23 @c -----------------------------------------------------------------------------
25 This package defines some well known fractals:
29 with random IFS (Iterated Function System): the Sierpinsky triangle, a Tree and
32 Complex Fractals: the Mandelbrot and Julia Sets
34 the Koch snowflake sets
36 Peano maps: the Sierpinski and Hilbert maps
39 Author: Jos@'e Ram@'{@dotless{i}}rez Labrador.
41 For questions, suggestions and bugs, please feel free to contact me at
42 pepe DOT ramirez AAATTT uca DOT es
44 @c -----------------------------------------------------------------------------
45 @node Definitions for IFS fractals, Definitions for complex fractals, Introduction to fractals, fractals
46 @section Definitions for IFS fractals
47 @c -----------------------------------------------------------------------------
49 Some fractals can be generated by iterative applications
50 of contractive affine transformations in a random way; see
51 Hoggar S. G., "Mathematics for computer graphics", Cambridge University
54 We define a list with several contractive affine transformations,
55 and we randomly select the transformation in a recursive way.
56 The probability of the choice of a transformation must be related
57 with the contraction ratio.
59 You can change the transformations and find another fractal
61 @c -----------------------------------------------------------------------------
62 @deffn {Function} sierpinskiale (@var{n})
64 Sierpinski Triangle: 3 contractive maps; .5 contraction constant and
65 translations; all maps have the same contraction ratio. Argument @var{n} must
66 be great enougth, 10000 or greater.
71 (%i1) load("fractals")$
73 (%i3) plot2d([discrete,sierpinskiale(n)], [style,dots])$
77 @c -----------------------------------------------------------------------------
78 @deffn {Function} treefale (@var{n})
80 3 contractive maps all with the same contraction ratio.
81 Argument @var{n} must be great enougth, 10000 or greater.
86 (%i1) load("fractals")$
88 (%i3) plot2d([discrete,treefale(n)], [style,dots])$
92 @c -----------------------------------------------------------------------------
93 @deffn {Function} fernfale (@var{n})
95 4 contractive maps, the probability to choice a transformation must be related
96 with the contraction ratio. Argument @var{n} must be great enougth, 10000 or
102 (%i1) load("fractals")$
104 (%i3) plot2d([discrete,fernfale(n)], [style,dots])$
108 @c -----------------------------------------------------------------------------
109 @node Definitions for complex fractals, Definitions for Koch snowflakes, Definitions for IFS fractals, Top
110 @section Definitions for complex fractals
111 @c -----------------------------------------------------------------------------
113 @c -----------------------------------------------------------------------------
114 @deffn {Function} mandelbrot_set (@var{x}, @var{y})
120 This program is time consuming because it must make a lot of operations;
121 the computing time is also related with the number of grid points.
124 (%i1) load("fractals")$
125 (%i2) plot3d (mandelbrot_set, [x, -2.5, 1], [y, -1.5, 1.5],
126 [gnuplot_preamble, "set view map"],
127 [gnuplot_pm3d, true],
132 @c -----------------------------------------------------------------------------
133 @deffn {Function} julia_set (@var{x}, @var{y})
137 This program is time consuming because it must make a lot of operations;
138 the computing time is also related with the number of grid points.
143 (%i1) load("fractals")$
144 (%i2) plot3d (julia_set, [x, -2, 1], [y, -1.5, 1.5],
145 [gnuplot_preamble, "set view map"],
146 [gnuplot_pm3d, true],
150 See also @code{julia_parameter}.
153 @c -----------------------------------------------------------------------------
154 @defvr {Option variable} julia_parameter
155 Default value: @code{%i}
157 Complex parameter for Julia fractals.
158 Its default value is @code{%i}; we suggest the values @code{-.745+%i*.113002},
159 @code{-.39054-%i*.58679}, @code{-.15652+%i*1.03225}, @code{-.194+%i*.6557} and
160 @code{.011031-%i*.67037}.
163 @c -----------------------------------------------------------------------------
164 @deffn {Function} julia_sin (@var{x}, @var{y})
166 While function @code{julia_set} implements the transformation
167 @code{julia_parameter+z^2}, function @code{julia_sin} implements
168 @code{julia_parameter*sin(z)}. See source code for more details.
170 This program runs slowly because it calculates a lot of sines.
174 This program is time consuming because it must make a lot of operations;
175 the computing time is also related with the number of grid points.
178 (%i1) load("fractals")$
179 (%i2) julia_parameter:1+.1*%i$
180 (%i3) plot3d (julia_sin, [x, -2, 2], [y, -3, 3],
181 [gnuplot_preamble, "set view map"],
182 [gnuplot_pm3d, true],
186 See also @code{julia_parameter}.
189 @c -----------------------------------------------------------------------------
190 @node Definitions for Koch snowflakes, Definitions for Peano maps, Definitions for complex fractals, Top
191 @section Definitions for Koch snowflakes
192 @c -----------------------------------------------------------------------------
194 @c -----------------------------------------------------------------------------
195 @deffn {Function} snowmap (@var{ent}, @var{nn})
197 Koch snowflake sets. Function @code{snowmap} plots the snow Koch map
198 over the vertex of an initial closed polygonal, in the complex plane. Here
199 the orientation of the polygon is important. Argument @var{nn} is the number of
200 recursive applications of Koch transformation; @var{nn} must be small (5 or 6).
205 (%i1) load("fractals")$
206 (%i2) plot2d([discrete,
207 snowmap([1,exp(%i*%pi*2/3),exp(-%i*%pi*2/3),1],4)])$
208 (%i3) plot2d([discrete,
209 snowmap([1,exp(-%i*%pi*2/3),exp(%i*%pi*2/3),1],4)])$
210 (%i4) plot2d([discrete, snowmap([0,1,1+%i,%i,0],4)])$
211 (%i5) plot2d([discrete, snowmap([0,%i,1+%i,1,0],4)])$
215 @c -----------------------------------------------------------------------------
216 @node Definitions for Peano maps, , Definitions for Koch snowflakes, fractals
217 @section Definitions for Peano maps
218 @c -----------------------------------------------------------------------------
220 Continuous curves that cover an area. Warning:
221 the number of points exponentially grows with @var{n}.
223 @c -----------------------------------------------------------------------------
224 @deffn {Function} hilbertmap (@var{nn})
228 Argument @var{nn} must be small (5, for example). Maxima can crash if @var{nn}
234 (%i1) load("fractals")$
235 (%i2) plot2d([discrete,hilbertmap(6)])$
239 @c -----------------------------------------------------------------------------
240 @deffn {Function} sierpinskimap (@var{nn})
244 Argument @var{nn} must be small (5, for example). Maxima can crash if @var{nn}
250 (%i1) load("fractals")$
251 (%i2) plot2d([discrete,sierpinskimap(6)])$
255 @c --- End of file fractals.de.texi --------------------------------------------