frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Turns are Better than Radians

https://www.computerenhance.com/p/turns-are-better-than-radians
19•mayoff•2h ago

Comments

mayoff•1h ago
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.

math-man•43m ago
It's because both radians and degrees are are a ratio of a length to another length and are thus dimensionless. No matter how you measure it, all angles are without a unit.

It's most obvious with radians but it's also the case with degrees.

Using radians, you are guaranteed to not introduce unusual extra terms to rescale angles, if you use any other scale of angle you will have to keep track of extra terms.

That may be useful in whatever you're doing. I work in degrees quite often and I'm careful to keep track of the 2pi/360 terms that crop up all over the place. With grade measure you have to keep track of 2pi/400 terms and with turns you have to keep track of 2pi/1 terms that will repeatedly show up.

Again, depending on what you're doing, this may or may not make sense to do.

In general, mathematics works out easier when the scaling term is 2pi/2pi because then you have a lovely 1 scale factor you don't have to keep track of.

eru•21m ago
Agreed. Though sometimes it's useful to keep track of 'fake' units like for angles, to make something like dimensional analysis work for you.

But that's more for analysis of your code / formulas than when you actually go and compute things.

jp57•50m ago
Or you could use 1/360 of a turn.
chabska•47m ago
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.
sriku•40m ago
You'll have to bring in the 2π factor somewhere. Cant escape it. If sint is the sin function but with angle give in turns, then d/dx sint(x) = 2π cost(x). sin(x) ~ x for small x but sint(x) ~ 2πx for small x.
slwvx•44m ago
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)

eru•19m ago
Well, they don't produce the same result in floating point math, I'm afraid.

So you'd need to teach your compiler about what your formulas mean and what context you are using them in. (Ie are you actually doing geometry, or is your AI coding agent just trying arbitrary activation functions for your neuronal net experiments and some of them happen to look like geometry?)

zahrevsky•39m ago
> It turns out (pun intended!)

Thanks, I was waiting for this pun the moment turns were introduced in the article.

traes•31m ago
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•29m ago
The title should say (2022)
groundzeros2015•19m ago
Fails to mention that radians relates angle to arc length.
WCSTombs•6m ago
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•6m 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.

OpenRouter is joining Stripe

https://openrouter.ai/blog/announcements/openrouter-is-joining-stripe/
696•rvz•10h ago•363 comments

Go 1.27

https://go.dev/blog/go1.27
491•database64128•9h ago•130 comments

Google replaced Git tags for certain source code with obtaining via Google Drive

https://grapheneos.social/@GrapheneOS/117057099753905023
343•Animux•9h ago•147 comments

Manabu Kosaka's Handmade Paper Sculptures

https://coca11272000.wixsite.com/manabukosaka
56•surprisetalk•13h ago•7 comments

Turns are Better than Radians

https://www.computerenhance.com/p/turns-are-better-than-radians
23•mayoff•2h ago•15 comments

Unlocking a locked/deactivated e-waste Cricut Maker

https://sprocketfox.io/xssfox/2026/07/01/cricut-unlock/
155•1e1a•8h ago•37 comments

A joke domain purchase turned in geopolitical warfare

https://sprocketfox.io/xssfox/2026/08/19/sondehub-and-war/
789•kareiva•16h ago•122 comments

Unsloth Dynamic 3.0 GGUFs

https://unsloth.ai/docs/basics/dynamic-3.0-ggufs
199•jonesy827•9h ago•79 comments

A faster way to calculate the day of the week

https://www.benjoffe.com/fast-day-of-week
20•gavide•3d ago•4 comments

Casio F-B100W-1A

https://www.casio.com/uk/watches/casio/product.F-B100W-1A/
295•__fst__•12h ago•240 comments

Sol Loves to Cheat

https://jumploops.com/blog/sol-loves-to-cheat/
90•jumploops•1d ago•58 comments

Why travellers are obsessed with foreign supermarkets

https://www.bbc.com/travel/article/20260811-the-supermarket-is-becoming-a-tourist-attraction
44•edward•3d ago•39 comments

Os8088.com: IBM XT OS now has a Browser, CP/M 2.2 with Z80 core and MS Word 1.1a

https://os8088.com/spotlight/
57•jggonz•6h ago•31 comments

Geolocating a random island using geometry and CUDA programming

https://yassa9.github.io/osint/gralhix-004/
422•yassa9•15h ago•77 comments

Simulacra and Simulation

https://en.wikipedia.org/wiki/Simulacra_and_Simulation
36•soupspaces•1w ago•11 comments

The little-known winstart.bat batch file

https://devblogs.microsoft.com/oldnewthing/20260811-00/?p=112605
86•ingve•4d ago•23 comments

PostgreSQL for Everything

https://www.raphaelbauer.com:443/posts/postgresql-everything/
320•karlmush•14h ago•198 comments

Feature Request: Support AGENTS.md

https://github.com/anthropics/claude-code/issues/6235
156•fg137•6h ago•86 comments

Launch HN: OneCLI (YC S26) – OSS sandboxed agent harness for teams

https://github.com/onecli/onecli
60•guyb3•11h ago•17 comments

fx :Tiny, open, native coding agent.

https://fx.sh
198•handfuloflight•1d ago•93 comments

DFlash 2: Keep Drafting Parallel

https://inco.ai/blog/dflash2/
77•mike-the-brain•7h ago•9 comments

Mathematics in the age of AI

https://arxiv.org/abs/2608.16753
128•jonbaer•12h ago•148 comments

Ornith-1.5: From Self-Scaffolding to Self-Improvement

https://ornith.ai/ornith_1_5.html
176•CommonGuy•12h ago•60 comments

Pressed Penny Machine Map

https://pennypresses.net/home/map.php
55•willmeyers•7h ago•45 comments

Xorshift Generators

https://www.alanzucconi.com/2026/08/15/xorshift-generators/
55•tobr•4d ago•35 comments

Universality of Gradient Descent Neural Network Training

https://arxiv.org/abs/2007.13664
13•E-Reverance•3h ago•2 comments

Air Theremin – A browser theremin you play by waving at your webcam

https://theremin.bizibah.com/
256•gurov•17h ago•86 comments

Extensible Software in the age of LLMs

https://jeremymorrell.dev/blog/extensible-software-in-the-age-of-llms/
119•coloneltcb•11h ago•50 comments

Pacing model development in an era of cyber-critical capabilities

https://openai.com/index/pacing-model-development-cyber-capabilities/
136•j4mie•1d ago•182 comments

How do payments work in the US, China, and Brazil?

https://andrewacomb.substack.com/p/a-tale-of-three-refunds
20•acombandrew•1w ago•3 comments