Turns are Better than Radians (2022)

mayoff 108 points 50 comments August 20, 2026
www.computerenhance.com · View on Hacker News

Discussion Highlights (20 comments)

mayoff

I like to store angles as turns in my own code, because (as noted) it makes quarter-turns computable without rounding. OTOH if you need, say, twelfths of a turn, you might want to just store angles as degrees since that’s already common. Michael Spivak, in Calculus (3rd ed p. 301) considers the unit choice to be a property of the function and initially defines sin° and sinʳ (before settling on sin meaning sinʳ) and considers “sin x°” and “sin x radians” to be misleading, saying that ‘a number x is simply a number—it does not carry a banner indicating that it is “in degrees” or “in radians”’. I don’t really understand this argument, since in science and engineering we constantly carry units around with our quantities.

jp57

Or you could use 1/360 of a turn.

chabska

The problem is that trigonometric functions are used in many more fields beyond geometry. The input is not always an angle around a point in euclidean space, it could be phase angle of a periodic signal. You can make an alternative set of trig functions that take turns, but you will anger a lot of people if you mess with the vanilla trig functions.

slwvx

Yes, the idea of a turn [1] is interesting. And maybe useful. I have a different question: What would it take for a compiler to remove (elide) the multiply by pi + divide by pi that the author uses as an example? I guess one would not have to go as far as a Lean proof that two bits of code produce the same result? [1] https://en.wikipedia.org/wiki/Turn_(angle)

zahrevsky

> It turns out (pun intended!) Thanks, I was waiting for this pun the moment turns were introduced in the article.

traes

Very bold title! Turns are very convenient until you need to calculate a rate of change, as of course d/dx sin(2pi x) = 2pi cos(2pi x). Unfortunately this is a common enough problem that I will be sticking with the radian.

traes

The title should say (2022)

groundzeros2015

Fails to mention that radians relates angle to arc length.

WCSTombs

I think I cautiously agree with this notion to some extent, but IMHO the real answer is that it's application-dependent, and if you're writing a low-level trig library and you have to pick one or the other, it really isn't clear to me that turns should win over radians. I expect many systems that use trigonometry would sometimes use small-angle approximations either for efficiency or to bootstrap to the general case. It'd be natural to use Taylor series here, i.e.: cos(x) = 1 - x^2/2 + ... sin(x) = x - x^3/6 + ... If you've committed to representing all trigonometry in "turn" units, then you instead need to use: cos(2 pi t) = 1 - (2 pi t)^2/2 + ... sin(2 pi t) = (2 pi t) - (2 pi t)^3/6 + ... In this case it would be less accurate and efficient to force everything into turns if you ever need to work with radians. Closely related to this, if you ever need the derivative of a function that does trig (e.g., in numerical optimization), you may as well use radians because if you don't, any extra factors you apply will appear in the expressions for the derivatives and you'll have to deal with them there anyway. Basically for that reason, it's pretty clear that trigonometry in terms of radians is the "correct" convention mathematically speaking (away from computers), since derivatives of the radian-based trig functions are so easy to express. Given that, if we have to pick one convention...isn't it less confusing to use the same thing everywhere? That said, there are interfaces that provide both versions, and since as the article points out there are cases where the turn-based versions can be more efficient, that's probably the right way to go.

ethanlipson

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.

oliculipolicula

Maybe related Hamilton's theory of turns revisited https://arxiv.org/abs/0904.4787

zarzavat

> But math never decreed that sine and cosine have to take radian arguments! If you don't use radians you have to add to add conversion factors everywhere to do calculus. Radians are the natural unit for sin/cos just as E is the natural base of the logarithm and exponential functions.

em3rgent0rdr

And could use fixed-point decimal for more efficiency since can store as integers and use integer hardware for them. So for instance with 32-bits, the 16 most-sig bits store the number of turns and the 16 least-significant bits store the fraction of a turn. Then if you want to wrap angles that exceed 360 degrees back around the circle, you can simply Logical_AND with 0x0000FFFF. And while you are at it, you could just use fixed-point decimal for sine and cos, whereby the maximum of +1 or -1 map to the most positive and most negative integer value. These type of optimizations were common before FPUs were cheap and fast.

stephenlf

I was hoping for some code examples but got none. Can anyone help?

kens

One weird unit for angles is the mil, defined as 6400 mils in a circle. This unit is very useful for artillery, since 1 meter displacement at a distance of 1 km is 1 mil [†]. Thus, you can see how much you missed by, divide by the distance, and easily determine how much you need to adjust your aim in mils. Another interesting thing about artillery is they traditionally do a binary search to get the distance correct, which they call "bracketing". Link: https://unitedtaskforce.net/training/sop/communication/artil... [†] Note that this isn't exactly correct since it corresponds to pi = 3.2. A mil is almost the same as a milliradian, but 6400 mils in a circle is much more convenient than 6283.18... milliradians in a circle.

smallstepforman

Are there any c/c++ libs / headers that use this (without converting to radians in the background). I like this idea.

thrtythreeforty

Here's another good reason to think in turns: it turns Euler's formula from this Eldritch Terror: e^(i*x) = cos(x) + i*sin(x) into something you can kinda understand by staring at the complex plane: -1^(2x) = cost(x) + i*sint(x) Credit to justinpombrio for this: https://news.ycombinator.com/item?id=32986869

mattmcal

I argued this idea to a couple of my classmates when I was a physics undergrad, and they agreed. However, I later changed opinions because of what this does to the derivatives/integrals of your trig functions. For general periodic functions, [0, 1) is a good domain. But circles and spheres are geometric objects, and radians/steradians are geometrically significant units that are well suited for general purposes. I do remember that Doom uses an interesting alternative representation where an angle is a u16 multiple of `(2 * pi) / 65536`. Fixed point is sometimes a good choice in games and simulations due to having uniform precision.

rajnathani

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?

nyc111

Norman Wildberger has an alternative system for trigonomtry: Understanding uniform motion: are radians really necessary? | WildTrig https://youtu.be/CnQXRdgN_7I?si=EiYY99i6mBOIyczI Wild Trig: An introduction to Rational Trigonometry https://youtube.com/playlist?list=PLIljB45xT85CyF_7bKd6y36VA...

Semantic search powered by Rivestack pgvector
4,128 stories · 37,281 chunks indexed