the code isn't that interesting (just produces the image) but if anyone's interested:
defdbl a-z
const sw = 1024
const sh = 768
dim shared pi
pi = 4*atn(1)
screen _newimage(sw, sh, 32)
for i=0 to 3
for yy=0 to sh
for xx=0 to sw
select case i
case 0
u = (xx - sw/2)*0.015
v = (sh/2 - yy)*0.015
x = u
y = v
case 1
u = (xx - sw/2)*0.003
v = (sh/2 - yy)*0.003
cdiv uu, vv, u + 1, v, u - 1, v
x = uu
y = vv
case 2
u = (xx - sw/2)*0.008
v = (sh/2 - yy)*0.008
cmul uu, vv, u + 0.707, v + 0.707, u + 0.707, v - 0.707
cdiv x, y, uu, vv, u - 1, v
case 3
u = (xx - sw/2)*0.035
v = (sh/2 - yy)*0.035
uu = u
vv = v
a = 0
for t = 0 to 100 step 1
dx = 0.1*t*cos(100*t)
dy = 0.1*t*sin(100*t)
if a then
cmul uu, vv, uu, vv, u + dx, v + dy
else
cdiv uu, vv, uu, vv, u + dx, v + dy
end if
a = a xor 1
next
x = uu
y = vv
end select
m = sqr(x*x + y*y)
a = (pi + _atan2(y, x))/(2*pi)
pset (xx, yy), hrgb&(a, m)
next
next
sleep
next
system
function hrgb&(h, m)
r = 0.5 - 0.5*sin(2*pi*h - pi/2)
g = (0.5 + 0.5*sin(2*pi*h*1.5 - pi/2)) * -(h < 0.66)
b = (0.5 + 0.5*sin(2*pi*h*1.5 + pi/2)) * -(h > 0.33)
dim n as long
n = 16
mm = m*500 mod 500
p = abs((h*n) - int(h*n))
rr = 255*r - 0.15*mm - 35*p
gg = 255*g - 0.15*mm - 35*p
bb = 255*b - 0.15*mm - 35*p
if rr < 0 then rr = 0
if gg < 0 then gg = 0
if bb < 0 then bb = 0
hrgb& = _rgb(rr, gg, bb)
end function
function cosh(x)
cosh = 0.5*(exp(x) + exp(-x))
end function
function sinh(x)
sinh = 0.5*(exp(x) - exp(-x))
end function
'u + iv = (x + iy)*(a + ib)
sub cmul(u, v, xx, yy, aa, bb)
x = xx
y = yy
a = aa
b = bb
u = x*a - y*b
v = x*b + y*a
end sub
'u + iv = (x + iy)/(a + ib)
sub cdiv(u, v, xx, yy, aa, bb)
x = xx
y = yy
a = aa
b = bb
d = a*a + b*b
u = (x*a + y*b)/d
v = (y*a - x*b)/d
end sub