Re: New proposal for math.e

new topic     » goto parent     » topic index » view thread      » older message » newer message

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

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu