Here is a link to a web page with an image: http://www.fracton.org/fmlposts/web_loops.html I used the Epicycloid_Mset formula to make this image. A spiderweb like fractal with epicycloid loops. There is also a zoom animation Quicktime movie: Quicktime Movie 10.0 MB, 30 sec, 640 x 480 http://web.me.com/gigagraphica/fimage/web_loops_640.mov The parameter file used to make this image is below: Web_Loops { ; Exported from Fracton. reset=2004 type=formula formulafile=fracton.frm formulaname=Epicycloid_Mset passes=1 float=y center-mag=0.4707827378458914/0.3478907363901677/3\ 809523857142.857/1/186/0 params=0.14/0.86/7/30/8/0.25/0/0/0/0 maxiter=1000 inside=255 outside=summ colors=000fOz<28>I0Kz0f<28>O08z88<28>O00zW0<28>c40\ zz0<28>aG00zR<28>0C40zz<28>0CCGGz<28>00O000<12>000\ z88 } frm:Epicycloid_Mset { ; Epicycloid_Mset based on Astroid_Mset ; Astroid_Mset copyright (c) Paul W. Carlson, 1997 ; Epicycloid_Mset by Mike Frazier, 2011 ;**************************************************** ; 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) = number of cusps, even integers ; imag(p3) = cusp amplitude (0 to 1) ; ; 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), f=real(p3)+1, b=imag(p3), ;**************************************************** ; 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. ;**************************************************** ang=atan(imag(w)/real(w)), astroid=r*(cos(ang)-b*cos(f*ang)+i*(sin(ang)-b*sin(f*ang))), ;**************************************************** ; 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=abs(|w|-|astroid|), 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 } -- Mike Frazier www.fracton.org
Mike, Excellent images (has anyone called you "the new Paul W. Carlson" already?) Regarding the Epicycloid_Mset formula: Replacing the line "ang=atan(imag(w)/real(w)" with "ang=imag(log(w))" will remove the restriction of having to use only even numbers of cusps, since the complex log() utilises atan2() internally. And my 2 cents on the inverted looking Astroid curve "issue": Curve formulas in parametrised form generally are not identical with those of the same curve in polar form. The parameter is a kind of yardstick along the curve and might be mistaken for the polar angle because of all the trigonometric function that pop up in parameter formulas, but most of the time it is not - and often it will no even be possible to transfer a parametric to a polar expression in closed form. Of course I'm aware noone (including me) will complain if something looks good but is not quite correct, just wanted to point it out (SIWOTI syndrome maybe?) For this not to be completely useless - there *does* exist a polar formula for the Astroid. Replacing the lines ang=atan(imag(w)/real(w)) astroid=r*(cos(ang)^3+i*sin(ang)^3) with ang=imag(w)/real(w) ;ang is really tan(ang) here astroid = r * sqrt((ang^2 + 1)/(|ang|^(1/3) + 1)^3) will produce "uninverted" Astroids. Gerald
Thanks so much for your insight and your fixes. Regarding the Epicycloid_Mset formula:
Replacing the line "ang=atan(imag(w)/real(w)" with "ang=imag(log(w))" will remove the restriction of having to use only even numbers of cusps, since the complex log() utilises atan2() internally.
I have been burned before with using atan instead of atan2. atan only works over 180 degrees where atan2 works over the full 360. Your trick for getting atan2 by using the imaginary part of the complex log function is great because that is available within FractInt and Fracton. I think I see your logic into the inverted astroids. I had noticed that Paul Carlson used the angle to drive the parametric form of the curve. The parameter like you said is a measure of how far you are down a path that describes the curve. Using it this way is only exactly the same for a circle. Rewriting the curve equation to be a function of the angle instead of a function of how far you are along the curve should get rid of the distortion. I think I can see though that there are some limitations by using the angle. Parametric curves can have loops and the same curve written in angle form would have to have more than one solution at the angle of a loop. That probably explains why curves with loops didn't show any evidence of having a loop. I will credit you for "additional improvements" in the next version of the formula. Thanks so much for solving the problem. -- Mike Frazier www.fracton.org
participants (2)
-
Gerald K. Dobiasovsky -
Mike Frazier