Nice pattern guys ;-) ;-)
Here is my experiment
defdbl a-z
const sw = 1024
const sh = 768
pi = 4*atn(1)
screen _newimage(sw, sh, 32)
line (0,0)-(sw,sh),_rgb(0,0,0),bf
a = sh
bplus sw/2, sh/2, a, 0, _rgb(50,0,0), _rgb(0,0,0)
c = 1.5
n = 7
for i=2 to n
a = sh/(i^(c*c))
for j=0 to 2000
x = sw/2 - a*(i^(c*c))/2 + a*(i^(c*c))*rnd
y = sh/2 - a*(i^(c*c))/2 + a*(i^(c*c))*rnd
rot = 2*pi*rnd'*(i - 1)
bplus x, y, a, rot, _rgb(50 + (i-1)*205/n,0,0), _rgb(50,0,0)
next
next
sleep
system
sub bplus (x0, y0, a, rot, cc as _integer64, cp as _integer64)
p = 50/400
q = 20/400
dim img as long
img = _newimage(a, a, 32)
_dest img
line (0,0)-(a,a),cp,bf
for y=0 to a - 1
for x=0 to a - 1
if (((x + p*a)^2 + (y - a/2)^2) > a*a*(q + 0.5)^2) and (((x - a - p*a)^2 + (y - a/2)^2) > a*a*(q + 0.5)^2) or (((y + p*a)^2 + (x - a/2)^2) > a*a*(q + 0.5)^2) and (((y - a - p*a)^2 + (x - a/2)^2) > a*a*(q + 0.5)^2) then pset (x, y), cc
next
next
dim tl as long, tr as long, bl as long, br as long
dim r as integer, g as integer, b as integer
yes = 1
a2 = a*(sqr(2) - 0.5)
_dest 0
for y=-a2 to a + a2
for x=-a2 to a + a2
xx = (x - a/2)*cos(rot) - (y - a/2)*sin(rot) + a/2
yy = (x - a/2)*sin(rot) + (y - a/2)*cos(rot) + a/2
if (xx >= 0 and xx < a-1 and yy >= 0 and yy < a-1) then
_source img
if point (xx, yy) <> cp then
_source 0
if point(x0 - a/2 + x, y0 - a/2 + y) <> cp then yes = 0
end if
end if
next
next
if yes then
_dest 0
for y=-a2 to a + a2
for x=-a2 to a + a2
xx = (x - a/2)*cos(rot) - (y - a/2)*sin(rot) + a/2
yy = (x - a/2)*sin(rot) + (y - a/2)*cos(rot) + a/2
if (xx >= 0 and xx < a-1 and yy >= 0 and yy < a-1) then
_source img
if int(xx) > a-1 or int(yy) > a-1 then tl = cp else tl = point(int(xx), int(yy))
if int(xx) > a-1 or int(yy) > a-1 or int(xx)+1 > a-1 then tr = cp else tr = point(int(xx) + 1, int(yy))
if int(xx) > a-1 or int(yy) > a-1 or int(yy)+1 > a-1 then bl = cp else bl = point(int(xx), int(yy) + 1)
if int(xx) > a-1 or int(yy) > a-1 or int(xx)+1 > a-1 or int(yy)+1 > a-1 then br = cp else br = point(int(xx) + 1, int(yy) + 1)
dx = xx - int(xx)
dy = yy - int(yy)
r = _round((1 - dy)*((1 - dx)* _red(tl) + dx* _red(tr)) + dy*((1 - dx)* _red(bl) + dx* _red(br)))
g = _round((1 - dy)*((1 - dx)*_green(tl) + dx*_green(tr)) + dy*((1 - dx)*_green(bl) + dx*_green(br)))
b = _round((1 - dy)*((1 - dx)* _blue(tl) + dx* _blue(tr)) + dy*((1 - dx)* _blue(bl) + dx* _blue(br)))
if point (xx, yy) <> cp then pset (x0 - a/2 + x, y0 - a/2 + y), _rgb(r,g,b)
end if
next
next
end if
_freeimage img
end sub