Spiro - A Simulation
#3
Ashish started the thread with this:
Code: (Select All)
' 2022-05-10 Attempt to restore Ashish QB64 Spirograph from a SmallBASIC translation of it

'Coded By Ashish Kushwaha
' signature  "if (Me.Success) {Me.Improve();} else {Me.TryAgain();}"
_Title "Spirograph"
Screen _NewImage(700, 700, 32)
Type spirals
    x As Single
    y As Single
    rad As Single
    ang As _Float
End Type
Dim Shared spiral(10) As spirals

spiral(0).x = _Width / 2
spiral(0).y = _Height / 2
spiral(0).rad = 160 'confused with SB radian function I will use .r
stroke~& = _RGB(80, 80, 80) 'I guess this is color setting
Do
    Cls , _RGB(230, 230, 230)
    Circle (spiral(0).x, spiral(0).y), spiral(0).rad, stroke~&
    spiral(0).ang = spiral(0).ang + .01
    For i = 1 To UBound(spiral)
        spiral(i).x = Cos(spiral(i - 1).ang) * spiral(i - 1).rad + spiral(i - 1).x
        spiral(i).y = Sin(spiral(i - 1).ang) * spiral(i - 1).rad + spiral(i - 1).y
        spiral(i).rad = spiral(i - 1).rad / 1.5
        spiral(i).ang = spiral(i - 1).ang * 1.5
        Circle (spiral(i).x, spiral(i).y), spiral(i).rad, stroke~&
    Next
    _Display
    _Limit 60
Loop

Which reminds me allot of Sprezzo's efforts of circles within circles... only he did pendulums.
[Image: image-2022-05-10-120941153.png]
b = b + ...
Reply


Messages In This Thread
Spiro - A Simulation - by TarotRedhand - 05-10-2022, 07:02 AM
RE: Spiro - A Simulation - by bplus - 05-10-2022, 03:37 PM
RE: Spiro - A Simulation - by bplus - 05-10-2022, 04:09 PM
RE: Spiro - A Simulation - by bplus - 05-10-2022, 04:56 PM
RE: Spiro - A Simulation - by aurel - 05-10-2022, 06:22 PM
RE: Spiro - A Simulation - by bplus - 05-10-2022, 06:30 PM
RE: Spiro - A Simulation - by bplus - 05-10-2022, 06:38 PM
RE: Spiro - A Simulation - by aurel - 05-10-2022, 06:38 PM
RE: Spiro - A Simulation - by bplus - 05-10-2022, 06:44 PM
RE: Spiro - A Simulation - by bplus - 05-10-2022, 08:22 PM
RE: Spiro - A Simulation - by bplus - 05-10-2022, 08:59 PM
RE: Spiro - A Simulation - by bplus - 05-10-2022, 09:05 PM
RE: Spiro - A Simulation - by johnno56 - 05-11-2022, 04:20 AM
RE: Spiro - A Simulation - by TarotRedhand - 05-11-2022, 06:44 AM



Users browsing this thread: 3 Guest(s)