Top
Best
New

Posted by mayoff 10 hours ago

Turns are Better than Radians (2022)(www.computerenhance.com)
235 points | 113 commentspage 3
rajnathani 7 hours ago|
Dumb question: For multiplying for smaller turns such as 1 arc-second (1,296,000 in 1 turn), that would floating point precision issues be a tiny slight issue (22619.4671 arc-seconds in 2pi radians), or is it just a coding convention change?
fooker 6 hours ago||
The floating point expressions needed to represent the math library functions with decent precision and performance becomes significantly more weird and complex with turns.

Please stick to radians.

andrepd 6 hours ago|
Posit arithmetic requires not only sin(x), but also sin(2πx), correctly rounded that is. I wish IEEE floats had that as well.

https://posithub.org/docs/posit_standard-2.pdf

ttoinou 5 hours ago||
Even better : did you know (-1)^x draws the unit circle in the complex plane ? No need for complex exp and i*pi
WCSTombs 2 hours ago||
You do in fact need the complex exponential to define this correctly because the function a^x for nonintegers x is only unambiguously defined when a is a positive real number. For example, your function could be either e^(pi i x) or e^(-pi i x), which trace the circle in opposite directions as x varies over the reals. (They happen to agree when x is an integer.)
ttoinou 1 hour ago||
I agree. I just meant the 2D function cos(pix),sin(pix) is quite natural to work with and it can be reflected easily in the formulation of (-1)^x
srean 5 hours ago|||
That's because

   a^b = exp (b ln  a)
That's equivalent to saying, no need for -1 because we have exp.

One can change based of the exponentiation operation. Exp happens to be a convenient base.

ttoinou 1 hour ago||
Yeah bad formulation on my part
srean 1 hour ago||
Not bad at all, just equivalent.
ttoinou 22 minutes ago||
We do need complex exp to define my formula, you’re right
fph 4 hours ago||
If you plot it over which domain?
ttoinou 1 hour ago||
Complex domain
djmips 5 hours ago||
In the old days of making 8 bit video games we used BRADs of 0-255 - worked well and the wrap was easy.
burnt-resistor 4 hours ago|
Oh yeah, in the era of ¼ circle trig tables (cos and maybe tan; inverse (arc) versions as needed) in ROM or Taylor/Maclaurin approximation (with fast integer division) when FPUs were rare. Such tables and tricks mostly fell by the wayside when the 80486DX, 68040, and N64 (VR4300) arrived and SIMD/MIMD systems followed.

I miss strict, deterministic unsigned addition overflow. In many modern languages, all kinds of verbose hoops are required to get this behavior and there's a chance it will generate terrible machine code.

smallstepforman 7 hours ago||
Are there any c/c++ libs / headers that use this (without converting to radians in the background). I like this idea.
teo_zero 4 hours ago|
The C standard defines the functions sinpi(), cospi(), etc. that act on half-turns. If you have a modern compiler, all you have to do is to include math.h
groundzeros2015 9 hours ago||
Fails to mention that radians relates angle to arc length.
HWR_14 8 hours ago|
There are valid reasons to prefer radians, especially in calculus. The fact that it's related to arc length is something that never (directly) comes up.
groundzeros2015 8 hours ago||
Every part of calculus with trig functions relies on this fact! The rate of motion along a circle is approximately linear at the same speed when described in radians.

For example when you do a Taylor series expansion the cos/sin are well approximated by x.

HWR_14 8 hours ago||
That's why I put "directly" in my original post. All the nice functions in calculus rely on that fact, but that fact itself is almost never used or useful by itself .

If I were writing the article I would focus on the benefits for derivatives and integration and other things that are slipping my mind at the moment. I wouldn't waste time going down the rabbit hole of why.

At least not for an article aimed at this type of audience.

groundzeros2015 7 hours ago||
Your awareness of a key relationship does not make it irrelevant. It happens all the time in math.

the article acts like radians are arbitrary without discussing this key property.

ethanlipson 8 hours ago||
I think the author is either being disingenuous or doesn’t understand the subject if they don’t honestly address the reason radians are used in the first place. I’m leaning towards the latter, because I can’t imagine someone having an ulterior motive for pushing for trig reform like this, lol. Radians really are the natural unit for trigonometry. With that said, I certainly agree that a lot of code would be simplified by using turns over radians, especially outside the context of numerical methods. I could see myself supporting the addition of sint(x) and cost(x) functions to the math standard library, where sint = “sine turns”.

While not a strict rule, Chesterton’s fence is a good heuristic: before we change something, we should first attempt to understand why it is the way it is.

teo_zero 3 hours ago||
You might have misunderstood TFA. No push for trig reform, just a consideration on what internal representation is optimal in code.

Imagine it like someone suggesting (understandably) that you express memory sizes in hex: no push to make everybody stop using decimal numbers!

srean 3 hours ago||
> Radians really are the natural unit for trigonometry.

s/trigonometry/calculus

stephenlf 7 hours ago||
I was hoping for some code examples but got none. Can anyone help?
Juliate 6 hours ago||
> There are many implementations of sin, but no matter which one you look at…

I’ve had a brief moment of hope, forgetting the point was about mathematics.

otikik 3 hours ago|
Indeed, this is what Pico-8 uses for its trigonometric functions[1] (angles go from 0 to 1, instead of from 0 to 2*Pi). I was surprised by this at first, but then I found it is very convenient and simplifies a bunch of stuff.

http://pico8wiki.com/index.php?title=Sin

More comments...