clock simulation has bugs
Cecilia Lucía Gigena shared this question 1 year ago
I've downloaded this code:
And I wanted to make some changes (see attachment)
I put an input for "hours", and it correctly sets the hour hand. But also need to set the minutes hand. I took the hours hand code and multiplied it by 60... I don't get what I am doing wrong, but it is only working for SOME minutes, not all. 1,25 h sets correctly 1:15, 1,5 h sets correctly 1:30... but when I tried other decimals it kind of not recognize them and graphs something else. I want to show my students that 0,30 hs is NOT 30 minutes, and that's not working with this file.
never mind, I found the bug
the formula was *12, not *60
B=Rotate(A_2, -Mod(p, 100) * 2π, P)
To add time code hhmm try
If(p > 99, Rotate(A, -2 π (floor(p / 100) + Mod(p, 100) / 60) / 12, P), Rotate(A, -(360°) p / 12, P))
If(p > 99, Rotate(A_2, (-Mod(p, 100)) / 60 * 2π, P), Rotate(A_2, -Mod(p, 100) * 2π, P))
Comments have been locked on this page!