getting the max. elongation of a pendulum

Hi,

I’m currently working on a presentation for school about Galileo Galilei’s experiments about kinetics. One of those were based on Galilei’s study of a pendulum, and he discovered that the time the pendulum needs to swing from one side to the other remains the same while speed and elongation decrease. I’d like to demonstrate this in the Game Engine and therefore want to “.get” the max. elongations (for each oscillation) of the pendulum with a py-Script, so I can print a timer-variable value each time this happens to show that Galileo (hopefully:)) was right.
All my attempts to solve this problem didn’t work:o, so I hope somebody can share his/her wisdom with me.

Thanks in advance,
Jay-D

Be carefull with such “simulations”, this is a game engine not a physics simulation. It is supposed to look realistic. But it is NOT realistic. It is not the purpose of the game engine physics to follow the real physics.

For a demonstration it should be good enough. What you could do is to check each frame for the getLinearVelocity() or getAngularVelocity to change its direction (e.g. from +X to -X). Measure the time and store the position. When the object changes the direction again, you can compare the new time and new position with the old time and old Position. The differences should be that what you want.

I hope it helps

I thought Galileo’s observation about pendulums was wrong anyway?