Live data from Hacker News

Turns are better than radians

computerenhance.com

201–210 of 494 posts

Re: Turns are better than radians

#201

Earlier quoted context omitted.

video games don't usually need to take unitless derivatives of sines.

True, but if you are talking about video games in particular you could just build a sin/cos function with different parameters into the game engine. have a `sin(x)` where the unit of x is radiants and a `sin_turn(x)` where x is expressed in turns. Video games especially are a great situation to do it like this because they often use a framework (game engine) that was specifically created for this purpose.

Yes, this is the topic of the fine article and the point that is being made. Ideally both of the multiplies (one in the user code to multiply by pi and another in the engine code to divide by pi) can be omitted.

Re: Turns are better than radians

#202
post #183

Earlier quoted context omitted.

> Am I wrong? Yes. Trigonometry is extensively taught in the US. People forget this stuff if they don’t use it. Ask some 30 year old chef in whatever country you fantasize teaches properly to compare and contrast turns vs radians and you’ll get similar responses.

I'm a 50 yo programmer. I have a CS degree. I don't even remember my college calculus much less my high school trig. I just haven't had cause to use it in my career, not as a sysadmin, not as a programmer. My son is taking calc 3 and I knew I happened to have my calc 3 notes from the mid-90s, so I pulled them out of the filing cabinet and my very carefully taken notes, my proofs, my hand drawn graphs, it was all gibb…

By far the most annoying myth I face when trying to discuss the pros and cons of various education techniques is the pervasive idea that everybody is a magical knowledge sponge and will go to their grave still remembering how to integrate by parts and every detail about some particular battle they covered in seventh grade, and therefore, if we slightly tweak a curriculum plan to drop something that was included on theirs we'll be stealing that knowledge from all the 70 year olds who will eventually have been on that plan.

Where this idea comes from I have no idea. Personally looking around in school itself it was plainly obvious this was all going in one ear and out the other for the majority of students even at the time. The better students retained it long enough to spew it out on the test but that was already above average performance. That doesn't mean there isn't still a certain amount of value in that in terms of what that knowledge may do to their brain during the brief period of time it is lodged in there. (I think there's a lot of value in just learning the "shape" of all this stuff, and perhaps having some index of what might be valuable to know.) But the idea that we can spend 15 minutes and a one-page homework assignment on something and expect that to last 60+ years is just nonsensical.

I mean, honestly, anyone over the age of 22 or so ought to be able to notice a distinctly sub-100% retention rate simply by looking inside themselves.

Yes, to a first approximation everyone with a normal education in the US has been present while some sort of trig was discussed. Not all of them, but still quite a lot of them, were present for the Taylor expansion discussion. The vast bulk of them have had it decay by 25, and there simply isn't anything to be done about that if you're talking about humans and not some homo educationous who mythically retain all knowledge they were exposed to even for 30 seconds just as the mythical as homo economicus perfectly rationally conducts all their economic business at all times. Perhaps they're actually the same species.

Re: Turns are better than radians

#203

Well I don't think they are. Sure they make computing the function simpler. But I would hazard that most people that use these functions are not doing geometry and they are already working with radians. In short if you give any kind of engineer working on any kind of signal processing domain a sine function where sin(1) = 0 you are only going to confuse them. PS: that's why mathematicians don't use turns they are mos…

> sin(1) = 0 you are only going to confuse them.

Not really, pretty much every single one would assume you just forgot the pi, because everyone writes “sin(1pi)” and never actually “sin(3.14…)” because no one ever writes down numbers in the unit of radians, they already convert to half rotations or full rotations by scaling with pi. Imagine if someone went “nanometers are a dumb unit, because I always write down my numbers as h=342 x 10^-9m” that last part “10^-9m” is just nm. In the same way that sin(1.432pi) might as well just be written sin(1.43*rotation). Arguing for radians is arguing that the most natural way to write it is sin(8.985). Which you will pretty much never see anyone do.

Re: Turns are better than radians

#204
post #193

Earlier quoted context omitted.

> Am I wrong? Yes. Trigonometry is extensively taught in the US. People forget this stuff if they don’t use it. Ask some 30 year old chef in whatever country you fantasize teaches properly to compare and contrast turns vs radians and you’ll get similar responses.

Sure, but are people here chefs? I would expect most programmers in mu country to remember this, but most chefs to have forgot it.

I would only really expect programmers who work with angles regularly (those working in 3D) to remember it. Even then, you’re likely just smashing quaternions together anyway.

Re: Turns are better than radians

#205
post #32

>But math never decreed that sine and cosine have to take radian arguments! Ummm, actually it did. The Taylor-series of sine and cosine is the simplest when they work with radians. Euler's formula (e^ix = cosx + isinx) is the simplest when working with radians. Of course you can work in other units, but you'll need to insert the appropriate scaling factors all over the place. "Turns" don't generalize to higher dimens…

The writer don’t seem to realise that radian is not an arbitrary unit but a dimensionless one which is defined so that 1rad is actually just 1. Reading the submission and the comments here, I’m under the impression that trigonometry is not extensively taught in middle schools and high schools in the USA. While I’m slightly envious you might not have to suffer developing powers of cosine and sine but that would explai…

>> The writer don’t seem to realise that radian is not an arbitrary unit but a dimensionless one which is defined so that 1rad is actually just 1.

It's been a while, but I used to have an argument that rad should be a unit. This even plays well in physics where it allows torque to not have the same units as a joule.

Re: Turns are better than radians

#206
post #183

Earlier quoted context omitted.

I'm a 50 yo programmer. I have a CS degree. I don't even remember my college calculus much less my high school trig. I just haven't had cause to use it in my career, not as a sysadmin, not as a programmer. My son is taking calc 3 and I knew I happened to have my calc 3 notes from the mid-90s, so I pulled them out of the filing cabinet and my very carefully taken notes, my proofs, my hand drawn graphs, it was all gibb…

I'm 27, educated in the UK, all I remember about trigonometry is SOHCAHTOA.

Ha I also remember the mnemonic but I don’t have a clue how to use it.

Re: Turns are better than radians

#207
post #32

>But math never decreed that sine and cosine have to take radian arguments! Ummm, actually it did. The Taylor-series of sine and cosine is the simplest when they work with radians. Euler's formula (e^ix = cosx + isinx) is the simplest when working with radians. Of course you can work in other units, but you'll need to insert the appropriate scaling factors all over the place. "Turns" don't generalize to higher dimens…

>> Ummm, actually it did. The Taylor-series of sine and cosine is the simplest when they work with radians. Euler's formula (e^ix = cosx + isinx) is the simplest when working with radians.

That's nice, but as the article points out most implementations of trig functions on computers don't use things like Taylor series.

Another terrific use of turns is in calculating angle differences, where you take a difference and just use the fractional part of the result. No bother with wrap around at some arbitrary 2*pi value. Since it wraps at integer values we simply discard the integer part. This can even be for free when using fixed-point math.

Re: Turns are better than radians

#208
post #72

Earlier quoted context omitted.

Correct, radians are a "fake" unit made up to understand better formulas (the same way we use types in programming languages)

While it is a fake unit, it was made to make the math easy. You could call the origin of everything the place where I'm standing - but good luck calculating a path for the mars rovers to travel if I happen to walk to the bathroom.

I drive a mars rover and this cracked me up. Understanding reference frames is indeed a big part of the job. We do have to deal with "site frame updates" based on rover observations of the sun -- important but annoying. I will bring your person-centered frame suggestion to the team :-)

Re: Turns are better than radians

#209
post #32

>But math never decreed that sine and cosine have to take radian arguments! Ummm, actually it did. The Taylor-series of sine and cosine is the simplest when they work with radians. Euler's formula (e^ix = cosx + isinx) is the simplest when working with radians. Of course you can work in other units, but you'll need to insert the appropriate scaling factors all over the place. "Turns" don't generalize to higher dimens…

Right, radians are the "natural" units of angle, others generally just make a circle into some integral number of units for convenience, but you always have to go back to radians to actually do calculation. In the next installment, maybe he'll propose that turns can be limiting because diving up a circle requires the use of fractions, and suggest instead of 1 turn per circle, we make a number that's easily divisible…

Yes and no.

The Taylor expansion works out like

   sin θ = θ - θ³/₆ + θ⁵/₁₂₀ - θ⁷/₅₀₄₀ + ⋯
if θ is in radians. This is ideal for small θ but if you want to cover, say, 0https://en.wikipedia.org/wiki/Chebyshev_polynomials

which are optimized across the range. You could rewrite these just as easily to work in degrees as radians.

One of the best ways to calculate sin and cos is CORDIC,

https://en.wikipedia.org/wiki/CORDIC

which is really based on turns, half-turns, quarter-turns and so forth.

Re: Turns are better than radians

#210

Earlier quoted context omitted.

Trig is generally called per-calculus in US high schools. It is not a required course, but it is one of the courses everyone on the college track is expected to take. Though most people haven't used any of that since college and so don't know it very well anymore. I smelled BS when I read the blog, but couldn't put my finger on why - the comment you replied to explained what I knew was the case but couldn't remember.

s/per-calculus/pre-calculus/g

The percalculus ion is just calculus in its highest oxidation state.
Post reply on HN