Difference between revisions of "Reference:Fractal Pattern"
Jholsenback (talk | contribs) m (1 revision: Initial Load (TF)) |
Jholsenback (talk | contribs) m (more image tags fixes) |
||
(3 intermediate revisions by the same user not shown) | |||
Line 35: | Line 35: | ||
<li> The higher the exponent, the slower it will be. This is because the amount of operations needed to raise a complex number to an integer exponent is directly proportional to the exponent. This means that exponent 10 will be (very) roughly twice as slow as exponent 5.</li> | <li> The higher the exponent, the slower it will be. This is because the amount of operations needed to raise a complex number to an integer exponent is directly proportional to the exponent. This means that exponent 10 will be (very) roughly twice as slow as exponent 5.</li> | ||
</ol> | </ol> | ||
+ | <table class="centered" width="700px" cellpadding="0" cellspacing="10"> | ||
+ | <tr> | ||
+ | <td> | ||
+ | [[Image:RefImgMandelExponents.png|center|680px<!--centered--->]] | ||
+ | </td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td> | ||
+ | <p class="caption">Mandelbrot and Julia fractal patterns of exponents 2 to 5</p> | ||
+ | </td> | ||
+ | </tr> | ||
+ | </table> | ||
<p>The syntax is:</p> | <p>The syntax is:</p> | ||
<pre> | <pre> | ||
Line 72: | Line 84: | ||
of the pattern when using interior and exterior coloring (this is often needed to get the | of the pattern when using interior and exterior coloring (this is often needed to get the | ||
desired effect). The default value of FACTOR is 1.</p> | desired effect). The default value of FACTOR is 1.</p> | ||
+ | |||
+ | <table class="centered" width="700px" cellpadding="0" cellspacing="10"> | ||
+ | <tr> | ||
+ | <td> | ||
+ | [[Image:RefImgMagnet.png|center|320px<!--centered--->]] | ||
+ | </td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td> | ||
+ | <p class="caption">Magnet mandel and julia type 1 and 2 fractal patterns</p> | ||
+ | </td> | ||
+ | </tr> | ||
+ | </table> | ||
<p>The different values of <code>EXTERIOR_TYPE</code> and <code>INTERIOR_TYPE</code> have the following | <p>The different values of <code>EXTERIOR_TYPE</code> and <code>INTERIOR_TYPE</code> have the following | ||
Line 107: | Line 132: | ||
} | } | ||
</pre> | </pre> | ||
+ | <table class="centered" width="700px" cellpadding="0" cellspacing="10"> | ||
+ | <tr> | ||
+ | <td> | ||
+ | [[Image:RefImgJuliaColorings.png|center|680px<!--centered--->]] | ||
+ | </td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td> | ||
+ | <p class="caption">Different exterior and interior coloring types of fractal patterns</p> | ||
+ | </td> | ||
+ | </tr> | ||
+ | </table> |
Latest revision as of 19:18, 10 February 2013
Fractal patterns supported in POV-Ray:
- The Mandelbrot set with exponents up to 33. The formula for these is:
z(n+1) = z(n)^p + c
, wherep
is the correspondent exponent. - The equivalent Julia sets.
- The magnet1 and magnet2 fractals (which are derived from some magnetic renormalization transformations; see the fractint help for more details). Both 'Mandelbrot' and 'Julia' versions of them are supported.
For the Mandelbrot and Julia sets, higher exponents will be slower for two reasons:
- For the exponents 2,3 and 4 an optimized algorithm is used. Higher exponents use a generic algorithm for raising a complex number to an integer exponent, and this is a bit slower than an optimized version for a certain exponent.
- The higher the exponent, the slower it will be. This is because the amount of operations needed to raise a complex number to an integer exponent is directly proportional to the exponent. This means that exponent 10 will be (very) roughly twice as slow as exponent 5.
The syntax is:
MANDELBROT: mandel ITERATIONS [, BUMP_SIZE] [exponent EXPONENT] [exterior EXTERIOR_TYPE, FACTOR] [interior INTERIOR_TYPE, FACTOR] JULIA: julia COMPLEX, ITERATIONS [, BUMP_SIZE] [exponent EXPONENT] [exterior EXTERIOR_TYPE, FACTOR] [interior INTERIOR_TYPE, FACTOR] MAGNET MANDEL: magnet MAGNET_TYPE mandel ITERATIONS [, BUMP_SIZE] [exterior EXTERIOR_TYPE, FACTOR] [interior INTERIOR_TYPE, FACTOR] MAGNET JULIA: magnet MAGNET_TYPE julia COMPLEX, ITERATIONS [, BUMP_SIZE] [exterior EXTERIOR_TYPE, FACTOR] [interior INTERIOR_TYPE, FACTOR]
Where:
ITERATIONS
is the number of times to iterate (up to 2^32-1) the algorithm.
COMPLEX
is a 2D vector denoting a complex number.
MAGNET_TYPE
is either 1 or 2.
exponent
is an integer between 2 and 33. If not given, the default is 2.
interior
and exterior
specify special coloring algorithms. You can specify one of them or both at the same time. They only work with the fractal patterns.
EXTERIOR_TYPE
and INTERIOR_TYPE
are integer
values between 0 and 6 (inclusive). When not specified, the default value of INTERIOR_TYPE
is 0 and for EXTERIOR_TYPE 1.
FACTOR
is a float. The return value of the pattern is multiplied by
FACTOR
before returning it. This can be used to scale the value range
of the pattern when using interior and exterior coloring (this is often needed to get the
desired effect). The default value of FACTOR is 1.
The different values of EXTERIOR_TYPE
and INTERIOR_TYPE
have the following
meaning:
- 0: Returns just 1
- 1: For exterior: The number of iterations until bailout divided by ITERATIONS.
Note: This is not scaled by FACTOR (since it is internally scaled by 1/ITERATIONS instead).
For interior: The absolute value of the smallest point in the orbit of the calculated point - 2: Real part of the last point in the orbit
- 3: Imaginary part of the last point in the orbit
- 4: Squared real part of the last point in the orbit
- 5: Squared imaginary part of the last point in the orbit
- 6: Absolute value of the last point in the orbit
- 7: For exterior only: the number of iterations modulo FACTOR and divided by FACTOR.
Note: This is of course not scaled by FACTOR. The covered range is 0 to FACTOR-1/FACTOR.
- 8: For exterior only: the number of iterations modulo FACTOR+1 and divided by FACTOR.
Note: This is of course not scaled by FACTOR. The covered range is 0 to 1.
Example:
box {<-2, -2, 0>, <2, 2, 0.1> pigment { julia <0.353, 0.288>, 30 interior 1, 1 color_map { [0 rgb 0] [0.2 rgb x] [0.4 rgb x+y] [1 rgb 1] [1 rgb 0] } } }