Live data from Hacker News

Turns are Better than Radians (2022)

computerenhance.com

51–60 of 225 posts

Re: Turns are Better than Radians (2022)

#51
post #50

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.

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

Re: Turns are Better than Radians (2022)

#52
post #6
post #2

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 c…

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…

> all angles are without a unit.

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

Re: Turns are Better than Radians (2022)

#53
post #2

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 c…

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 tra…

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.

Re: Turns are Better than Radians (2022)

#54
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?

Re: Turns are Better than Radians (2022)

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

Re: Turns are Better than Radians (2022)

#57
post #52
post #6

Earlier quoted context omitted.

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…

> all angles are without a unit. Dimensionless, sure, but what do you mean here? Radians and degrees are units, are they not?

In a very awkward way: rad is m/m, which is 1...

Re: Turns are Better than Radians (2022)

#58
post #4

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.

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…

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

Re: Turns are Better than Radians (2022)

#59

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

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.
Post reply on HN