[ODE] XODE - should angles be in degrees or radians?

William Denniss lists at omegadelta.net
Sat Mar 20 10:07:32 MST 2004


We should be able to read and write floats to ASCII text and back
accurately.  The limiting factor is more the float precision of the
actual programs used (for example if there was a difference in precision
between ODE and an Editor then we may have some loss).

Maybe we really do need both representations.  As discussed, radians are
superior for serializing an ODE scene as they are "native" to ODE, but
editors (including just using a text editor) tend to use degrees for
human readability and precision.

Considering the fact that converting between degrees and radians is so
ridiculously simple - would dual support really be a burden?

Cheers,

Will.


On Sat, 2004-03-20 at 04:02, Bob Dowland wrote:
> > > But, not being able to store things like right angles precisely, 
> > > would seem like a bit of a showstopper for a geom/phys file format. 
> > 
> > I believe this argument is a fallacy. The reason is that ODE, 
> > internally, uses radians, so even if you can "store" a 90 degree angle 
> > precisely, as soon as you "load" that into ODE, it's no longer exact.
> > 
> 
> You're absolutely right! More to the point, when you save back out, that precise 90 degrees is toast (well lightly toasted anyway).
> 
>  - I was imagining a scenario in which a file containing a radian represented (90 degree) angle is opened and closed so often that it eventually corrupts itself. But, in fact, this could be far worse with a degree (ie non-"native") representation. 
> 
> Focusing on our 90 degree angle we could be seeing:
> 
> open file: 90 degrees -> (pi/2 + epsilon) rads
> save file: (pi/2 + epsilon) rads -> (90 + moreepsilon) degrees
> open file: (90 + moreepsilon) degrees -> (pi/2 + evenmoreepsilon) rads
> 
> and so on... 
> 
> 	So in fact you could potentially corrupt the degrees representation by just opening and close/saving the file - oops!
> 
> Theres still the bin<->dec conversion for floats but we get that with either format.
> 
> Bob.
> 

-- 
William Denniss - will@ http://tanksoftware.com/



More information about the ODE mailing list