<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div dir="auto">
<div class="gmail_quote" dir="auto">
<div dir="ltr">I agree that a big python library is more close to the standard python lib than matlab. However, helping transition from matlab is a great concern in the python scientific community, because matlab is used is a lot of engineering classes at University.<br>
</div>
<div dir="auto">
<div dir="auto"><br>
</div>
<div dir="auto">That's a tough call hmmm.</div>
<div dir="auto"><br>
</div>
<div dir="auto">I'll look at the implementation of scipy.special.sindg and friends to see if/how they have optimisations for exact values.</div>
<br>
<br>
<div class="gmail_quote" dir="auto">
<div dir="ltr">Le dim. 10 juin 2018 à 16:44, Stephan Houben <<a href="mailto:stephanh42@gmail.com" target="_blank" rel="noreferrer">stephanh42@gmail.com</a>> a écrit :<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">2018-06-09 8:18 GMT+02:00 Robert Vanden Eynde <span dir="ltr"><<a href="mailto:robertvandeneynde@hotmail.com" rel="noreferrer noreferrer" target="_blank">robertvandeneynde@hotmail.com</a>></span>:<br>
<div class="gmail_extra">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div dir="auto">
<div dir="auto" style="font-family:sans-serif">
<div dir="auto">For the naming convention, scipy using sindg (therefore Nor sind nor sindeg) will make the sind choice less obvious. However if Matlab and Julia chooses sind that's a good path to go, Matlab is pretty popular, as other pointed out, with Universities
 giving "free" licences and stuff. With that regards, scipy wanting to "be a replacement to Matlab in python and open source" it's interesting they chose sindg and not the Matlab name sind.</div>
</div>
</div>
</div>
</blockquote>
<div><br>
</div>
<div><br>
</div>
<div>I would suggest that compatibility with a major Python library such as SciPy is more important than compatibility</div>
<div>with other programming languages. <br>
</div>
<div><br>
</div>
<div>I would go even further and argue that scipy.special.sindg and its friends cosdg and tandg</div>
<div>can serve as the reference implementation for this proposal.</div>
<div><br>
</div>
<div>Stephan<br>
</div>
<div><br>
</div>
<div> </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div dir="auto">
<div dir="auto" style="font-family:sans-serif">
<div dir="auto"><br>
</div>
<div dir="auto">For the "d" as suffix that would mean "d" as "double" like in opengl. Well, let's remember that in Python there's only One floating type, that's a double, and it's called float... So python programmers will not think "sind means it uses a python
 float and not a python float32 that C99 sinf would". Python programmers would be like "sin takes float in radians, sind takes float in degrees or int, because int can be converted to float when there's no overflow".</div>
</div>
</div>
<div>
<div class="m_2531008694271836856m_-6376361243199336500m_270045271228943444h5"><br>
<div class="gmail_quote">
<div dir="ltr">Le sam. 9 juin 2018 à 04:09, Wes Turner <<a href="mailto:wes.turner@gmail.com" rel="noreferrer noreferrer noreferrer" target="_blank">wes.turner@gmail.com</a>> a écrit :<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">
<div># Python, NumPy, SymPy, mpmath, sage trigonometric functions</div>
<div><a href="https://en.wikipedia.org/wiki/Trigonometric_functions" rel="noreferrer noreferrer noreferrer noreferrer" target="_blank">https://en.wikipedia.org/wiki/Trigonometric_functions</a><br>
</div>
<div><br>
</div>
<div>## Python math module</div>
<div><a href="https://docs.python.org/3/library/math.html#trigonometric-functions" rel="noreferrer noreferrer noreferrer noreferrer" target="_blank">https://docs.python.org/3/library/math.html#trigonometric-functions</a></div>
<div>- degrees(radians): Float degrees</div>
<div>- radians(degrees): Float degrees</div>
<div><br>
</div>
<div>## NumPy</div>
<div><a href="https://docs.scipy.org/doc/numpy/reference/routines.math.html#trigonometric-functions" rel="noreferrer noreferrer noreferrer noreferrer" target="_blank">https://docs.scipy.org/doc/numpy/reference/routines.math.html#trigonometric-functions</a><br>
</div>
<div>- degrees(radians) : List[float] degrees</div>
<div><span style="color:rgb(34,34,34);font-family:sans-serif;font-size:13px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">-
 rad2deg(radians): List[float] degrees</span><br>
</div>
<div>- radians(degrees) : List[float] radians</div>
<div>- deg2rad(degrees): List[float] radians</div>
<div><br>
</div>
<div><a href="https://docs.scipy.org/doc/numpy/reference/generated/numpy.sin.html" rel="noreferrer noreferrer noreferrer noreferrer" target="_blank">https://docs.scipy.org/doc/numpy/reference/generated/numpy.sin.html</a><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>## SymPy</div>
<div><a href="http://docs.sympy.org/latest/modules/functions/elementary.html#sympy-functions-elementary-trigonometric" rel="noreferrer noreferrer noreferrer noreferrer" target="_blank">http://docs.sympy.org/latest/modules/functions/elementary.html#sympy-functions-elementary-trigonometric</a><br>
</div>
<a href="http://docs.sympy.org/latest/modules/functions/elementary.html#trionometric-functions" rel="noreferrer noreferrer noreferrer noreferrer" target="_blank">http://docs.sympy.org/latest/modules/functions/elementary.html#trionometric-functions</a>
<div><br>
</div>
<div>- sympy.mpmath.degrees(radians): Float degrees</div>
<div>- sympy.mpmath.radians(degrees): Float radians</div>
<div><br>
</div>
<div>- <a href="https://stackoverflow.com/questions/31072815/cosd-and-sind-with-sympy" rel="noreferrer noreferrer noreferrer noreferrer" target="_blank">https://stackoverflow.com/questions/31072815/cosd-and-sind-with-sympy</a></div>
<div>  - cosd, sind</div>
<div>  - <a href="https://stackoverflow.com/questions/31072815/cosd-and-sind-with-sympy#comment50176770_31072815" rel="noreferrer noreferrer noreferrer noreferrer" target="_blank">https://stackoverflow.com/questions/31072815/cosd-and-sind-with-sympy#comment50176770_31072815</a></div>
<div><br>
</div>
<div>    > Let x, theta, phi, etc. be Symbols representing quantities in radians. Keep a list of these symbols: angles = [x, theta, phi]. Then, at the very end, use y.subs([(angle, angle*pi/180) for angle in angles]) to change the meaning of the symbols to
 degrees"<br>
<div><br>
</div>
<div><br>
</div>
<div>## mpmath</div>
<div><a href="http://mpmath.org/doc/current/functions/trigonometric.html" rel="noreferrer noreferrer noreferrer noreferrer" target="_blank">http://mpmath.org/doc/current/functions/trigonometric.html</a></div>
<div>
<div style="color:rgb(34,34,34);font-family:sans-serif;font-size:13px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial">
- sympy.mpmath.degrees(radians): Float degrees</div>
<div style="color:rgb(34,34,34);font-family:sans-serif;font-size:13px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial">
- sympy.mpmath.radians(degrees): Float radians</div>
<br>
</div>
<div><br>
</div>
<div>## Sage</div>
<div><a href="https://doc.sagemath.org/html/en/reference/functions/sage/functions/trig.html" rel="noreferrer noreferrer noreferrer noreferrer" target="_blank">https://doc.sagemath.org/html/en/reference/functions/sage/functions/trig.html</a><br>
</div>
</div>
</div>
<div><br>
</div>
<div><br>
<br>
On Friday, June 8, 2018, Robert Vanden Eynde <<a href="mailto:robertvandeneynde@hotmail.com" rel="noreferrer noreferrer noreferrer noreferrer" target="_blank">robertvandeneynde@hotmail.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div dir="auto">
<div>
<div dir="auto">- Thanks for pointing out a language (Julia) that already had a name convention. Interestingly they don't have a atan2d function. Choosing the same convention as another language is a big plus.</div>
<div dir="auto"><br>
</div>
<div dir="auto">- Adding trig function using floats between 0 and 1 is nice, currently one needs to do sin(tau * t) which is not so bad (from math import tau, tau sounds like turn).</div>
<div dir="auto"><br>
</div>
<div dir="auto">- Julia has sinpi for sin(pi*x), one could have sintau(x) for sin(tau*x) or sinturn(x).</div>
<div dir="auto"><br>
</div>
<div dir="auto">Grads are in the idea of turns but with more problems, as you guys said, grads are used by noone, but turns are more useful. sin(tau * t) For The Win.</div>
<div dir="auto"><br>
</div>
<div dir="auto">- Even though people mentionned 1/6 not being exact, so that advantage over radians isn't that obvious ?</div>
<div dir="auto"><br>
</div>
<div dir="auto">from math import sin, tau</div>
<div dir="auto">from fractions import Fraction</div>
<div dir="auto">sin(Fraction(1,6) * tau)</div>
<div dir="auto">sindeg(Fraction(1,6) * 360)</div>
<div dir="auto"><br>
</div>
<div dir="auto">These already work today by the way.</div>
<div dir="auto"><br>
</div>
<div dir="auto">- As you guys pointed out, using radians implies knowing a little bit about floating point arithmetic and its limitations. Integer are more simple and less error prone. Of course it's useful to know about floats but in many case it's not necessary
 to learn about it right away, young students just want their player in the game move in a straight line when angle = 90.</div>
<div dir="auto"><br>
</div>
<div dir="auto">- sin(pi/2) == 1 but cos(pi/2) != 0 and sin(3*pi/2) != 1 so sin(pi/2) is kind of an exception.</div>
<div dir="auto"><br>
</div>
<div dir="auto"><br>
</div>
<br>
<br>
<div class="gmail_quote">
<div dir="ltr">Le ven. 8 juin 2018 à 09:11, Steven D'Aprano <<a href="mailto:steve@pearwood.info" rel="noreferrer noreferrer noreferrer noreferrer" target="_blank">steve@pearwood.info</a>> a écrit :<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Fri, Jun 08, 2018 at 03:55:34PM +1000, Chris Angelico wrote:<br>
> On Fri, Jun 8, 2018 at 3:45 PM, Steven D'Aprano <<a href="mailto:steve@pearwood.info" rel="noreferrer noreferrer noreferrer noreferrer noreferrer" target="_blank">steve@pearwood.info</a>> wrote:<br>
> > Although personally I prefer the look of d as a prefix:<br>
> ><br>
> > dsin, dcos, dtan<br>
> ><br>
> > That's more obviously pronounced "d(egrees) sin" etc rather than "sined"<br>
> > "tanned" etc.<br>
> <br>
> Having it as a suffix does have one advantage. The math module would<br>
> need a hyperbolic sine function which accepts an argument in; and<br>
> then, like Charles Napier [1], Python would finally be able to say "I<br>
> have sindh".<br>
<br>
Ha ha, nice pun, but no, the hyperbolic trig functions never take <br>
arguments in degrees. Or radians for that matter. They are "hyperbolic <br>
angles", which some electrical engineering text books refer to as <br>
"hyperbolic radians", but all the maths text books I've seen don't call <br>
them anything other than a real number. (Or sometimes a complex number.)<br>
<br>
But for what it's worth, there is a correspondence of a sort between the <br>
hyperbolic angle and circular angles. The circular angle going between 0 <br>
to 45° corresponds to the hyperbolic angle going from 0 to infinity.<br>
<br>
<a href="https://en.wikipedia.org/wiki/Hyperbolic_angle" rel="noreferrer noreferrer noreferrer noreferrer noreferrer noreferrer" target="_blank">https://en.wikipedia.org/wiki/Hyperbolic_angle</a><br>
<br>
<a href="https://en.wikipedia.org/wiki/Hyperbolic_function" rel="noreferrer noreferrer noreferrer noreferrer noreferrer noreferrer" target="_blank">https://en.wikipedia.org/wiki/Hyperbolic_function</a><br>
<br>
<br>
> [1] Apocryphally, alas.<br>
<br>
Don't ruin a good story with facts ;-)<br>
<br>
<br>
<br>
-- <br>
Steve<br>
_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org" rel="noreferrer noreferrer noreferrer noreferrer noreferrer" target="_blank">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer noreferrer noreferrer noreferrer noreferrer noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer noreferrer noreferrer noreferrer noreferrer noreferrer" target="_blank">
http://python.org/psf/codeofconduct/</a><br>
</blockquote>
</div>
</div>
</div>
</div>
</blockquote>
</div>
_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org" rel="noreferrer noreferrer noreferrer noreferrer" target="_blank">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer noreferrer noreferrer noreferrer noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer noreferrer noreferrer noreferrer noreferrer" target="_blank">
http://python.org/psf/codeofconduct/</a><br>
</blockquote>
</div>
</div>
</div>
</div>
<br>
_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org" rel="noreferrer noreferrer" target="_blank">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer noreferrer noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer noreferrer noreferrer" target="_blank">
http://python.org/psf/codeofconduct/</a><br>
<br>
</blockquote>
</div>
<br>
</div>
</div>
_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org" rel="noreferrer noreferrer" target="_blank">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer noreferrer noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer noreferrer noreferrer" target="_blank">
http://python.org/psf/codeofconduct/</a><br>
</blockquote>
</div>
</div>
</div>
</div>
</body>
</html>