Fractal 104 A – Turner’s Mirroring of Lights
Part of ELEMENTS series – 12 2022
blue . light . mirror . particles . reflection . sun . water . weather
Fractal 104 A – zoom level 1
Fractal 104 A – zoom level 2
Data
This digital works is created exclusively from fractals, with 0% AI generated. It can therefore be converted into a set of functions and parameters that can be the basis for the training of an AI.
The mathematical formulas and parameter combinations corresponding to each fractal are presented below. In each case, the numerical characters have been replaced by â– to prevent unauthorized reproduction. If you are interested in using the full data set to train an AI, please contact Philippe.
Fractal 104 A - Turner's Mirroring of Lights - Part of ELEMENTS series - 12.2022

Fractal_â– â– â– _A {
fractal:
title="Fractal_â– â– â– _A" width=â– â– â– â– height=â– â– â– â– layers=â–
credits="Philoxerax;â– â– /â– â– /â– â– â– â– "
layer:
caption="Layer â– " opacity=â– â– â– mergemode=lighten
mapping:
center=-â– â– .â– â– â– â– â– â– â– â– â– /-â– .â– â– â– â– â– â– â– â– â– magn=â– .â– â– â– â– â– â– â– â– angle=-â– â– .â– â– â–
formula:
maxiter=â– â– â– filename="lkmâ– .ufm" entry="fourier-popcorn"
p_control_type=basic p_bailout=â– â– â– â– p_hall=â– .â– /â–
p_functypeall="sin general" p_powerall=â– /â– p_ntermall=â– â–
p_slopeall=â– /â– f_funcall=tan p_hx=â– .â– /â– p_vartypexin=y
p_functypexin="cos odd pos" p_powerxin=â– /â– p_ntermxin=â– â–
f_funcxin=cos p_vartypexout=y p_functypexout="cos odd pos"
p_powerxout=â– /â– p_ntermxout=â– â– p_slopexout=â– /â– f_funcxout=cos
p_hy=â– .â– /â– p_vartypeyin=x p_functypeyin="sin odd pos" p_poweryin=â– /â–
p_ntermyin=â– â– f_funcyin=sin p_vartypeyout=x
p_functypeyout="sin odd pos" p_poweryout=â– /â– p_ntermyout=â– â–
p_slopeyout=â– /â– f_funcyout=sin
inside:
transfer=none solid=â– â– â– â– â– â– â– â– â– â–
outside:
transfer=linear
gradient:
smooth=yes rotation=â– â– â– index=â– color=â– â– â– â– â– â– â– â– index=â–
color=â– â– â– â– â– â– â– â– index=â– â– color=â– â– â– â– â– â– â– index=â– â– color=â– â– â– â– â– â– â– â–
index=â– â– color=â– â– â– â– â– â– â– index=â– â– color=â– â– â– â– â– â– â– â– index=â– â–
color=â– â– â– â– â– â– â– â– index=â– â– color=â– â– â– â– â– â– â– â– index=â– â– color=â– â– â– â– â– â– â– â–
index=â– â– color=â– â– â– â– â– â– â– index=â– â– color=â– â– â– â– â– â– â– index=â– â–
color=â– â– â– â– â– â– â– â– index=â– â– color=â– â– â– â– â– â– â– â– index=â– â– color=â– â– â– â– â– â– â– â–
index=â– â– color=â– â– â– â– â– â– â– â– index=â– â– color=â– â– â– â– â– â– â– â– index=â– â–
color=â– â– â– â– â– â– â– â– index=â– â– color=â– â– â– â– â– â– â– index=â– â– color=â– â– â– â– â– â– â–
index=â– â– color=â– â– â– â– â– â– â– index=â– â– color=â– â– â– â– â– â– â– â– index=â– â–
color=â– â– â– â– â– â– â– â– index=â– â– color=â– â– â– â– â– â– â– â– index=â– â– color=â– â– â– â– â– â– â– â–
index=â– â– color=â– â– â– â– â– â– â– â– index=â– â– color=â– â– â– â– â– â– â– â– index=â– â–
color=â– â– â– â– â– â– â– index=â– â– â– color=â– â– â– â– â– â– â– â– index=â– â– â– color=â– â– â– â– â– â– â–
index=â– â– â– color=â– â– â– â– â– â– â– index=â– â– â– color=â– â– â– â– â– â– â– index=â– â– â–
color=â– â– â– â– â– â– â– â– index=â– â– â– color=â– â– â– â– â– â– â– index=â– â– â– color=â– â– â– â– â– â– â– â–
index=â– â– â– color=â– â– â– â– â– â– â– â– index=â– â– â– color=â– â– â– â– â– â– â– â– index=â– â– â–
color=â– â– â– â– â– â– â– index=â– â– â– color=â– â– â– â– â– â– â– index=â– â– â– color=â– â– â– â– â– â–
index=â– â– â– color=â– â– â– â– â– â– index=â– â– â– color=â– â– â– â– â– â– â– index=â– â– â–
color=â– â– â– â– â– â– â– â– index=â– â– â– color=â– â– â– â– â– â– â– index=â– â– â– color=â– â– â– â– â– â– â–
index=â– â– â– color=â– â– â– â– â– â– â– â– index=â– â– â– color=â– â– â– â– â– â– â– index=â– â– â–
color=â– â– â– â– â– â– â– â– index=â– â– â– color=â– â– â– â– â– â– â– â– index=â– â– â– color=â– â– â– â– â– â– â– â–
index=â– â– â– color=â– â– â– â– â– â– â– â– index=â– â– â– color=â– â– â– â– â– â– â– â– index=â– â– â–
color=â– â– â– â– â– â– â– â– index=â– â– â– color=â– â– â– â– â– â– â– index=â– â– â– color=â– â– â– â– â– â– â– â–
index=â– â– â– color=â– â– â– â– â– â– â– â– index=â– â– â– color=â– â– â– â– â– â– â– â– index=â– â– â–
color=â– â– â– â– â– â– â– index=â– â– â– color=â– â– â– â– â– â– â– index=â– â– â– color=â– â– â– â– â– â– â– â–
index=â– â– â– color=â– â– â– â– â– â– â– â– index=â– â– â– color=â– â– â– â– â– â– â– â– index=â– â– â–
color=â– â– â– â– â– â– â– â– index=â– â– â– color=â– â– â– â– â– â– â– â– index=â– â– â– color=â– â– â– â– â– â– â– â–
index=â– â– â– color=â– â– â– â– â– â– â– â– index=â– â– â– color=â– â– â– â– â– â– â– â– index=â– â– â–
color=â– â– â– â– â– â– â– â– index=â– â– â– color=â– â– â– â– â– â– â– â– index=â– â– â– color=â– â– â– â– â– â– â– â–
index=â– â– â– color=â– â– â– â– â– â– â– â– index=â– â– â– color=â– â– â– â– â– â– â– â– index=â– â– â–
color=â– â– â– â– â– â– â– â– index=â– â– â– color=â– â– â– â– â– â– â– index=â– â– â– color=â– â– â– â– â– â– â– â–
index=â– â– â– color=â– â– â– â– â– â– â– â– index=â– â– â– color=â– â– â– â– â– â– â– â– index=â– â– â–
color=â– â– â– â– â– â– â– â– index=â– â– â– color=â– â– â– â– â– â– â– â– index=â– â– â– color=â– â– â– â– â– â– â– â–
index=â– â– â– color=â– â– â– â– â– â– â– â– index=â– â– â– color=â– â– â– â– â– â– â– â– index=â– â– â–
color=â– â– â– â– â– â– â– â– index=â– â– â– color=â– â– â– â– â– â– â– index=â– â– â– color=â– â– â– â– â– â– â– â–
index=â– â– â– color=â– â– â– â– â– â– â– index=â– â– â– color=â– â– â– â– â– â– â– â– index=â– â– â–
color=â– â– â– â– â– â– â– index=â– â– â– color=â– â– â– â– â– â– â– â– index=â– â– â– color=â– â– â– â– â– â– â– â–
index=â– â– â– color=â– â– â– â– â– â– â– â– index=â– â– â– color=â– â– â– â– â– â– â– â– index=â– â– â–
color=â– â– â– â– â– â– â– index=â– â– â– color=â– â– â– â– â– â– â– index=â– â– â– color=â– â– â– â– â– â– â–
index=â– â– â– color=â– â– â– â– â– â– â– â– index=â– â– â– color=â– â– â– â– â– â– â– index=â– â– â–
color=â– â– â– â– â– â– â– â– index=â– â– â– color=â– â– â– â– â– â– â– index=â– â– â– color=â– â– â– â– â– â– â–
index=â– â– â– color=â– â– â– â– â– â– â– â–
opacity:
smooth=no index=â– opacity=â– â– â–
layer:
caption="Background" opacity=â– â– â–
mapping:
center=-â– â– .â– â– â– â– â– â– â– â– â– /-â– .â– â– â– â– â– â– â– â– â– magn=â– .â– â– â– â– â– â– â– â– angle=â– â– .â– â– â– â–
formula:
maxiter=â– â– â– filename="lkmâ– .ufm" entry="fourier-popcorn"
p_control_type=basic p_bailout=â– â– â– â– p_hall=â– .â– /â–
p_functypeall="sin general" p_powerall=â– /â– p_ntermall=â– â–
p_slopeall=â– /â– f_funcall=tan p_hx=â– .â– /â– p_vartypexin=y
p_functypexin="cos odd pos" p_powerxin=â– /â– p_ntermxin=â– â–
f_funcxin=cos p_vartypexout=y p_functypexout="cos odd pos"
p_powerxout=â– /â– p_ntermxout=â– â– p_slopexout=â– /â– f_funcxout=cos
p_hy=â– .â– /â– p_vartypeyin=x p_functypeyin="sin odd pos" p_poweryin=â– /â–
p_ntermyin=â– â– f_funcyin=sin p_vartypeyout=x
p_functypeyout="sin odd pos" p_poweryout=â– /â– p_ntermyout=â– â–
p_slopeyout=â– /â– f_funcyout=sin
inside:
transfer=none
outside:
transfer=linear
gradient:
smooth=yes rotation=-â– â– index=â– color=â– â– â– â– â– â– â– â– index=â– â–
color=â– â– â– â– â– â– â– â– index=â– â– color=â– â– â– â– â– index=â– â– color=â– â– â– â– â– â– â– index=â– â– â–
color=â– â– â– â– â– â– index=â– â– â– color=â– â– â– â– â– â– â– index=â– â– â– color=â– â– â– â– â– â– â–
index=â– â– â– color=â– â– â– â– â– â– â– index=-â– â– color=â– â– â– â– â– â– â– â– index=-â– â–
color=â– â– â– â– â– â– â– â– index=-â– â– color=â– â– â– â– â– â– â–
opacity:
smooth=no index=â– opacity=â– â– â–
}
fourier-popcorn { ; Kerry Mitchell â– â– Mayâ– â– â– â–
;
; This is a complex-valued implementation and generalization
; of Cliff Pickover's "popcorn" algorithm. His method iterates
; â– real variables like this:
;
; xnew = xold - h â– sin(aâ– y + tan(bâ– y))
; ynew = yold - h â– sin(aâ– x + tan(bâ– x))
;
; where a = â– . The current method generalizes the above by:
; using truncated Fourier series instead of just single sin or tan function
; allowing for complex values of a (slope)
; having the same Fourier series parameters (basic controls) or
; having different parameters for the â– series (x inner, x outer,
; y inner, and y outer)
;
init:
complex temp=(â– ,â– )
complex tempx=(â– ,â– )
complex tempy=(â– ,â– )
complex tempâ– =(â– ,â– )
complex tempâ– x=(â– ,â– )
complex tempâ– y=(â– ,â– )
complex tempin=(â– ,â– )
complex tempinx=(â– ,â– )
complex tempiny=(â– ,â– )
complex tempout=(â– ,â– )
complex tempoutx=(â– ,â– )
complex tempouty=(â– ,â– )
complex x=real(#pixel)
complex y=imag(#pixel)
complex xnew=(â– ,â– )
complex ynew=(â– ,â– )
complex z=#pixel
int iterm=â–
int jterm=â–
int parity=â–
loop:
;
; basic controls
;
if(@control_type=="basic")
;
; choose what inner variable to use
;
tempinx=y
tempiny=x
;
; compute the inner Fourier series
;
tempx=â–
tempy=â–
iterm=â–
while(iterm<@ntermall)
iterm=iterm+â–
if(@functypeall=="sin odd pos")
jterm=â– â– iterm-â–
tempx=tempx+sin(tempinxâ– jterm)/(jterm^@powerall)
tempy=tempy+sin(tempinyâ– jterm)/(jterm^@powerall)
elseif(@functypeall=="cos odd pos")
jterm=â– â– iterm-â–
tempx=tempx+cos(tempinxâ– jterm)/(jterm^@powerall)
tempy=tempy+cos(tempinyâ– jterm)/(jterm^@powerall)
elseif(@functypeall=="sin all pos")
jterm=iterm
tempx=tempx+sin(tempinxâ– jterm)/(jterm^@powerall)
tempy=tempy+sin(tempinyâ– jterm)/(jterm^@powerall)
elseif(@functypeall=="cos all pos")
jterm=iterm
tempx=tempx+cos(tempinxâ– jterm)/(jterm^@powerall)
tempy=tempy+cos(tempinyâ– jterm)/(jterm^@powerall)
elseif(@functypeall=="sin odd alt")
jterm=â– â– iterm-â–
parity=(iterm%â– )â– â– -â–
tempx=tempx+parityâ– sin(tempinxâ– jterm)/(jterm^@powerall)
tempy=tempy+parityâ– sin(tempinyâ– jterm)/(jterm^@powerall)
elseif(@functypeall=="cos odd alt")
jterm=â– â– iterm-â–
parity=(iterm%â– )â– â– -â–
tempx=tempx+parityâ– cos(tempinxâ– jterm)/(jterm^@powerall)
tempy=tempy+parityâ– cos(tempinyâ– jterm)/(jterm^@powerall)
elseif(@functypeall=="sin all alt")
jterm=iterm
parity=(iterm%â– )â– â– -â–
tempx=tempx+parityâ– sin(tempinxâ– jterm)/(jterm^@powerall)
tempy=tempy+parityâ– sin(tempinyâ– jterm)/(jterm^@powerall)
elseif(@functypeall=="cos all alt")
jterm=iterm
parity=(iterm%â– )â– â– -â–
tempx=tempx+parityâ– cos(tempinxâ– jterm)/(jterm^@powerall)
tempy=tempy+parityâ– cos(tempinyâ– jterm)/(jterm^@powerall)
elseif(@functypeall=="sin general")
jterm=iterm
tempx=tempx+@funcall(jterm)â– sin(tempinxâ– jterm)/(jterm^@powerall)
tempy=tempy+@funcall(jterm)â– sin(tempinyâ– jterm)/(jterm^@powerall)
elseif(@functypeall=="cos general")
jterm=iterm
tempx=tempx+@funcall(jterm)â– cos(tempinxâ– jterm)/(jterm^@powerall)
tempy=tempy+@funcall(jterm)â– cos(tempinyâ– jterm)/(jterm^@powerall)
endif
endwhile
;
; choose what outer variable to use
;
tempoutx=y
tempouty=x
;
; compute the outer Fourier series
;
tempâ– x=â–
tempâ– y=â–
iterm=â–
while(iterm<@ntermall)
iterm=iterm+â–
if(@functypeall=="sin odd pos")
jterm=â– â– iterm-â–
tempâ– x=tempâ– x+sin((@slopeallâ– tempoutx+tempx)â– jterm)/(jterm^@powerall)
tempâ– y=tempâ– y+sin((@slopeallâ– tempouty+tempy)â– jterm)/(jterm^@powerall)
elseif(@functypeall=="cos odd pos")
jterm=â– â– iterm-â–
tempâ– x=tempâ– x+cos((@slopeallâ– tempoutx+tempx)â– jterm)/(jterm^@powerall)
tempâ– y=tempâ– y+cos((@slopeallâ– tempouty+tempy)â– jterm)/(jterm^@powerall)
elseif(@functypeall=="sin all pos")
jterm=iterm
tempâ– x=tempâ– x+sin((@slopeallâ– tempoutx+tempx)â– jterm)/(jterm^@powerall)
tempâ– y=tempâ– y+sin((@slopeallâ– tempouty+tempy)â– jterm)/(jterm^@powerall)
elseif(@functypeall=="cos all pos")
jterm=iterm
tempâ– x=tempâ– x+cos((@slopeallâ– tempoutx+tempx)â– jterm)/(jterm^@powerall)
tempâ– y=tempâ– y+cos((@slopeallâ– tempouty+tempy)â– jterm)/(jterm^@powerall)
elseif(@functypeall=="sin odd alt")
jterm=â– â– iterm-â–
parity=(iterm%â– )â– â– -â–
tempâ– x=tempâ– x+parityâ– sin((@slopeallâ– tempoutx+tempx)â– jterm)/(jterm^@powerall)
tempâ– y=tempâ– y+parityâ– sin((@slopeallâ– tempouty+tempy)â– jterm)/(jterm^@powerall)
elseif(@functypeall=="cos odd alt")
jterm=â– â– iterm-â–
parity=(iterm%â– )â– â– -â–
tempâ– x=tempâ– x+parityâ– cos((@slopeallâ– tempoutx+tempx)â– jterm)/(jterm^@powerall)
tempâ– y=tempâ– y+parityâ– cos((@slopeallâ– tempouty+tempy)â– jterm)/(jterm^@powerall)
elseif(@functypeall=="sin all alt")
jterm=iterm
parity=(iterm%â– )â– â– -â–
tempâ– x=tempâ– x+parityâ– sin((@slopeallâ– tempoutx+tempx)â– jterm)/(jterm^@powerall)
tempâ– y=tempâ– y+parityâ– sin((@slopeallâ– tempouty+tempy)â– jterm)/(jterm^@powerall)
elseif(@functypeall=="cos all alt")
jterm=iterm
parity=(iterm%â– )â– â– -â–
tempâ– x=tempâ– x+parityâ– cos((@slopeallâ– tempoutx+tempx)â– jterm)/(jterm^@powerall)
tempâ– y=tempâ– y+parityâ– cos((@slopeallâ– tempouty+tempy)â– jterm)/(jterm^@powerall)
elseif(@functypeall=="sin general")
jterm=iterm
tempâ– x=tempâ– x+@funcall(jterm)â– sin((@slopeallâ– tempoutx+tempx)â– jterm)/(jterm^@powerall)
tempâ– y=tempâ– y+@funcall(jterm)â– sin((@slopeallâ– tempouty+tempy)â– jterm)/(jterm^@powerall)
elseif(@functypeall=="cos general")
jterm=iterm
tempâ– x=tempâ– x+@funcall(jterm)â– cos((@slopeallâ– tempoutx+tempx)â– jterm)/(jterm^@powerall)
tempâ– y=tempâ– y+@funcall(jterm)â– cos((@slopeallâ– tempouty+tempy)â– jterm)/(jterm^@powerall)
endif
endwhile
xnew=x+@hallâ– tempâ– x
ynew=y+@hallâ– tempâ– y
x=xnew
y=ynew
z=x+flip(y)
;
; advanced controls
;
else
;
; x equation
;
; choose what inner variable to use
;
if(@vartypexin=="x")
tempin=x
elseif(@vartypexin=="y")
tempin=y
elseif(@vartypexin=="x+y")
tempin=x+y
elseif(@vartypexin=="y-x")
tempin=y-x
elseif(@vartypexin=="xâ– y")
tempin=xâ– y
elseif(@vartypexin=="y/x")
tempin=y/x
endif
;
; compute the inner Fourier series
;
temp=â–
iterm=â–
while(iterm<@ntermxin)
iterm=iterm+â–
if(@functypexin=="sin odd pos")
jterm=â– â– iterm-â–
temp=temp+sin(tempinâ– jterm)/(jterm^@powerxin)
elseif(@functypexin=="cos odd pos")
jterm=â– â– iterm-â–
temp=temp+cos(tempinâ– jterm)/(jterm^@powerxin)
elseif(@functypexin=="sin all pos")
jterm=iterm
temp=temp+sin(tempinâ– jterm)/(jterm^@powerxin)
elseif(@functypexin=="cos all pos")
jterm=iterm
temp=temp+cos(tempinâ– jterm)/(jterm^@powerxin)
elseif(@functypexin=="sin odd alt")
jterm=â– â– iterm-â–
parity=(iterm%â– )â– â– -â–
temp=temp+parityâ– sin(tempinâ– jterm)/(jterm^@powerxin)
elseif(@functypexin=="cos odd alt")
jterm=â– â– iterm-â–
parity=(iterm%â– )â– â– -â–
temp=temp+parityâ– cos(tempinâ– jterm)/(jterm^@powerxin)
elseif(@functypexin=="sin all alt")
jterm=iterm
parity=(iterm%â– )â– â– -â–
temp=temp+parityâ– sin(tempinâ– jterm)/(jterm^@powerxin)
elseif(@functypexin=="cos all alt")
jterm=iterm
parity=(iterm%â– )â– â– -â–
temp=temp+parityâ– cos(tempinâ– jterm)/(jterm^@powerxin)
elseif(@functypexin=="sin general")
jterm=iterm
temp=temp+@funcxin(jterm)â– sin(tempinâ– jterm)/(jterm^@powerxin)
elseif(@functypexin=="cos general")
jterm=iterm
temp=temp+@funcxin(jterm)â– cos(tempinâ– jterm)/(jterm^@powerxin)
endif
endwhile
;
; choose what outer variable to use
;
if(@vartypexout=="x")
tempout=x
elseif(@vartypexout=="y")
tempout=y
elseif(@vartypexout=="x+y")
tempout=x+y
elseif(@vartypexout=="y-x")
tempout=y-x
elseif(@vartypexout=="xâ– y")
tempout=xâ– y
elseif(@vartypexout=="y/x")
tempout=y/x
endif
;
; compute the outer Fourier series
;
tempâ– =â–
iterm=â–
while(iterm<@ntermxout)
iterm=iterm+â–
if(@functypexout=="sin odd pos")
jterm=â– â– iterm-â–
tempâ– =tempâ– +sin((@slopexoutâ– tempout+temp)â– jterm)/(jterm^@powerxout)
elseif(@functypexout=="cos odd pos")
jterm=â– â– iterm-â–
tempâ– =tempâ– +cos((@slopexoutâ– tempout+temp)â– jterm)/(jterm^@powerxout)
elseif(@functypexout=="sin all pos")
jterm=iterm
tempâ– =tempâ– +sin((@slopexoutâ– tempout+temp)â– jterm)/(jterm^@powerxout)
elseif(@functypexout=="cos all pos")
jterm=iterm
tempâ– =tempâ– +cos((@slopexoutâ– tempout+temp)â– jterm)/(jterm^@powerxout)
elseif(@functypexout=="sin odd alt")
jterm=â– â– iterm-â–
parity=(iterm%â– )â– â– -â–
tempâ– =tempâ– +parityâ– sin((@slopexoutâ– tempout+temp)â– jterm)/(jterm^@powerxout)
elseif(@functypexout=="cos odd alt")
jterm=â– â– iterm-â–
parity=(iterm%â– )â– â– -â–
tempâ– =tempâ– +parityâ– cos((@slopexoutâ– tempout+temp)â– jterm)/(jterm^@powerxout)
elseif(@functypexout=="sin all alt")
jterm=iterm
parity=(iterm%â– )â– â– -â–
tempâ– =tempâ– +parityâ– sin((@slopexoutâ– tempout+temp)â– jterm)/(jterm^@powerxout)
elseif(@functypexout=="cos all alt")
jterm=iterm
parity=(iterm%â– )â– â– -â–
tempâ– =tempâ– +parityâ– cos((@slopexoutâ– tempout+temp)â– jterm)/(jterm^@powerxout)
elseif(@functypexout=="sin general")
jterm=iterm
tempâ– =tempâ– +@funcxout(jterm)â– sin((@slopexoutâ– tempout+temp)â– jterm)/(jterm^@powerxout)
elseif(@functypexout=="cos general")
jterm=iterm
tempâ– =tempâ– +@funcxout(jterm)â– cos((@slopexoutâ– tempout+temp)â– jterm)/(jterm^@powerxout)
endif
endwhile
xnew=x+@hxâ– tempâ–
;
; y equation
;
; choose what inner variable to use
;
if(@vartypeyin=="x")
tempin=x
elseif(@vartypeyin=="y")
tempin=y
elseif(@vartypeyin=="x+y")
tempin=x+y
elseif(@vartypeyin=="y-x")
tempin=y-x
elseif(@vartypeyin=="xâ– y")
tempin=xâ– y
elseif(@vartypeyin=="y/x")
tempin=y/x
endif
;
; compute the inner Fourier series
;
temp=â–
iterm=â–
while(iterm<@ntermyin)
iterm=iterm+â–
if(@functypeyin=="sin odd pos")
jterm=â– â– iterm-â–
temp=temp+sin(tempinâ– jterm)/(jterm^@poweryin)
elseif(@functypeyin=="cos odd pos")
jterm=â– â– iterm-â–
temp=temp+cos(tempinâ– jterm)/(jterm^@poweryin)
elseif(@functypeyin=="sin all pos")
jterm=iterm
temp=temp+sin(tempinâ– jterm)/(jterm^@poweryin)
elseif(@functypeyin=="cos all pos")
jterm=iterm
temp=temp+cos(tempinâ– jterm)/(jterm^@poweryin)
elseif(@functypeyin=="sin odd alt")
jterm=â– â– iterm-â–
parity=(iterm%â– )â– â– -â–
temp=temp+parityâ– sin(tempinâ– jterm)/(jterm^@poweryin)
elseif(@functypeyin=="cos odd alt")
jterm=â– â– iterm-â–
parity=(iterm%â– )â– â– -â–
temp=temp+parityâ– cos(tempinâ– jterm)/(jterm^@poweryin)
elseif(@functypeyin=="sin all alt")
jterm=iterm
parity=(iterm%â– )â– â– -â–
temp=temp+parityâ– sin(tempinâ– jterm)/(jterm^@poweryin)
elseif(@functypeyin=="cos all alt")
jterm=iterm
parity=(iterm%â– )â– â– -â–
temp=temp+parityâ– cos(tempinâ– jterm)/(jterm^@poweryin)
elseif(@functypeyin=="sin general")
jterm=iterm
temp=temp+@funcyin(jterm)â– sin(tempinâ– jterm)/(jterm^@poweryin)
elseif(@functypeyin=="cos general")
jterm=iterm
temp=temp+@funcyin(jterm)â– cos(tempinâ– jterm)/(jterm^@poweryin)
endif
endwhile
;
; choose what outer variable to use
;
if(@vartypeyout=="x")
tempout=x
elseif(@vartypeyout=="y")
tempout=y
elseif(@vartypeyout=="x+y")
tempout=x+y
elseif(@vartypeyout=="y-x")
tempout=y-x
elseif(@vartypeyout=="xâ– y")
tempout=xâ– y
elseif(@vartypeyout=="y/x")
tempout=y/x
endif
;
; compute the outer Fourier series
;
tempâ– =â–
iterm=â–
while(iterm<@ntermyout)
iterm=iterm+â–
if(@functypeyout=="sin odd pos")
jterm=â– â– iterm-â–
tempâ– =tempâ– +sin((@slopeyoutâ– tempout+temp)â– jterm)/(jterm^@poweryout)
elseif(@functypeyout=="cos odd pos")
jterm=â– â– iterm-â–
tempâ– =tempâ– +cos((@slopeyoutâ– tempout+temp)â– jterm)/(jterm^@poweryout)
elseif(@functypeyout=="sin all pos")
jterm=iterm
tempâ– =tempâ– +sin((@slopeyoutâ– tempout+temp)â– jterm)/(jterm^@poweryout)
elseif(@functypeyout=="cos all pos")
jterm=iterm
tempâ– =tempâ– +cos((@slopeyoutâ– tempout+temp)â– jterm)/(jterm^@poweryout)
elseif(@functypeyout=="sin odd alt")
jterm=â– â– iterm-â–
parity=(iterm%â– )â– â– -â–
tempâ– =tempâ– +parityâ– sin((@slopeyoutâ– tempout+temp)â– jterm)/(jterm^@poweryout)
elseif(@functypeyout=="cos odd alt")
jterm=â– â– iterm-â–
parity=(iterm%â– )â– â– -â–
tempâ– =tempâ– +parityâ– cos((@slopeyoutâ– tempout+temp)â– jterm)/(jterm^@poweryout)
elseif(@functypeyout=="sin all alt")
jterm=iterm
parity=(iterm%â– )â– â– -â–
tempâ– =tempâ– +parityâ– sin((@slopeyoutâ– tempout+temp)â– jterm)/(jterm^@poweryout)
elseif(@functypeyout=="cos all alt")
jterm=iterm
parity=(iterm%â– )â– â– -â–
tempâ– =tempâ– +parityâ– cos((@slopeyoutâ– tempout+temp)â– jterm)/(jterm^@poweryout)
elseif(@functypeyout=="sin general")
jterm=iterm
tempâ– =tempâ– +@funcyout(jterm)â– sin((@slopeyoutâ– tempout+temp)â– jterm)/(jterm^@poweryout)
elseif(@functypeyout=="cos general")
jterm=iterm
tempâ– =tempâ– +@funcyout(jterm)â– cos((@slopeyoutâ– tempout+temp)â– jterm)/(jterm^@poweryout)
endif
endwhile
ynew=y+@hyâ– tempâ–
x=xnew
y=ynew
z=x+flip(y)
endif
bailout:
|z|<@bailout
default:
title="Fourier Popcorn"
heading
text="Uses Cliff Pickover's Popcorn routine, substituting Fourier \
series for the sine and tangent functions."
endheading
;
; general parameters
;
heading
caption="General parameters"
endheading
param control_type
caption="control type"
default=â–
enum="basic" "advanced"
endparam
float param bailout
caption="bailout value"
default=â– â– â– â–
endparam
;
; basic parameters
;
heading
caption="Fourier series parameters"
visible=(@control_type=="basic")
endheading
complex param hall
caption="step size"
default=â– .â–
visible=(@control_type=="basic")
endparam
param functypeall
caption="function type"
default=â–
enum="sin odd pos" "cos odd pos" "sin all pos" "cos all pos" \
"sin odd alt" "cos odd alt" "sin all alt" "cos all alt" \
"sin general" "cos general"
visible=(@control_type=="basic")
endparam
complex param powerall
caption="power"
default=â–
visible=(@control_type=="basic")
endparam
int param ntermall
caption="# terms"
default=â– â–
min=â–
visible=(@control_type=="basic")
endparam
complex param slopeall
caption="slope"
default=â–
visible=(@control_type=="basic")
endparam
func funcall
caption="function"
default=tan()
visible=((@control_type=="basic")&&((@functypeall=="sin general")\
||(@functypeall=="cos general")))
endfunc
;
; advanced parameters
;
; x inner parameters
;
heading
caption="x inner parameters"
visible=(@control_type=="advanced")
endheading
complex param hx
caption="step size"
default=â– .â–
visible=(@control_type=="advanced")
endparam
param vartypexin
caption="inner variable type"
default=â–
enum="x" "y" "x+y" "y-x" "xâ– y" "y/x"
visible=(@control_type=="advanced")
endparam
param functypexin
caption="function type"
default=â–
enum="sin odd pos" "cos odd pos" "sin all pos" "cos all pos" \
"sin odd alt" "cos odd alt" "sin all alt" "cos all alt" \
"sin general" "cos general"
visible=(@control_type=="advanced")
endparam
complex param powerxin
caption="power"
default=â–
visible=(@control_type=="advanced")
endparam
int param ntermxin
caption="# terms"
default=â– â–
min=â–
visible=(@control_type=="advanced")
endparam
func funcxin
caption="function"
default=cos()
visible=((@control_type=="advanced")&&((@functypexin=="sin general")\
||(@functypexin=="cos general")))
endfunc
;
; x outer parameters
;
heading
caption="x outer parameters"
visible=(@control_type=="advanced")
endheading
param vartypexout
caption="outer variable type"
default=â–
enum="x" "y" "x+y" "y-x" "xâ– y" "y/x"
visible=(@control_type=="advanced")
endparam
param functypexout
caption="function type"
default=â–
enum="sin odd pos" "cos odd pos" "sin all pos" "cos all pos" \
"sin odd alt" "cos odd alt" "sin all alt" "cos all alt" \
"sin general" "cos general"
visible=(@control_type=="advanced")
endparam
complex param powerxout
caption="power"
default=â–
visible=(@control_type=="advanced")
endparam
int param ntermxout
caption="# terms"
default=â– â–
min=â–
visible=(@control_type=="advanced")
endparam
complex param slopexout
caption="slope"
default=â–
visible=(@control_type=="advanced")
endparam
func funcxout
caption="function"
default=cos()
visible=((@control_type=="advanced")&&((@functypexout=="sin general")\
||(@functypexout=="cos general")))
endfunc
;
; y inner parameters
;
heading
caption="y inner parameters"
visible=(@control_type=="advanced")
endheading
complex param hy
caption="step size"
default=â– .â–
visible=(@control_type=="advanced")
endparam
param vartypeyin
caption="inner variable type"
default=â–
enum="x" "y" "x+y" "y-x" "xâ– y" "y/x"
visible=(@control_type=="advanced")
endparam
param functypeyin
caption="function type"
default=â–
enum="sin odd pos" "cos odd pos" "sin all pos" "cos all pos" \
"sin odd alt" "cos odd alt" "sin all alt" "cos all alt" \
"sin general" "cos general"
visible=(@control_type=="advanced")
endparam
complex param poweryin
caption="power"
default=â–
visible=(@control_type=="advanced")
endparam
int param ntermyin
caption="# terms"
default=â– â–
min=â–
visible=(@control_type=="advanced")
endparam
func funcyin
caption="function"
default=sin()
visible=((@control_type=="advanced")&&((@functypeyin=="sin general")\
||(@functypeyin=="cos general")))
endfunc
;
; y outer parameters
;
heading
caption="y outer parameters"
visible=(@control_type=="advanced")
endheading
param vartypeyout
caption="outer variable type"
default=â–
enum="x" "y" "x+y" "y-x" "xâ– y" "y/x"
visible=(@control_type=="advanced")
endparam
param functypeyout
caption="function type"
default=â–
enum="sin odd pos" "cos odd pos" "sin all pos" "cos all pos" \
"sin odd alt" "cos odd alt" "sin all alt" "cos all alt" \
"sin general" "cos general"
visible=(@control_type=="advanced")
endparam
complex param poweryout
caption="power"
default=â–
visible=(@control_type=="advanced")
endparam
int param ntermyout
caption="# terms"
default=â– â–
min=â–
visible=(@control_type=="advanced")
endparam
complex param slopeyout
caption="slope"
default=â–
visible=(@control_type=="advanced")
endparam
func funcyout
caption="function"
default=sin()
visible=((@control_type=="advanced")&&((@functypeyout=="sin general")\
||(@functypeyout=="cos general")))
endfunc
}