[Bf-python] Good old euler problem

Stephen Swaney sswaney at centurytel.net
Wed Feb 21 18:40:27 CET 2007


n Wed, Feb 21, 2007 at 08:29:42AM -0800, Martin Poirier wrote:
> No constants please.
> 
> If people want to multiply by a constant, they can
> define it themselves.
> 
> If we have to provide anything, it should be a
> function.

The Python math module already has degree() and radian()
functions for conversion.

The idea of having an internal state flag in Euler for setting
units is clever, but seems overly complicated.  If passed as an
argument, you would need to test the Euler obj before you could use
it.  It also becomes One More Thing to keep track of when coding.

You could hide some complexity by creating EulerDegree and EulerRadian
wrapper classes, but then we have 3 classes to manage  rather than one
and we are getting complicated again.

I think the simplest, most consistant solution is to use radians
everywhere.  

If we need to convert to/from degrees for presentation layer things
like a GUI, we can provide our own convenience methods and
constructors in addition to the degrees() and radians() in the math
module.

-- 
Stephen Swaney			
sswaney at centurytel.net
231-228-7370



More information about the Bf-python mailing list