scratchpad
YuckFoo
folder-m {
init:
float tau = #pi * 2.0
float x = 0.0
float y = 0.0
float t = 0.0
float len = 0.0
float ang = 0.0
int i = 0
loop:
;---------------
x = real(z)
y = imag(z)
t = real(@zwave) * @xfunk(x + real(@ztide))
x = (x + (t * real(@zdamp))) / (1 + abs(real(@zdamp)))
t = imag(@zwave) * @yfunk(y + imag(@ztide))
y = (y + (t * imag(@zdamp))) / (1 + abs(imag(@zdamp)))
x = x + real(@zmove)
y = y + imag(@zmove)
z = x + flip(y), len = cabs(z), ang = atan2(z)
x = len * cos(ang + real(@zroll) * tau)
y = len * sin(ang + real(@zroll) * tau)
x = x * real(@zzoom)
y = y * imag(@zzoom)
;---------------
if (i % 3 == 0)
z = x + flip(y), len = cabs(z), ang = atan2(z)
x = len * cos(ang + real(@aroll) * tau)
y = len * sin(ang + real(@aroll) * tau)
x = x + real(@amove)
y = y + imag(@amove)
if (@aflip == 0), x = abs(x), endif
elsif (@aflip == 1), x = -abs(x), endif
elsif (@aflip == 2), y = abs(y), endif
elsif (@aflip == 3), y = -abs(y), endif
elsif (@aflip == 4), x = abs(x), y = abs(y), endif
elsif (@aflip == 5), x = abs(x), y = -abs(y), endif
elsif (@aflip == 6), x = -abs(x), y = abs(y), endif
elsif (@aflip == 7), x = -abs(x), y = -abs(y), endif
x = x - real(@amove)
y = y - imag(@amove)
z = x + flip(y), len = cabs(z), ang = atan2(z)
x = len * cos(ang - real(@aroll) * tau)
y = len * sin(ang - real(@aroll) * tau)
elsif (i % 3 == 1)
z = x + flip(y), len = cabs(z), ang = atan2(z)
x = len * cos(ang + real(@broll) * tau)
y = len * sin(ang + real(@broll) * tau)
x = x + real(@bmove)
y = y + imag(@bmove)
if (@bflip == 0), x = abs(x), endif
elsif (@bflip == 1), x = -abs(x), endif
elsif (@bflip == 2), y = abs(y), endif
elsif (@bflip == 3), y = -abs(y), endif
elsif (@bflip == 4), x = abs(x), y = abs(y), endif
elsif (@bflip == 5), x = abs(x), y = -abs(y), endif
elsif (@bflip == 6), x = -abs(x), y = abs(y), endif
elsif (@bflip == 7), x = -abs(x), y = -abs(y), endif
x = x - real(@bmove)
y = y - imag(@bmove)
z = x + flip(y), len = cabs(z), ang = atan2(z)
x = len * cos(ang - real(@broll) * tau)
y = len * sin(ang - real(@broll) * tau)
;---------------
else
z = x + flip(y), len = cabs(z), ang = atan2(z)
x = len * cos(ang + real(@croll) * tau)
y = len * sin(ang + real(@croll) * tau)
x = x + real(@cmove)
y = y + imag(@cmove)
if (@cflip == 0), x = abs(x), endif
elsif (@cflip == 1), x = -abs(x), endif
elsif (@cflip == 2), y = abs(y), endif
elsif (@cflip == 3), y = -abs(y), endif
elsif (@cflip == 4), x = abs(x), y = abs(y), endif
elsif (@cflip == 5), x = abs(x), y = -abs(y), endif
elsif (@cflip == 6), x = -abs(x), y = abs(y), endif
elsif (@cflip == 7), x = -abs(x), y = -abs(y), endif
x = x - real(@cmove)
y = y - imag(@cmove)
z = x + flip(y), len = cabs(z), ang = atan2(z)
x = len * cos(ang - real(@croll) * tau)
y = len * sin(ang - real(@croll) * tau)
endif
i = i + 1
x = x + real(#pixel)
y = y + imag(#pixel)
z = x + flip(y)
bailout:
cabs(z) < @quit
default:
title = "Folder M"
maxiter = 256
param quit
caption = "Quit"
default = 8.0
endparam
param zmove
caption = "Move"
default = (0, 0)
endparam
param zroll
caption = "Roll"
default = (0, 0)
endparam
param zzoom
caption = "Zoom"
default = (1.25, 1.25)
endparam
func xfunk
caption ="X Funk"
default = ident()
endfunc
func yfunk
caption ="Y Funk"
default = ident()
endfunc
param zwave
caption = "Wave"
default = (0, 0)
endparam
param ztide
caption = "Tide"
default = (0, 0)
endparam
param zdamp
caption = "Damp"
default = (0, 0)
endparam
param amove
caption = "A Move"
default = (0, 0)
endparam
param aroll
caption = "A Roll"
default = (0, 0)
endparam
param aflip
caption = "A Flip"
default = 3
enum = "x+" "x-" "y+" "y-" "x+ y+" "x+ y-" "x- y+" "x- y-"
endparam
param bmove
caption = "B Move"
default = (0, 0)
endparam
param broll
caption = "B Roll"
default = (0, 0)
endparam
param bflip
caption = "B Flip"
default = 3
enum = "x+" "x-" "y+" "y-" "x+ y+" "x+ y-" "x- y+" "x- y-"
endparam
param cmove
caption = "C Move"
default = (0, 0)
endparam
param croll
caption = "C Roll"
default = (0, 0)
endparam
param cflip
caption = "C Flip"
default = 3
enum = "x+" "x-" "y+" "y-" "x+ y+" "x+ y-" "x- y+" "x- y-"
endparam
switch:
type = "folder-j"
bump = #pixel
quit = quit
zmove = zmove
zroll = zroll
zzoom = zzoom
amove = amove
aroll = aroll
aflip = aflip
bmove = bmove
broll = broll
bflip = bflip
cmove = cmove
croll = croll
cflip = cflip
}
folder-j {
float tau = #pi * 2.0
float x = real(#pixel)
float y = imag(#pixel
float len = 0.0
float ang = 0.0
int i = 0
loop:
;---------------
x = x + real(@zmove)
y = y + imag(@zmove)
t = real(@zwave) * @xfunk(x + real(@ztide))
x = (x + (t * real(@zdamp))) / (1 + abs(real(@zdamp)))
t = imag(@zwave) * @yfunk(y + imag(@ztide))
y = (y + (t * imag(@zdamp))) / (1 + abs(imag(@zdamp)))
x = x + real(@zmove)
y = y + imag(@zmove)
z = x + flip(y), len = cabs(z), ang = atan2(z)
x = len * cos(ang + real(@zroll) * tau)
y = len * sin(ang + real(@zroll) * tau)
x = x * real(@zzoom)
y = y * imag(@zzoom)
;---------------
if (i % 3 == 0)
z = x + flip(y), len = cabs(z), ang = atan2(z)
x = len * cos(ang + real(@aroll) * tau)
y = len * sin(ang + real(@aroll) * tau)
x = x + real(@amove)
y = y + imag(@amove)
if (@aflip == 0), x = abs(x), endif
elsif (@aflip == 1), x = -abs(x), endif
elsif (@aflip == 2), y = abs(y), endif
elsif (@aflip == 3), y = -abs(y), endif
elsif (@aflip == 4), x = abs(x), y = abs(y), endif
elsif (@aflip == 5), x = abs(x), y = -abs(y), endif
elsif (@aflip == 6), x = -abs(x), y = abs(y), endif
elsif (@aflip == 7), x = -abs(x), y = -abs(y), endif
x = x - real(@amove)
y = y - imag(@amove)
z = x + flip(y), len = cabs(z), ang = atan2(z)
x = len * cos(ang - real(@aroll) * tau)
y = len * sin(ang - real(@aroll) * tau)
elsif (i % 3 == 1)
z = x + flip(y), len = cabs(z), ang = atan2(z)
x = len * cos(ang + real(@broll) * tau)
y = len * sin(ang + real(@broll) * tau)
x = x + real(@bmove)
y = y + imag(@bmove)
if (@bflip == 0), x = abs(x), endif
elsif (@bflip == 1), x = -abs(x), endif
elsif (@bflip == 2), y = abs(y), endif
elsif (@bflip == 3), y = -abs(y), endif
elsif (@bflip == 4), x = abs(x), y = abs(y), endif
elsif (@bflip == 5), x = abs(x), y = -abs(y), endif
elsif (@bflip == 6), x = -abs(x), y = abs(y), endif
elsif (@bflip == 7), x = -abs(x), y = -abs(y), endif
x = x - real(@bmove)
y = y - imag(@bmove)
z = x + flip(y), len = cabs(z), ang = atan2(z)
x = len * cos(ang - real(@broll) * tau)
y = len * sin(ang - real(@broll) * tau)
;---------------
else
z = x + flip(y), len = cabs(z), ang = atan2(z)
x = len * cos(ang + real(@croll) * tau)
y = len * sin(ang + real(@croll) * tau)
x = x + real(@cmove)
y = y + imag(@cmove)
if (@cflip == 0), x = abs(x), endif
elsif (@cflip == 1), x = -abs(x), endif
elsif (@cflip == 2), y = abs(y), endif
elsif (@cflip == 3), y = -abs(y), endif
elsif (@cflip == 4), x = abs(x), y = abs(y), endif
elsif (@cflip == 5), x = abs(x), y = -abs(y), endif
elsif (@cflip == 6), x = -abs(x), y = abs(y), endif
elsif (@cflip == 7), x = -abs(x), y = -abs(y), endif
x = x - real(@cmove)
y = y - imag(@cmove)
z = x + flip(y), len = cabs(z), ang = atan2(z)
x = len * cos(ang - real(@croll) * tau)
y = len * sin(ang - real(@croll) * tau)
endif
i = i + 1
x = x + real(@bump)
y = y + imag(@bump)
z = x + flip(y)
bailout:
cabs(z) < @quit
default:
title = "Folder J"
maxiter = 256
param bump
caption = "Bump"
default = (0, 0)
endparam
param quit
caption = "Quit"
default = 8.0
endparam
param zmove
caption = "Move"
default = (0, 0)
endparam
param zzoom
caption = "Zoom"
default = (1.25, 1.25)
endparam
param zroll
caption = "Roll"
default = (0, 0)
endparam
func xfunk
caption ="X Funk"
default = ident()
endfunc
func yfunk
caption ="Y Funk"
default = ident()
endfunc
param zwave
caption = "Wave"
default = (0, 0)
endparam
param ztide
caption = "Tide"
default = (0, 0)
endparam
param zdamp
caption = "Damp"
default = (0, 0)
endparam
param amove
caption = "A Move"
default = (0, 0)
endparam
param aroll
caption = "A Roll"
default = (0, 0)
endparam
param aflip
caption = "A Flip"
default = 3
enum = "x+" "x-" "y+" "y-" "x+ y+" "x+ y-" "x- y+" "x- y-"
endparam
param bmove
caption = "B Move"
default = (0, 0)
endparam
param broll
caption = "B Roll"
default = (0, 0)
endparam
param bflip
caption = "B Flip"
default = 3
enum = "x+" "x-" "y+" "y-" "x+ y+" "x+ y-" "x- y+" "x- y-"
endparam
param cmove
caption = "C Move"
default = (0, 0)
endparam
param croll
caption = "C Roll"
default = (0, 0)
endparam
param cflip
caption = "C Flip"
default = 3
enum = "x+" "x-" "y+" "y-" "x+ y+" "x+ y-" "x- y+" "x- y-"
endparam
switch:
type = "folder-m"
quit = quit
zmove = zmove
zroll = zroll
zzoom = zzoom
xfunk = xfunk
yfunk = yfunk
amove = amove
aroll = aroll
aflip = aflip
bmove = bmove
broll = broll
bflip = bflip
cmove = cmove
croll = croll
cflip = cflip
}