Steven D'Aprano wrote:
Even
old-school scientific calcuators without the fancy CAS symbolic maths
are capable of having cos(90) return zero in degree mode.
FWIW, my Casio fx-100 (over 30 years old) produces exactly 1 for
both sin(90°) and sin(pi/2) for its version of pi.
--
Greg
_
Chris Angelico wrote:
The math module would
need a hyperbolic sine function which accepts an argument in;
Except that the argument to hyperbolic trig functions is
not an angle in any normal sense of the word, so expressing
it in degrees makes little sense.
(However I do like the idea of a func
Stephen J. Turnbull wrote:
Since Pi is irrational, Pi/4 is too, so it
definitely cannot be represented. Making a correction to a number
that "looks like" Pi/4 is against this philosophy.
I'm not sure what all the fuss is about:
>>> from math import pi, sin
>>> sin(pi/2)
1.0
>>> sin(pi/2 + 2 *
On Fri, Jun 08, 2018 at 02:37:33PM +0900, Stephen J. Turnbull wrote:
> My bias is that people who want to program this kind of thing just
> need to learn about floating point numbers and be aware that they're
> going to have to accept that
>
> >>> from math import cos, radians
> >>> cos(radians(9
On Thu, Jun 07, 2018 at 10:39:06PM -0400, Richard Damon wrote:
> First I feel the need to point out that radians are actually fairly
> fundamental in trigonometry, so there is good reasons for the base
> functions to be based on radians. The fact that the arc length of the
> angle on the unit circ
On Fri, Jun 8, 2018 at 3:45 PM, Steven D'Aprano wrote:
> Although personally I prefer the look of d as a prefix:
>
> dsin, dcos, dtan
>
> That's more obviously pronounced "d(egrees) sin" etc rather than "sined"
> "tanned" etc.
Having it as a suffix does have one advantage. The math module would
n
On Fri, Jun 08, 2018 at 08:17:02AM +1000, Hugh Fisher wrote:
> But I think that the use of
> radians in programming language APIs is more prevalent, so the initial
> advantage
> of easy learning will be outweighed by the long term inconvenience of
> adjusting to what everyone else is doing.
But
On Thu, Jun 7, 2018 at 10:38 PM Stephen J. Turnbull <
turnbull.stephen...@u.tsukuba.ac.jp> wrote:
>
> 6.123233995736766e-17
> >>>
>
> is good enough for government work, including at the local public high
> school.
>
>
There probably is room for a library like "fractions" that represents
multiples
Richard Damon writes:
> To make it so that sindeg/cosdeg of multiples of 90 come out exact is
> probably easiest to do by doing the angle reduction in degrees (so the
> nice precise angles stay as nice precise angles) and then either adjust
> the final computation formulas for degrees, or conv
Richard Damon wrote:
First I feel the need to point out that radians are actually fairly
fundamental in trigonometry,
Even more so in calculus, since the derivative of sin(x)
is cos(x) if and only if x is in radians.
--
Greg
___
Python-ideas mailing
On 6/7/18 7:08 PM, Robert Vanden Eynde wrote:
> - I didn't know there were sinf in C (that's since C99), I was aware
> of the 'd' postfix in opengl.
>
> So yeah, sind would be a bad idea, but sindeg or degsin would be too
> long, hmm, and I can settle for the Pre or Post fix. sindeg(90)
> degsin(90
- I didn't know there were sinf in C (that's since C99), I was aware of the
'd' postfix in opengl.
So yeah, sind would be a bad idea, but sindeg or degsin would be too long,
hmm, and I can settle for the Pre or Post fix. sindeg(90) degsin(90) are
both pretty, the first emphasize on the "degree" pa
> Date: Thu, 7 Jun 2018 12:33:29 +
> From: Robert Vanden Eynde
> To: python-ideas
> Subject: [Python-ideas] Trigonometry in degrees
> Message-ID:
> >
> I suggest adding degrees version of the trigonometric functions in the math
> module.
>
> - Useful in Teaching and replacing calcula
On Thu, Jun 7, 2018 at 1:07 PM Robert Vanden Eynde <
robertvandeney...@hotmail.com> wrote:
> I suggest adding degrees version of the trigonometric functions in the
> math module.
>
>
You can create a pypi package that suits your needs. If it becomes popular
it could considered for inclusion in the
You meant math.radians(degrees), and Robert already mentioned the problem
with this:
>>> math.cos(math.radians(90))
6.123233995736766e-17
On Thu, 7 Jun 2018 at 16:22 Ryan Gonzalez wrote:
> You could always do e.g. math.sin(math.degress(radians)) and so forth...
>
> On June 7, 2018 3:07:21 PM Ro
You could always do e.g. math.sin(math.degress(radians)) and so forth...
On June 7, 2018 3:07:21 PM Robert Vanden Eynde
wrote:
I suggest adding degrees version of the trigonometric functions in the math
module.
- Useful in Teaching and replacing calculators by python, importing
something
I suggest adding degrees version of the trigonometric functions in the math
module.
- Useful in Teaching and replacing calculators by python, importing something
is seen by the young students much more easy than to define a function.
- Special values could be treated, aka when the angle is a mu
For closure, I've added a package, timeliterals
(env) [pgdr@hostname ~]$ pip install timeliterals
(env) [pgdr@hostname ~]$ python
>>> from timeliterals import *
>>> 3*hours
datetime.timedelta(0, 10800)
>>> 3*minutes
datetime.timedelta(0, 180)
>>> 3*seconds
datetime.timedelta(0, 3)
The source code
18 matches
Mail list logo