[Bf-python] Good old euler problem

Martin Poirier theeth at yahoo.com
Thu Feb 22 19:13:54 CET 2007


--- Joseph Gilbert <jgilbert at tigr.ORG> wrote:

> Converting Euler to radians so that it is in line
> with python's math  
> library is a great idea. However, it's internal
> functions will then expect  
> radians only. Therefore, this just moves the ball
> instead of fixing the  
> problem.
> 
> Example:
> myeuler.Unique()
> 
> This expect degrees to be loaded into the euler. 
> Load it with radians and  
> it will calculate the wrong answer. Most likely this
> is also the case with  
> Euler.toMatrix(), Euler.toQuat().
> The Euler needs to define how it is constructed so
> we know we are working  
> with radians or degrees.
> 
> e = Euler(1,2,3)
> m = Euler.toMatrix()
> 
> was e in radians or degrees? The calculation of the
> matrix probably  
> depends on knowing this.
> I would not like to add a caveat to the Euler module
> saying "Please use  
> radians or this class will give you bad answers".
> 
> Splitting out the Euler class into a Radians and
> Degrees version with a  
> conversion between the two seems like the simplest
> solution.

No, the simplest solution is defining that all angle
values returned and accepted by the API must be in
radians. This is also in line with Python's math
module and with mathematics in general.

Anything else is just complicating matters for no
reason (IMHO).

Martin


 
____________________________________________________________________________________
Expecting? Get great news right away with email Auto-Check. 
Try the Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html 



More information about the Bf-python mailing list