folium_800_ps.jpg

Folium Of Descartes Example

The formula for this fractal is called Folium_Curve and is based on the formula Astroid_Mset by Paul Carlson. It generates a Folium Of Descartes curve which looks like a line with a loop in it. This curve was picked to demonstrate that it is possible to generate curves with loops using the cartesian form as suggested by Gerald Dobiasovsky. The image looks best drawn large and anti-aliased.

The parameter file used to make this image is below:

Folium { ; Exported from Fracton.
 reset=2004 type=formula formulafile=fracton.frm
 formulaname=Folium_Curve passes=1 float=y
 center-mag=-0.5721775288599359/0.6474535253927753/\
 17.777778/1/-5/0
 params=1e-05/1/5/30/0.375/0/0/0/0/0 maxiter=500
 inside=255 outside=summ
 colors=000fOz<22>N5TM4RL3Q<3>I0Kz0f<22>W0FV0ET0D<3\
 >O08z88<22>W22V11T11<3>O00zW0<22>hA0g90f80<3>c40zz\
 0<22>fQ0eO0dM0<3>aG00zR<22>0N90L80J7<3>0C40zz<22>0\
 NN0LL0JJ<3>0CCGGz<22>33W33V22T<3>00O000<7>000<4>00\
 0z88 }
frm:Folium_Curve {
 ; Folium of Descartes example by Mike Frazier based on
 ; Astroid_Mset copyright (c) Paul W. Carlson, 1997
 ; Additional improvements by Gerald Dobiasovsky
 ;****************************************************
 ; Always use floating point math and outside=summ.
 ;
 ; Parameters:
 ;   real(p1) = a factor controlling the width of the curves
 ;   imag(p1) = radius of the curve
 ;   real(p2) = number of color ranges
 ;   imag(p2) = number of colors in each color range
 ;   real(p3) = folium constant
 ;
 ; Note that the equation variable is w, not z. 
 ; Initialize cindex to the index of the background color
 ; Formula modified to avoid color index 0 which can not
 ; be used with outside=summ in FractInt v20.04
 ;****************************************************
 w=0,
 c=pixel,
 z=0,
 cindex=254,; Background color
 bailout=0,
 iter=0,
 range_num=0,
 i=(0,1),
 r=imag(p1),
 ;****************************************************
 ; In the accompanying par file,
 ; we have 8 color ranges with 30 colors in each range
 ; for a total of 240 colors. The first range starts at
 ; color 1.  Pixels will use color 254 when |w| > 1000.
 ; Other values can be used here as long as the product
 ; of num_ranges times colors_in_range is less than 255.
 ; Color 254 is reserved for the background color and 
 ; color 255 can be used for the inside color.
 ;****************************************************
 num_ranges=real(p2),
 colors_in_range=imag(p2),
 ;****************************************************
 ; Real(p1) controls the width of the curves.
 ; These values will usually be in the range 0.001 to 0.1
 ;****************************************************
 width=real(p1),
 index_factor=(colors_in_range-1)/width:
 ;****************************************************
 ; The equation being iterated.  Almost any equation
 ; that can be expressed in terms of a complex variable
 ; and a complex constant will work with this method.
 ; This example uses the standard Mandelbrot set equation.
 ;****************************************************
 w=w*w+c,
 ;****************************************************
 ; The orbit trap curve is an epicycloid.
 ; Any two-dimensional curve can
 ; be used which can be expressed in parametric form in
 ; terms of the angle from the origin.
 ;****************************************************
 xx=r*real(w),yy=r*imag(w),
 a=real(p3),
 ;****************************************************
 ; If the orbit point is within some distance of the curve,
 ; set cindex to the index into the colormap and set the bailout
 ; flag.  Note: the way we use the "distance" here has
 ; the effect of turning the curves inside-out in the image.
 ;****************************************************
 distance=|xx^3+yy^3-3*a*xx*yy|,
 if(distance<width&&iter>1),
 cindex=index_factor*distance+range_num*colors_in_range+1,
 bailout=1,
 endif,
 ;****************************************************
 ; Cycle through the range numbers (0 thru num_ranges - 1)
 ; With two color ranges, even iterations use color
 ; range 0, odd iterations use color range 1.
 ;****************************************************
 range_num=range_num+1,
 if(range_num==num_ranges),
 range_num=0,
 endif,
 ;****************************************************
 ; Since we are using outside=summ, we have to subtract
 ; the number of iterations from z.
 ;****************************************************
 iter=iter+1,
 z=cindex-iter,
 ;****************************************************
 ; Finally, we test for bailout
 ;****************************************************
 bailout==0&&|w|<1000
 }

 

Return to the Fracton main page