Re: New proposal for math.e
- Posted by Derek Parnell <ddparnell at ?igpond.c?m> Aug 03, 2007
- 543 views
Colin Taylor wrote: > Very nice. First I would suggest adding a constant RADIANS = > 57.29577951308232158 > and modifying radians_to_degrees() and degrees_to_radians() as follows: > > }}} <eucode> > > global function radians_to_degrees (object x) > return x * RADIANS > end function > > global function degrees_to_radians (object x) > return x / RADIANS > end function > > </eucode> {{{ Good suggestion. And even better would be to avoid the division as well.
constant RADIANS_DEGREES = 57.29577951308232158 constant DEGREES_RADIANS = 0.017453292519943296 global function radians_to_degrees (object r) return r * RADIANS_DEGREES end function global function degrees_to_radians (object d) return d * DEGREES_RADIANS end function
-- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell