' ScriptBasic GFX - Curlicue Fractal
IMPORT gfx.inc
s = gfx::Window(1200,700,"Script BASIC SDL_gfx - Curlicue Fractal")
ts = gfx::Time()
a = 0
f =0
x =0
y = 0
f = 0
x1 = 0
x2 = 0
y1 = 0
ang = 0
r = 500
FOR a = 0 TO 400000
ang = ang + 0.0001
If ang > 7 Then ang = 0
f = f - PI * PI
x = x + Cos(f * f)
y = y + Sin(f * f)
x1 = x + r + Cos(RAD(ang)) * r / 8
y1 = y + r + Sin(RAD(ang)) * r / 8
x2 = r - Cos(RAD(ang)) * r / 8 - x
PRINT "x1: ",x1,"\n"
PRINT "y1 - 500: ",y1 - 500,"\n"
PRINT "a: ",a,"\n"
PRINT "x: ",x,"\n"
PRINT "y: ",y,"\n"
LINE INPUT wait
' gfx::PixelRGBA s, ABS(INT(x1)), ABS(INT(y1 - 500)), ABS(INT(a)), ABS(INT(x)), ABS(INT(y)), 255
' gfx::PixelRGBA s, INT(x2), INT(y1 - 500), INT(a), INT(x), INT(y), 255
NEXT
te = gfx::Time()
gfx::stringColor s, 20, 15, "Time: " & FORMAT("%.4f",(te-ts)/1000) & " Seconds." & CHR(0), 0xFFFFFFFF
gfx::Update
WHILE gfx::KeyName(1) <> "+escape"
WEND
gfx::Close