[Python-ideas] Fwd: Trigonometry in degrees

Chris Barker chris.barker at noaa.gov
Mon Jun 11 16:18:10 EDT 2018

On Mon, Jun 11, 2018 at 10:24 AM, Michael Selik <mike at selik.org> wrote:

> Would sind and cosd make Euler's formula work correctly?

Not trying to pick on you, but this question shows a key misunderstanding:

There is nothing inherently more accurate in using degrees rather than
radians for trigonometry. IT's nice that handy values like "one quarter of
a circle" can be exactly represented, but that's really only an asthetic

And every computer math lib I've even seen uses floating point radians for
trig functions, so unless you're really going to implement trig from
degrees from scratch, then you are going to go to floating point radians
(and floating point pi) anyway.

Oh, and radians are the more "natural" units (in fact unitless) for math,
and the only way that things like the Euler identity work. Which is why
computational math libs use them.

So there are two orthogonal ideas on the table here:

1) Have trig functions that take degrees for convenience for when folks are
working in degrees already.

2) Have trig functions that produce exact values (i.e what is "expected")
for the special cases.

It seems the OP is interested in a package that combines both of these --
which is a fine idea as a third party lib.

Perhaps you'd prefer an enhancement to the fractions module that provides
> real (not float) math?

Isn't that exactly what the fractions module does? or are you suggesting
that it be extended with trig functions ?



Christopher Barker, Ph.D.

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20180611/7c783c67/attachment-0001.html>

More information about the Python-ideas mailing list