11-11-2022, 11:58 PM
I was messing around with radians and ended up making this. Cheers.
Code: (Select All)
'radian ferris wheel
'james2464 - Nov 11 2022 - Radian Ferris Wheel
Screen _NewImage(800, 600, 32)
Const PI = 3.141592654#
Dim c(2) As Long
c(1) = _RGB(50, 255, 100)
c(2) = _RGB(0, 100, 0)
'origin
xx = 400
yy = 300
w = 120 'wheel radius
p = 10 'number of positions
'=====================================================
h = _Hypot(w, 0)
h1 = _Atan2(0, w)
'=====================================================
Do
_Limit 30
Cls
Circle (xx, yy), w, c(2)
Line (xx, yy)-(xx - 50, yy + w + 40), c(1)
Line (xx, yy)-(xx + 50, yy + w + 40), c(1)
Line (xx - 50, yy + w + 40)-(xx + 50, yy + w + 40), c(1)
h1 = h1 + .002
If h1 >= PI * 2 Then h1 = 0
'-------------------------------------------------
For t = 1 To p
h2 = h1 + ((PI * 2) / p) * t
x = Cos(h2) * h: y = Sin(h2) * h
x2 = Cos(h2) * (h * 1.5): y2 = Sin(h2) * (h * 1.5)
Line (xx, yy)-(xx + x, yy + y), c(2)
Line (xx + x - 7, yy + y)-(xx + x + 7, yy + y), c(1)
Line (xx + x, yy + y)-(xx + x, yy + y + 15), c(1)
Line (xx + x - 7, yy + y + 15)-(xx + x + 7, yy + y + 25), c(1), B
Locate 35 * ((yy + y2 + 50) / 600), 99 * ((xx + x2) / 800)
If h2 >= PI * 2 Then h2 = h2 - PI * 2
Print Using "#.##"; h2
Next t
_Display
Loop