Date: Sun, 27 Sep 1998 22:14:04 -0700 (MST)

From: Kerry Mitchell <lkmitch@primenet.com>

Subject: (fractint) Fractal dimension coloring

 

On the fractal programmer's list, Stephen Ferguson posted a link to his

tutorial on fractal dimension coloring of fractals. Here's a set of

Fractint formulas and pars to implement his ideas.

 

- -------------------------------------------------------------------------------

Kerry Mitchell

lkmitch@primenet.com www.primenet.com/~lkmitch/

- -------------------------------------------------------------------------------

 

comment {

 

Fractal Dimension coloring

 

Stephen Ferguson posted an analysis of fractal dimension, which he

based on an algorithm by Holger Jaenisch. The formulas here take

Stephen's analysis and implement it in Fractint.

 

Since the fractal dimension can be computed for either the real or

the imaginary parts of z (actually, for any bounded set of real

numbers), a plotting flag in the formula tells which component to

use. Set the flag to 1 to plot the fractal dimension of the real

component, 2 for the imaginary component, or 3 for the magnitude.

Any other value uses the 2 component dimensions as the real and

imaginary parts of a new complex variable, and plots by the polar

angle of that variable.

 

The "fdim" formulas implement Stephen's analysis as written. This

includes a "2-1/(0.5+n/d)" scaling, where n and d both involve log

functions. This may be mathematically accurate, but obscures the

detail by reducing the dynamic range of the variables (the variables

change to little to be seen with the standard Fractint coloring

schemes). Consequently, the "fdim2" formulas remove the scaling, and

color essentially by n/d. Also, the absolute value restriction was

removed from the compilation of the mean and standard deviation. Both

statistics handle negatives well, and this allows the method to

properly handle non-symmetric orbits. Preliminary tests indicate that

the fundamental nature of the images is unchanged, although the "fdim2"

formulas are simpler and should run faster.

 

As fractal dimension calculations involve bounded sets, this method

is best suited for "inside" colorings. Therefore, if the orbit

escapes, it is assigned the value of 1.0, which corresponds to color

0 when using the "decomp" coloring. Decomp=256 is recommended for

this method.

 

}

 

fdim-man-x { ; copyright Kerry Mitchell 26sep98

;

; sample of fractal dimension coloring

; uses real component of z, Mandelbrot set

;

reset=1960 type=formula formulafile=fractint.frm cyclerange=0/255

formulaname=fdim2_man center-mag=-0.7/0/1.1 params=4.7/1

float=y maxiter=100 inside=0 decomp=256 periodicity=0

colors=000<61>y00z00z00z10<61>zz0zz0yy1<61>00z00z11z<61>zzz

}

 

fdim-man-y { ; copyright Kerry Mitchell 26sep98

;

; sample of fractal dimension coloring

; uses imaginary component of z, Mandelbrot set

;

reset=1960 type=formula formulafile=fractint.frm cyclerange=0/255

formulaname=fdim2_man center-mag=-0.7/0/1.1 params=6.8/2

float=y maxiter=100 inside=0 decomp=256 periodicity=0

colors=000<61>y00z00z00z10<61>zz0zz0yy1<61>00z00z11z<61>zzz

}

 

fdim-man-r { ; copyright Kerry Mitchell 26sep98

;

; sample of fractal dimension coloring

; uses magnitude of z, Mandelbrot set

;

reset=1960 type=formula formulafile=fractint.frm cyclerange=0/255

formulaname=fdim2_man center-mag=-0.7/0/1.1 params=9.2/3

float=y maxiter=100 inside=0 decomp=256 periodicity=0

colors=000<61>y00z00z00z10<61>zz0zz0yy1<61>00z00z11z<61>zzz

}

 

fdim-man-both { ; copyright Kerry Mitchell 26sep98

;

; sample of fractal dimension coloring

; uses both components of z, Mandelbrot set

;

reset=1960 type=formula formulafile=fractint.frm cyclerange=0/255

formulaname=fdim2_man function=ident center-mag=-0.7/0/1.1

params=4.2/0 float=y maxiter=100 inside=0 decomp=256 periodicity=0

colors=000<62>yn0zo0zo0zo1<61>zzzzzzyyz<60>QQzPPzPPzPPy<60>111

}

 

fdim-jul-x { ; copyright Kerry Mitchell 26sep98

;

; sample of fractal dimension coloring

; uses real component of z, Julia set

;

reset=1960 type=formula formulafile=fractint.frm

formulaname=fdim2_jul center-mag=0/0/1.2/1/-92.5

params=0.3590310488975619/0.1009347986428277/6.7/1 float=y

maxiter=100 inside=0 decomp=256 periodicity=0 colors=000<61>y\

00z00z00z10<61>zz0zz0yy1<61>00z00z11z<61>zzz cyclerange=0/255

}

 

fdim-jul-y { ; copyright Kerry Mitchell 26sep98

;

; sample of fractal dimension coloring

; uses imaginary component of z, Julia set

;

reset=1960 type=formula formulafile=fractint.frm

formulaname=fdim2_jul center-mag=0/0/0.9/1/-12

params=-0.125/0.649519052838/5.2/2 float=y

maxiter=100 inside=0 decomp=256 periodicity=0 colors=000<61>\

y00z00z00z10<61>zz0zz0yy1<61>00z00z11z<61>zzz cyclerange=0/255

}

 

fdim-jul-r { ; copyright Kerry Mitchell 26sep98

;

; sample of fractal dimension coloring

; uses magnitude of z, Julia set

;

reset=1960 type=formula formulafile=fdim.frm cyclerange=0/255

formulaname=fdim2_jul center-mag=0/0/0.95 params=-0.39054087022/-0\

.586787907347/8/3 float=y maxiter=100 inside=0 decomp=256 periodic\

ity=0 colors=000<61>y00z00z00z10<61>zz0zz0yy1<61>00z00z11z<61>zzz

}

 

fdim-jul-both { ; copyright Kerry Mitchell 26sep98

;

; sample of fractal dimension coloring

; uses both components of z, Julia set

;

reset=1960 type=formula formulafile=fractint.frm cyclerange=0/255

formulaname=fdim2_jul center-mag=0/0/0.98 params=0/0/16/0 float=y

maxiter=100 inside=0 decomp=256 periodicity=0

colors=000<61>y99zAAzAAzBB<61>zzzzzzzyz<60>i1ih0hh0hg0g<61>000

}

 

frm:fdim2_man { ; Kerry Mitchell 26sep98

;

; real(p1) = coloring speed

; imag(p1) = plot flag

; 1: plot x fdim

; 2: plot y fdim

; 3: plot r fdim

; other: x = x fdim, y = y fdim, plot angle

;

zc=0, c=pixel, iter=1, done=0

speed=real(p1), plotflag=imag(p1)

xmin=1e12, xmax=-1e12, ymin=1e12, ymax=-1e12

ssx=0, sx=0, ssy=0, sy=0

rmin=1e12, rmax=-1e12, ssr=0, sr=0

:

iter=iter+1, zc=sqr(zc)+c

x=real(zc), y=imag(zc), r=cabs(zc)

ssx=ssx+sqr(x), sx=sx+x

ssy=ssy+sqr(y), sy=sy+y

ssr=ssr+sqr(r), sr=sr+r

if(x<xmin)

xmin=x

endif

if(x>xmax)

xmax=x

endif

if(y<ymin)

ymin=y

endif

if(y>ymax)

ymax=y

endif

if(r<rmin)

rmin=r

endif

if(r>rmax)

rmax=r

endif

if(|zc|>4)

done=1

z=1

endif

if(iter==maxit)

done=1

s=sqrt(ssx-sx*sx/iter)

fdimx=(xmax-xmin)/s

s=sqrt(ssy-sy*sy/iter)

fdimy=(ymax-ymin)/s

s=sqrt(ssr-sr*sr/iter)

fdimr=(rmax-rmin)/s

if(plotflag==1)

t=speed*fdimx

z=cos(t)+flip(sin(t))

elseif(plotflag==2)

t=speed*fdimy

z=cos(t)+flip(sin(t))

elseif(plotflag==3)

t=speed*fdimr

z=cos(t)+flip(sin(t))

else

z=fdimx+flip(fdimy)

z=z^speed

endif

endif

done==0

}

 

frm:fdim2_jul { ; Kerry Mitchell 26sep98

;

; p1 = c = Julia parameter

; real(p2) = coloring speed

; imag(p2) = plot flag

; 1: plot x fdim

; 2: plot y fdim

; 3: plot r fdim

; other: x = x fdim, y = y fdim, plot angle

;

c=p1, zc=pixel, iter=1, done=0

speed=real(p2), plotflag=imag(p2)

xmin=1e12, xmax=-1e12, ymin=1e12, ymax=-1e12

ssx=0, sx=0, ssy=0, sy=0

rmin=1e12, rmax=-1e12, ssr=0, sr=0

:

iter=iter+1, zc=sqr(zc)+c

x=real(zc), y=imag(zc), r=cabs(zc)

ssx=ssx+sqr(x), sx=sx+x

ssy=ssy+sqr(y), sy=sy+y

ssr=ssr+sqr(r), sr=sr+r

if(x<xmin)

xmin=x

endif

if(x>xmax)

xmax=x

endif

if(y<ymin)

ymin=y

endif

if(y>ymax)

ymax=y

endif

if(r<rmin)

rmin=r

endif

if(r>rmax)

rmax=r

endif

if(|zc|>4)

done=1

z=1

endif

if(iter==maxit)

done=1

s=sqrt(ssx-sx*sx/iter)

fdimx=(xmax-xmin)/s

s=sqrt(ssy-sy*sy/iter)

fdimy=(ymax-ymin)/s

s=sqrt(ssr-sr*sr/iter)

fdimr=(rmax-rmin)/s

if(plotflag==1)

t=speed*fdimx

z=cos(t)+flip(sin(t))

elseif(plotflag==2)

t=speed*fdimy

z=cos(t)+flip(sin(t))

elseif(plotflag==3)

t=speed*fdimr

z=cos(t)+flip(sin(t))

else

z=fdimx+flip(fdimy)

z=z^speed

endif

endif

done==0

}

 

frm:fdim_man { ; Kerry Mitchell 26sep98

;

; real(p1) = coloring speed

; imag(p1) = plot flag

; 1: plot x fdim

; 2: plot y fdim

; other: x = x fdim, y = y fdim, plot angle

;

zc=0, c=pixel, iter=1, done=0

speed=real(p1), plotflag=imag(p1)

xmin=1e12, xmax=0, ymin=1e12, ymax=0

ssx=0, sx=0, ssy=0, sy=0

:

iter=iter+1, zc=sqr(zc)+c

x=cabs(real(zc)), y=cabs(imag(zc))

ssx=ssx+sqr(x), sx=sx+x

ssy=ssy+sqr(y), sy=sy+y

if(x<xmin)

xmin=x

endif

if(x>xmax)

xmax=x

endif

if(y<ymin)

ymin=y

endif

if(y>ymax)

ymax=y

endif

if(|zc|>4)

done=1

z=1

endif

if(iter==maxit)

done=1

denom=log(iter)

s=ssx-sx*sx/iter

numer=-log((xmax-xmin)/(sqrt(s)*iter))

fdimx=2-1/(0.5+numer/denom)

s=ssy-sy*sy/iter

numer=-log((ymax-ymin)/(sqrt(s)*iter))

fdimy=2-1/(0.5+numer/denom)

if(plotflag==1)

t=speed*fdimx

z=cos(t)+flip(sin(t))

elseif(plotflag==2)

t=speed*fdimy

z=cos(t)+flip(sin(t))

else

z=fdimx+flip(fdimy)

z=z^speed

endif

endif

done==0

}

 

frm:fdim_jul { ; Kerry Mitchell 26sep98

;

; p1 = c = Julia parameter

; real(p2) = coloring speed

; imag(p2) = plot flag

; 1: plot x fdim

; 2: plot y fdim

; other: x = x fdim, y = y fdim, plot angle

;

c=p1, zc=pixel, iter=1, done=0

speed=real(p2), plotflag=imag(p2)

xmin=1e12, xmax=0, ymin=1e12, ymax=0

ssx=0, sx=0, ssy=0, sy=0

:

iter=iter+1, zc=sqr(zc)+c

x=cabs(real(zc)), y=cabs(imag(zc))

ssx=ssx+sqr(x), sx=sx+x

ssy=ssy+sqr(y), sy=sy+y

if(x<xmin)

xmin=x

endif

if(x>xmax)

xmax=x

endif

if(y<ymin)

ymin=y

endif

if(y>ymax)

ymax=y

endif

if(|zc|>4)

done=1

z=1

endif

if(iter==maxit)

done=1

denom=log(iter)

s=ssx-sx*sx/iter

numer=-log((xmax-xmin)/(sqrt(s)*iter))

fdimx=2-1/(0.5+numer/denom)

s=ssy-sy*sy/iter

numer=-log((ymax-ymin)/(sqrt(s)*iter))

fdimy=2-1/(0.5+numer/denom)

if(plotflag==1)

t=speed*fdimx

z=cos(t)+flip(sin(t))

elseif(plotflag==2)

t=speed*fdimy

z=cos(t)+flip(sin(t))

else

z=fdimx+flip(fdimy)

z=z^speed

endif

endif

done==0

}

 

 

 

- --------------------------------------------------------------

Thanks for using Fractint, The Fractals and Fractint Discussion List

Post Message: fractint@lists.xmission.com

Get Commands: majordomo@lists.xmission.com "help"

Administrator: twegner@phoenix.net

Unsubscribe: majordomo@lists.xmission.com "unsubscribe fractint"

 

------------------------------

 

Date: Sun, 27 Sep 1998 22:14:55 -0700 (MST)

From: Kerry Mitchell <lkmitch@primenet.com>

Subject: (fractint) Fractal dimension coloring

 

Here's Stephen's original post.

 

- -------------------------------------------------------------------------------

Kerry Mitchell

lkmitch@primenet.com www.primenet.com/~lkmitch/

- -------------------------------------------------------------------------------

 

- ---------- Forwarded message ----------

Date: Fri, 27 Sep 2002 12:35:37 +0000

From: "Stephen C. Ferguson" <stephenf@HiWAAY.net>

Reply-To: fracprogrammers-list@terindell.com

To: fracprogrammers-list@terindell.com

Subject: Re: new app source

Resent-Date: Sun, 27 Sep 1998 13:36:45 -0400 (EDT)

Resent-From: fracprogrammers-list@terindell.com

 

If anyone is interested, I've finally written a couple of tutorials. One on a

24-bit sine/ cosine fractal coloring technique and another on a fractal

dimension approximation method.

 

http://home.HiWAAY.net/~stephenf/Tutorials/Coloring/Coloring.html

http://home.HiWAAY.net/~stephenf/Tutorials/FDimension/dimension.html

 

Comments?

 

Steve.

- --

http://home.HiWAAY.net/~stephenf/