We are about to switch to a new forum software. Until then we have removed the registration on this forum.
So what I have currently is basically this:
float time = millis()/100;
line(cx,cy,cx+cos(time)(radius0.72),cy+sin(time)(radius0.72));
(repurposed from this clock code) https://processing.org/examples/clock.html
Now, I'm confused on how to 'limit' the motion of the line to a certain arc (like a real metronome).
now what I'm considering is to use an if function to reverse the motion of the 'pendulum' at a certain interval but I have no idea how to even begin to approach that. Or is there an easier function?
Answers
First suggestion:
There are lots of great "pendulum" discussions in the forums for simple examples:
Second suggestion:
This may be a bit advanced if you aren't yet using objects and classes, but here are some different ways of configuring a pendulum based on a shared class:
http://Studio.ProcessingTogether.com/sp/pad/export/ro.9yPdCEFDrKsJH
Beautiful effect, @GoToLoop.
It's not my code: https://Forum.Processing.org/two/discussion/5795/pendula#Item_4
All my posted code got references from which forum post they come from. ;)