05-17-2022, 11:23 PM
While we're here, here is another:
Code: (Select All)
_Title "Easy Spiral" 'b+ 2022-04? from Easy Lang site very Interesting! https://easylang.online
' this one inspired Johnno to post at RCBasic, https://rcbasic.freeforums.net , also an interesting site!
Screen _NewImage(700, 700, 32)
_ScreenMove 300, 100
pi = _Pi: s = 7
Do
Cls
For c = 1 To 3000 '1320
h = c + tick
x = Sin(6 * h / pi) + Sin(3 * h)
h = c + tick * 2
y = Cos(6 * h / pi) + Cos(3 * h)
fcirc s * (20 * x + 50), s * (20 * y + 50), 2, &HFFFFFFFF
Next
_Display
_Limit 120
tick = tick + .001
Loop Until _KeyDown(27)
'from Steve Gold standard
Sub fcirc (CX As Long, CY As Long, R As Long, C As _Unsigned Long)
Dim Radius As Long, RadiusError As Long
Dim X As Long, Y As Long
Radius = Abs(R): RadiusError = -Radius: X = Radius: Y = 0
If Radius = 0 Then PSet (CX, CY), C: Exit Sub
Line (CX - X, CY)-(CX + X, CY), C, BF
While X > Y
RadiusError = RadiusError + Y * 2 + 1
If RadiusError >= 0 Then
If X <> Y + 1 Then
Line (CX - Y, CY - X)-(CX + Y, CY - X), C, BF
Line (CX - Y, CY + X)-(CX + Y, CY + X), C, BF
End If
X = X - 1
RadiusError = RadiusError - X * 2
End If
Y = Y + 1
Line (CX - X, CY - Y)-(CX + X, CY - Y), C, BF
Line (CX - X, CY + Y)-(CX + X, CY + Y), C, BF
Wend
End Sub
b = b + ...