Skip to main content
GameDev.net gamedev.net
🔒 Locked

a pendulum problem

Started by LordG Oct 17, 2004 at 2:11 AM 4 replies 1.1k views
Original Post
LordG
LordG
Hi, I'm having trouble trying to come up with a rotation matrix that transforms a pendulum at a particulur time. So let's say I want to animate a clock pendulum located at the origin with the pendulum weight hanging down vertically (-Y axis) in the XY plane. The pendulum swings through k radians from end to end, this takes m seconds. The pendulum is at one extreme at k/2 radians at time t = 0. One swing of the pendulum is defined by the function sin(a), where -pi/2 <= a <= pi/2 Now the problem is what is the rotation matrix that would give the the transformation of the pendulum at any given time t, to animate the oscillating pendulum. Can anyone help me out? [Edited by - LordG on October 17, 2004 4:11:49 PM]
LilBudyWizer
LilBudyWizer
Assuming you don't want a mathematically correct pendulum you could use a function similar to pi/2*cos(2*t*pi/m) to produce the angle. That will at least get it to swing back and forth.
Keys to success: Ability, ambition and opportunity.
LordG
LordG
No, I don't really care if the pendulum is mathematically correct.

Thanks LilBudyWizer, I think that equation you gave is what I needed.

[Edited by - LordG on October 17, 2004 9:53:32 PM]
grhodes_at_work
grhodes_at_work
For small angles, e.g., the pendulum swing back and forth maybe +/- 5 degrees, the sin/cos formulas are pretty darned close to reality. This is provable based on linearization of the governing equations of motion.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.