|
Post by marshawn on Mar 11, 2022 18:17:48 GMT
H$ = "gr" global pi, u, v, zoom pi = 4*atn(1) sw = 1024 sh = 640 c = 800 zoom = 300
nomainwin WindowWidth = sw WindowHeight = sh sh2 = (sh)/2 sw2 = (sw)/2 UpperLeftX = 300 UpperLeftY = 40
open "Lines drawn between Justice and Liberty" for graphics_nsb_nf as #gr
#gr "trapclose quit" #gr "down" #gr "fill white"
#gr "color black"
for yy=0 to sh-32 step 2 for xx=0 to sw-8 step 2 scan x0 = xx - sw2 y0 = sh2 - yy
x = x0/zoom y = y0/zoom
p = 1 q = 0
'call cdiv x + 1, y, x - 1, y for j=0 to 5 call cmul 1, 0, 0-0.4, 0-0.18*(j - 2.1) uu = u vv = v call cmul p, q, x - uu - 0.2, y - vv p = u q = v call cdiv u, v, x - uu + 0.2, y - vv + 0.1 p = u q = v next for j=0 to 2 call cmul 1, 0, 0.4, 0-0.18*(j - 2.1) - 0.18*2.1/2 uu = u vv = v call cdiv p, q, x - uu - 0.2, y - vv p = u q = v call cmul u, v, x - uu + 0.2, y - vv + 0.1 p = u q = v next
'xp = atan2(v, u)/(pi/3) 'yp = log(1 + c*sqr(u*u + v*v))
h = atan2(v, u)/(2*pi) m = log(1 + 100*sqr(u*u + v*v)) 'm = sqr(u*u + v*v)
'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)) r = 1: g = 1: b = 1 mm = m*5000 mod 500 n = 16 p = ABS((h * n) - INT(h * n)) rr = 255 * r - 75 * p - 0.15*mm gg = 255 * g - 75 * p - 0.15*mm bb = 255 * b - 75 * p - 0.15*mm IF rr < 0 THEN rr = 0 IF gg < 0 THEN gg = 0 IF bb < 0 THEN bb = 0 #gr "color ";rr;" ";gg;" ";bb #gr "set ";xx;" ";yy
'x = xp 'y = yp 'z = (abs(c*x) mod c) < (c/2) xor (abs(c*y) mod c) < (c/2) ' 'if (x>0 and y>0) or (x<0 and y<0) then ' if z<>0 then #gr "color black" else #gr "color white" ' if z<>0 then #gr "set ";xx;" ";yy 'else ' if z=0 then #gr "set ";xx;" ";yy ' if z<>0 then #gr "color white" else #gr "color black" 'end if
#gr "set ";xx;" ";yy next next
#gr "color black" #gr "backcolor black" '''diagram a = 0-pi/2 x = sw2/zoom + 0.2*cos(a) - 0.4 y = sh2/zoom + 0.18*sin(a) + (a*0.18*0.5/pi) - 2.1*0.18 for t=x to 0 step 0-0.001 #gr "place ";(x-t)*zoom;" ";y*zoom #gr "circlefilled 2"; next for a = 0-pi/2 to 5*2*pi + 2*pi + pi/2 step 0.01 x = sw2/zoom + 0.2*cos(a) - 0.4 y = sh2/zoom + 0.18*sin(a) + (a*0.18*0.5/pi) - 2.1*0.18 #gr "place ";x*zoom;" ";y*zoom #gr "circlefilled 2"; next a = 5*2*pi + 2*pi + pi/2 x = sw2/zoom + 0.2*cos(a) - 0.4 y = sh2/zoom + 0.18*sin(a) + (a*0.18*0.5/pi) - 2.1*0.18 for t=x to 0 step 0-0.001 #gr "place ";(x-t)*zoom;" ";y*zoom #gr "circlefilled 2"; next ''' a = 0-pi/2 x = sw2/zoom - 0.2*cos(a) + 0.4 y = sh2/zoom + 0.18*sin(a) + (a*0.18*0.5)/pi - 2.1*0.18 + 0.18*2.1/4 for t=0 to 1.5 step 0.001 #gr "place ";(x+t)*zoom;" ";y*zoom #gr "circlefilled 2"; next for a = 0-pi/2 to 2*2*pi + 2*pi + pi/2 step 0.01 x = sw2/zoom - 0.2*cos(a) + 0.4 y = sh2/zoom + 0.18*sin(a) + (a*0.18*0.5)/pi - 2.1*0.18 + 0.18*2.1/4 #gr "place ";x*zoom;" ";y*zoom #gr "circlefilled 2"; next a = 2*2*pi + 2*pi + pi/2 x = sw2/zoom - 0.2*cos(a) + 0.4 y = sh2/zoom + 0.18*sin(a) + (a*0.18*0.5)/pi - 2.1*0.18 + 0.18*2.1/4 for t=0 to 1.5 step 0.001 #gr "place ";(x+t)*zoom;" ";y*zoom #gr "circlefilled 2"; next
#gr "flush" wait
sub quit Hdl$ close #Hdl$ end end sub
function atan2(y,x) 'tsh version has scan built-in 'pi = acs(-1) 'could be made global to save some ticks if x <> 0 then arctan = atn(y/x)
select case case x > 0 atan2 = arctan
case y>=0 and x<0 atan2 = pi + arctan
case y<0 and x<0 atan2 = arctan - pi
case y>0 and x=0 atan2 = pi / 2
case y<0 and x=0 atan2 = pi / -2 end select end function
'u + iv = (x + iy)(a + ib) sub cmul 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 xx, yy, aa, bb x = xx y = yy a = aa b = bb d = a*a + b*b if d<>0 then u = (x*a + y*b)/d v = (y*a - x*b)/d else u = 0 v = 0 end if end sub
|
|
|
Post by marshawn on Mar 11, 2022 19:24:00 GMT
for impatient and impartial
|
|
|
Post by plus on Mar 11, 2022 21:24:04 GMT
Well I'm convinced!
How long did the screen shot above take to build?
|
|
|
Post by marshawn on Mar 12, 2022 9:18:56 GMT
14 billion years!
|
|
|
Post by Rod on Mar 12, 2022 16:49:13 GMT
Ha! Evolution is a wonderful thing.
|
|