Turns are Better than Radians (2022) (computerenhance.com)

215 points by mayoff 9 hours ago

beeforpork 2 minutes ago

Well, \tau vs \pi is a question of taste, but 1 vs. \tau (or \pi) is not. Because you don't get rid of these weird constants, because \pi (or \tau) is, as a fact, in the circumference and area of circles and in surface and volume of spheres, and in other places. There jus is a weird constant.

And for APIs, you could reasonably well have turns or radians or degrees or even percentage of turns, whatever -- it depend on the context what is 'better'. What's really missing, I think, is the support of units in programming languages (in the type system) so that you cannot mess up when invoking sin()/cos(), because you would be forced to provide a unit.

kazinator 3 hours ago

The math is definitely not fine with turns, because your Euler formula e^ix = cos x + i sin x no longer holds. We can use a base other than e, namely B = e^2pi which around 535.4916. This doesn't have the nice e properties like d/dx e^x = e^x.

The elegant fact that the base of the natural logarithm, which produces an exponential function that is its own derivative, also shows up as the basis for the above Euler's formula, shows that radians are special: like what binary is to computers.

The natural logarithm being its own derivative is in fact directly linked to the derivative a radians-based sin(x) being cos(x) and so on. Make it any other unit, and you have a mess of conversion factors worse than 2pi.

Imagine complex chained derivatives, double and triple derivative, chain and product rules, all stuffed with trig functions and generating gratuitous piles of cascaded conversion constrants because radians were not used.

x2rj an hour ago

Also with radians the differential equation x''''(t)=x(t) has {exp(t), exp(-t), sin(t), cos(t)} as the (real) canonical base for its solution space. And x''(t)=-x(t) gets {sin(t), cos(t)} where they even result from the simplest possible (non-trivial) initial conditions (x(0)=0,x'(0)=1 and x(0)=1,x'(0)=0).

If you look at all the simplest differential equations you can think of, the sin(t)/cos(t) functions in radians are almost inevitable independent from their geometric usage.

walrus01 an hour ago

I can only imagine what a ridiculous problem it would be to try to re-do, for example, the Vincenty formula for distance between two latitude/longitude points on an oblate spheroid (the earth) if it couldn't use radians.

https://en.wikipedia.org/wiki/Vincenty%27s_formulae

https://www.johndcook.com/blog/2018/11/24/spheroid-distance/

Further, inverse vincenty is pretty much an essential in anything that needs to find the azimuth between two points on a map. Such as for microwave radio link planning purposes.

Karney (2013) is also radian dependent.

https://github.com/pbrod/karney

smallstepforman 2 hours ago

For graphics rendering Euler equation doesnt matter. Colours are 0.0-1.0 and have no relation to reality, but it works. Same with rotations (if we’re not using Quaternikns)

ogogmad 2 hours ago

In another comment, I asked why people chose to use the symbol τ over just writing turn or "rev(olution)" (defined to be the constant ≈ 6.28318530718) given how unambiguous the latter is as a name for 2π. And why not just write sinrev() or sinturn(), and leave the symbols sin() and rev (defined to be ≈ 6.28318530718) alone?

robertlagrant 32 minutes ago

simiones an hour ago

The naming is irrelevant here. The point is that sin(x) ~ x for small x, whereas sinrev(x) ~ rev * x for small x, which is much uglier. And similar things happen to the derivative of sinrev() vs regular sin() and so on. So switching to preferring to express angles in revs instead actually complicates most formulas, at least in some domans.

WCSTombs 7 hours 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.

mlyle 7 hours ago

The time where "turns" are really great is when a whole lot of what you're doing is a phase accumulator.

Analemma_ 7 hours ago

I don't have a super-wide gamut of experience here and numerical analysis isn't my specialty, but nearly all trig implementations I've looked into (in both software and hardware) make heavy use of lookup tables and other shortcuts. I've never seen a Taylor series used in a general implementation - not saying it doesn't exist anywhere, but in most cases that I'm familiar with you could support turns just as easily with a different lookup table.

jcranmer 6 hours ago

If you're being technical, it's usually not a Taylor series, it's a minimax series. (The difference is that Taylor series minimize error at a given value, whereas minimax is trying to minimize maximum error in a range).

In most general math library implementations (e.g., the library in glibc, musl, etc.), the implementation of sin, as with most functions, is going to be a polynomial evaluation. See, e.g., https://github.com/kraj/musl/blob/kraj/master/src/math/__cos... for the implementation in musl, or https://github.com/bminor/glibc/blob/master/sysdeps/ieee754/... for glibc's implementation.

Of course, if you're not using a standard math library implementation, you're probably preferring speed over accuracy, and so you might use a lookup table and linear interpolation to get a very coarse approximation instead.

cryo32 3 hours ago

I have used the Taylor series approximations to produce the LUT over a defined interval. This may be generated pre-complication or at startup with a defined precision depending on the destination signed type.

Tend to use radians because we're moving from written proofs or simulations into embedded code in such systems. The code needs to read and work the same as those.

WCSTombs 5 hours ago

I've used Taylor series in numerical optimization. A function we were implementing needed to be differentiable (for automatic differentiation), but its definition had a special case, so we used a couple terms of the Taylor series in the special case.

edit: Sorry, to clarify, this was a function involving trigonometry but not simply vanilla sine or cosine. However, angular values being represented in radians did help in the same way I described in the parent post.

cyberax 2 hours ago

Our favorite WebAssembly is an example! It specifically excludes trigonometry from the spec, because real hardware doesn't produce exactly the same results.

So mathematical libraries in WASM reimplement the trigonometric functions using series.

Example: https://github.com/WebAssembly/wasi-libc/blob/2e6fb9d8ee0cdf...

mayoff 9 hours 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.

jameshart 6 hours ago

You generally can’t apply functions to dimensional units. The only thing units can do is be multiplied or divided together. So I can multiply a mass by a distance or divide a distance by a speed, and I can multiply the result by a scalar; but I can’t take the sine of a distance or the logarithm of a time or exponentiate a mass. Those are things I can only do to scalars.

‘But wait!’ You may cry: ‘the formula for a transverse wave varies with the sine of a distance!’

To which I would say no: it varies with the sine of a distance (the horizontal displacement), divided by another distance (the wavelength), divided by 2pi. The distances cancel out and leave a scalar. The sine is taken of that pure scalar; it results in a pure scalar; and then it’s multiplied by another distance (the amplitude) to give you a vertical displacement. Sine is a pure function.

Something else to consider is that the way we combine units with scalars to create dimensional quantities is through multiplication - and it’s not like there’s a simple formula for what a sine of a product is - I can’t determine sin(ab) in terms of sines or other functions of a and b. So if, say, a ‘degree’ were some dimensional unit, sin(90°) would not be something I could calculate - despite knowing sin(90) I don’t know sin(°) - whatever that would mean - and even if I did it gets me no closer to figuring out sin(90°)

Realizing that ° is just a mathematical constant equal to pi/180 solves a lot here.

setopt 4 hours ago

> You generally can’t apply functions to dimensional units. The only thing units can do is be multiplied or divided together. So I can multiply a mass by a distance or divide a distance by a speed, and I can multiply the result by a scalar; but I can’t take the sine of a distance or the logarithm of a time or exponentiate a mass. Those are things I can only do to scalars.

I mostly agree with your explanation, but would like to emphasize that this is just a convention from mathematics which mostly carries over into physics and engineering. We like to define functions that are R -> R and similar, instead of defining special sets like R° = { r * 360° | r \in R }, corresponding to "real numbers with unit degrees", and then defining functions like sin: R° -> R. It’s just simpler to define and analyze most functions from R -> R and so we mostly do that.

But if you look up physics papers, it’s not uncommon to define functions that require unitful inputs as well. For example, the wave function in the Schrödinger equation maps a position r (3D vector with unit meter) and time t (scalar with unit seconds), to a probability amplitude (complex number with unit m^-3/2), so that \int |ψ(r,t)|^2 d3r becomes a scalar (a probability). Up wave function is still considered a function by all physicists.

hasley 5 hours ago

I basically agree, at least for standard functions like sin, cos, tan, exp etc. It is even possible to see mistakes in equations just by checking that all the units to standard functions cancel out making the arguments dimensionless.

On the other hand I am still unhappy with calling the ratio of two quantities, that happen to have the same units, "dimensionless". This way, you could create any two "dimensionless" quantities and try to compare them or use one in place of the other which might be meaningless.

cubefox 3 hours ago

thaumasiotes 4 hours ago

You can apply functions to anything. That's the only thing "function" means. They transform values into other values, and there is no limit on what kind of values you might want to talk about.

cozzyd 6 hours ago

Well you can also square root etc.

cubefox 3 hours ago

> You generally can’t apply functions to dimensional units.

Perhaps not in mathematics, but in programming that's clearly possible. I guess programming is more general than mathematics.

simiones an hour ago

podocarp an hour ago

math-man 8 hours 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.

srean 4 hours ago

It is dimensionless by fiat and convention. It clearly has units such as degrees, grad and radians. Just like other quantities that have units, a specific measurement is expressed as a pure numerical multiple of an unit which may be radians, degrees etc.

This is a known wrinkle in dimensional analysis and people have considered making angles a fundamental quantity such as mass, length and time but have not done so because of the disruption it would cause.

More details here

https://en.wikipedia.org/wiki/Radian#Dimensional_analysis

https://en.wikipedia.org/wiki/Angle#Dimensional_analysis

lioeters 20 minutes ago

eru 7 hours 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.

dahart 5 hours ago

> all angles are without a unit.

Dimensionless, sure, but what do you mean here? Radians and degrees are units, are they not?

thyristan 4 hours ago

srean an hour ago

Rather than sin(), cos() and motion on a circle it is fun to consider uniform speed motion along the perimeter of a regular polygon and its projection hor() and ver() along horizontal and vertical directions.

You can parameterized the motion in terms of the time T to complete one period and consider it's horizontal (or vertical) shadow at any t mod T.

This is related to DFT. As one increases the number of vertices of the regular polygon we will recover sin and cos in the limit. 2 \pi will show up in the ratio of the distance covered in one period of the uniform speed motion and the extents of the projected motion.

Another interesting (and fundamental) construction is to forget about circles and polygons entirely. Simply consider a periodic function over a bounded length L. Consider first the discrete case where the domain is divided into k parts. We want to find an orthonormal basis for all nicely behaved (smooth) periodic functions on this domain.

But there are infinitely many orthonormal basis sets for periodic functions on this domain. We are free to choose any. One choice is that adjacent values do not have large adjacent differences. This can be measured by squared adjacent differences. We choose that basis set that minimizes this quantity.

For the discrete case we recover DFT basis and taking limits carefully we end up with sinusoids.

\Pi will show up because of the requirement of orthonormality.

traes 7 hours 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.

HWR_14 7 hours ago

I feel like that approximates how I learned math. In geometry or trig you can use degrees or turns or any other unit, but almost never radians because that's harder write. As soon as you learn calculus, you switch to radians and never go back.

chabska 8 hours 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.

jameshart 6 hours ago

When dealing with waves you often are dealing with turns - or, as they’re called in that world, cycles. A cycle is a turn is tau is 2pi.

The SI unit for frequency after all is Hertz - cycles per second - which should really be considered equal to 2pi s^-1, but for complicated reasons, often isn’t, and most formulae that involve frequency ignore the ‘cycle’ - or it’s also hiding inside the definition of something like the wavelength or the Planck constant where it cancels out.

Meanwhile the SI unit for angular velocity is radians per second which is dimensionally equivalent to s^-1.

That said a becquerel, which measures rate of discrete events, is also dimensionally s^-1. (Next time you are measuring traffic to your website consider using the appropriate SI unit for measuring requests per second: the Becquerel.) - so dimensional equivalence isn’t the same as equivalence. You wouldn’t add a rate to a frequency, same as you probably shouldn’t add a torque to an amount of energy.

thyristan 4 hours ago

> Next time you are measuring traffic to your website consider using the appropriate SI unit for measuring requests per second: the Becquerel.

Great idea, I will definitely do this!

sriku 8 hours 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.

mattmcal 5 hours ago

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.

zarzavat 6 hours ago

> 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.

theodorethomas 41 minutes ago

The Fortran 2023 Standard introduces new intrinsics:

"The intrinsic functions ACOSPI, ASINPI, ATANPI, ATAN2PI, COSPI, SINPI, and TANPI are trigonometric functions in which angles are specified in halfrevolutions (that is, as multiples of π)."

amelius 37 minutes ago

The problem with this is that when I see pi I know we're talking about an angle; when you use turns it's just some number. Maybe in typed languages it would work better.

slwvx 8 hours 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 7 hours 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?)

nomel 7 hours ago

It's a mistake to care about equality of floating point numbers [1]. You must usually consider the lower bits of the number as random.

I assume you're saying something other than this though?

[1] https://en.wikipedia.org/wiki/Machine_epsilon

ainch 7 hours ago

zarzavat 6 hours ago

eru 6 hours ago

jcranmer 6 hours ago

The short answer is you need fast-math flags to allow optimizations that may change floating-point results, and you also need to guarantee an implementation of sinpi/cospi (these were added in C23, so they're not all that common in host library implementations yet).

It's possible if you had the implementation of the math library visible to the compiler that it could do inlining and then simplify expressions, but honestly most math library function implementations are going to be the kind of function that doesn't get picked up by inline heuristics, as there's a pile of if statements (handling special cases and range reduction) that the compiler can't eliminate due to there not really existing a sufficiently powerful FP range analysis.

__MatrixMan__ 5 hours ago

This seems to be mostly from the perspective of what makes the most sense to use at an API boundary.

Rather than trying to agree on the best meaning the various integers or floats that we're passing around, maybe we should instead build a more complex angle type that doesn't force callers to conform. Like, I can pass minutes or seconds to functions that accept a time type and it just works because they're not being collapsed to numbers. Is there any reason we couldn't do that with angles too?

boomlinde 2 hours ago

This can be useful for some geometry, but pi isn't a completely arbitrary choice and some useful relationships are lost when not using radians.

I use different angle units depending on the application. On a platform with 8-bit index registers, 1/256 of a turn can be useful. IIRC Pico-8 uses turns.

kens 6 hours ago

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.

kqr 6 hours ago

It's also useful for sighting distances when the width or height of something is known. A knuckle on your outstretched arm is roughly 30 mils, so you cover the thing with your hand, count knuckles, multiply by 30, then divide the size by that number to get the distance.

You can calibrate your knuckles by doing this is reverse. Put up a target 1 cm wide and back up until it's just covered by a knuckle. Measure how far you got and divide.

It was when I thought about why this works I started really understanding radians.

kqr 2 hours ago

Oh, and I forgot and now it's too late to edit my comment. 6400 has a bunch of nice divisors too. A half-turn is 3200 mils, a quarter is 1600, a quarter of a quarter is 400, etc. A sixth of a turn is nearly 1000 mils. A tenth is obviously 640 mils.

em3rgent0rdr 6 hours ago

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.

aldonius 6 hours ago

Binary fractions of a turn are also a nice intuition pump for two's complement in general.

Let's keep it simple and use just 8 bits. 0° is 0x00, 180° is 0x80, and 255/256ths of 360° is 0xFF. And if we wanted to use signed integers, then 0x80 through 0xFF - the high-bit half of the range - now represent the negative quadrants just as they represent negative integers.

djmips 4 hours ago

and that's exactly what we did in the old days of 8 bit games. We called them BRADs but others had their own names.

zahrevsky 8 hours ago

> It turns out (pun intended!)

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

jp57 8 hours ago

Or you could use 1/360 of a turn.

groundzeros2015 7 hours ago

degrees were primarily chosen due to many integer divisors - likely for applications of time and seasons.

fph 2 hours ago

This alone should be a reason to drop the pi factor: it's basically impossible to get an exact zero for the sine of a half-turn:

sin(1*pi) = 1.2246e-16

rajnathani 5 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?

ttoinou 3 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 an hour 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.)

srean 3 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.

fph 2 hours ago

If you plot it over which domain?

fooker 5 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 5 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

djmips 4 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 3 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 6 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 2 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 7 hours ago

Fails to mention that radians relates angle to arc length.

HWR_14 7 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 6 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 6 hours ago

ethanlipson 7 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 2 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 2 hours ago

> Radians really are the natural unit for trigonometry.

s/trigonometry/calculus

stephenlf 6 hours ago

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

otikik 2 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

Juliate 4 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.

trklausss 3 hours ago

Wait until you discover gradians: centesimal system applied to angles. A turn is 400 gradians, right angles are 100 gradians.

Same advantages as here but multiplied times 400...

moffkalast 3 hours ago

I'm not super versed on the subject, but I think there's a case where using radians allows you to do direct multiplication without any conversion when trig isn't even involved, for rotation or transformation matrices? In which case this would fall apart rather completely if that doesn't work anymore and wouldn't be any different than switching to degrees, a convenience fix that requires conversion anyway.

thrtythreeforty 5 hours ago

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

judofyr 4 hours ago

I'm confused. How is this simpler? Is there something in (-1)^(2x) that can easily understood by staring at the complex plane? It seems mostly that you've gotten rid of "e", but one of the goals of Euler's formula IMO is to explain what "e^(i …)" means so I'm not sure how this variant is useful.

WCSTombs 22 minutes ago

Sorry but this is pretty bogus. (-1)^x is only well defined when x is an integer. This is generally the case for r^x whenever r isn't a positive real number. For example, when x = 0.5, r has two distinct square roots. Sure, you can choose one of them arbitrarily and declare it to be the value of r^0.5 (and math libraries typically do this), but there's unfortunately no good way to make this arbitrary choice consistently for all values of r simultaneously.

lefra 3 hours ago

Now define exponentiation by a non-integer.

zkmon 4 hours ago

I think it misses the whole point of Pi. Turns are for angles. Pi is not a measure of angle. It is a number that can be used to find the length of an arc. For example, it gives half-length of an arc, given an angle in Turns. So it deals with lengths, not strictly angles. Turns deal with angles only.

fragmede 3 hours ago

It's similar to why taxicab distance is better for distance measurement on limited hardware where sqrt() costs precious cycles. The reason to use sin() though is because it's a lookup table (where it counts) and not a bit of math, so moving to turns isn't necessarily a win.

oliculipolicula 7 hours ago

Maybe related

Hamilton's theory of turns revisited

https://arxiv.org/abs/0904.4787

burnt-resistor 3 hours ago

At least we got metric units out of the French Revolution.

Gradians exist because "let's change everything, even things that aren't broken".

traes 7 hours ago

The title should say (2022)

nyc111 5 hours ago

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...

ogogmad 2 hours ago

Turn is a measurement unit, and measurement units are just numbers. So turn ≈ 6.28318530718. You're welcome.

That should put to bed that whole τ crap. "But the symbol τ is used for other things!" Yeah, yeah, yeah, just write turn. Even better, because it's more international and has more precedent, write rev for revolution.