[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Bouncing ball - separating the physics from the frame rate




On Dec 3, 2007, at 12:30 PM, Ian Mallett wrote:

On 12/3/07, Matt Smith <matt@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
if it bounces a couple of times inside one
time-frame) (http://hyperphysics.phy-astr.gsu.edu/hbase/ hframe.html for a good physics reference, also, choose radians, steer away from degrees
http://en.wikipedia.org/wiki/Sine)
Yep, and if you want to do trig functions in Python with the 'Math'
module with degrees, you must convert to radians.
math.cos(math.radians(blah))
math.degrees(math.cos(blah))

Except that the output of sine/cos is not an angle, thus calling math.degrees() on it makes little sense. Honestly I find it easier to just use radians all the time rather than convert back and forth, except for a few pygame methods that take degrees...

-Casey