QB64 Phoenix Edition
Radian Ferris Wheel - Printable Version

+- QB64 Phoenix Edition (https://staging.qb64phoenix.com)
+-- Forum: QB64 Rising (https://staging.qb64phoenix.com/forumdisplay.php?fid=1)
+--- Forum: Code and Stuff (https://staging.qb64phoenix.com/forumdisplay.php?fid=3)
+---- Forum: Programs (https://staging.qb64phoenix.com/forumdisplay.php?fid=7)
+---- Thread: Radian Ferris Wheel (/showthread.php?tid=1108)

Pages: 1 2


RE: Radian Ferris Wheel - james2464 - 11-12-2022

Thanks. I was reading the game tutorial, this part specifically: https://www.qb64tutorial.com/lesson19


RE: Radian Ferris Wheel - PhilOfPerth - 11-13-2022

(11-12-2022, 04:20 PM)bplus Wrote:
Quote:I had a go a while back at explaining what pi was, using a "circular" shape with increasing numbers of arcs, from 3 to 1000, and summing the lengths of the arcs until they reached 6.28... but I eventually gave up (temporarily?).

Maybe someone cleverer than me will do this (hint, hint)?


Pi is a ratio of the diameter of a circle to the circumference of a circle: d * Pi = circumference
since radius is 1/2 diameter 2 * r * Pi = circumference

If radius is 1, a unit circle they call it, the radian measure = the circumference of the arc
A unit circle (360 degrees) has  2 *Pi circumference ( 2 * 1 * Pi)
Half a unit circle (180 degrees) has Pi circumference (2 * Pi * 1/2)
1/4 unit circle (90 degrees) has Pi/2 circumference as is Pi/2 radians ( 2 * Pi * 1/4)

so 1/n unit circle is 2 * Pi * 1/n radians.
Thanks bplus. You've encouraged me to "have another go".
I sorta knew most of that, but hadn't quite worked out how to apply which bits for my prog. You cleared the cloud a little.  Smile


RE: Radian Ferris Wheel - johannhowitzer - 11-16-2022

You can put this function around any angle in radians, and it will simplify it to be at least zero, and less than 2pi.

function simplify_angle(a)
threesixty = 8 * atn(1)
x = -a / threesixty
if x <> int(x) then x = x + 1
simplify_angle = a + (int(x) * threesixty)
end function


RE: Radian Ferris Wheel - bplus - 11-16-2022

Welcome @johannhowitzer

Weren't you at old forum?


RE: Radian Ferris Wheel - johannhowitzer - 11-16-2022

Yes, I'm the same person. I lurk quietly, checking out programs here and there, mostly grinding away at my own big project and frequently referring to the wiki.