[Tutor] Over-riding radians as default for trig calculations

Hugo Arts hugo.yoshi at gmail.com
Sun Feb 28 21:07:58 CET 2010


On Sun, Feb 28, 2010 at 8:39 PM, AG <computing.account at googlemail.com> wrote:
> After importing the math module and running
>
> math.cos( x )
>
> the result is in radians.
>
> Is there a way of setting this so that it results in degrees?  I don't want
> to over-ride this permanently for my Python settings, so am happy to
> specifically do it per equation or per program.
>
> Thanks in advance.
>

There is no setting to override, but you could easily define your own
function to do a conversion for you. The wikipedia page on radians
explains how to convert between the two, and writing a function to do
that should be quite trivial.

Hugo


More information about the Tutor mailing list