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

Re: [pygame] Physics module status note



Hi there, Hugo!

Yes, using radians in math-related softare is common, but not in games.
It will simply add a call the math.degrees for every call and to increment
the angle you'd have to convert it back, or be forced to use radians
in the game. If you're drawing using OpenGL or any rotational
transformations it will be a lot of calls. I see it as more comfortable when 
the angles use degrees since graphic drawing is more common than in a game
than asin/atan calls.
It will also be a miniscule performance enhancenment to do this in C
rather than Python which will add up if you do this conversion many times
for each polygon you draw. :)

So, it's more comfortable to use degrees and it's better suited for use with 
graphic libraries, which mostly use degrees, including 
pygame.transform.rotate.

/Peter

On 2008-08-15 (Fri) 15:39, Hugo Arts wrote:
> most of python's math functions like asin en atan (from math) return
> their values in radians, and sin and tan take their arguments as
> radians. So using radians is more common than degrees.
> Conversion is also pretty trivial, using math.radians and math.degrees.
> 
> Hugo
> 
> On Fri, Aug 15, 2008 at 6:53 AM, Peter Gebauer
> <peter.gebauer@xxxxxxxxxxxxxxxxxxxxx> wrote:
> > Hi!
> >
> > Hm, I've been experimenting a bit now and I wonder about the
> > body.rotation, it's using radians. Wouldn't it make more sense to use
> > degrees in the API for all angle values?
> >
> > On 2008-08-14 (Thu) 21:35, Marcus von Appen wrote:
> >> On, Thu Aug 14, 2008, Peter Gebauer wrote:
> >>
> >> [...]
> >> > Too early for a wishlist? :)
> >>
> >> No, but do not expect it to be implemented within the next days
> >> ;-). We'd be happy to discuss and put your wishes on the TODO list.
> >>
> >> Regards
> >> Marcus
> >
> >
> >
>