Live data from Hacker News

Turns are Better than Radians (2022)

computerenhance.com

131–140 of 225 posts

Re: Turns are Better than Radians (2022)

#131
post #123

Earlier quoted context omitted.

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)

> For graphics rendering Euler equation doesnt matter. Huh?? "Euler angles" are one of the most popular representations in computer graphics! The only other good alternative is quaternions, where as you say this also matters!

Euler angles have nothing to do with e^ix = cos x + i sin x. They are a completely different concept.

Re: Turns are Better than Radians (2022)

#132

Earlier quoted context omitted.

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

I absolutely love how full Wikipedia is of completely useless pages like the Vincenty's Formulae one, where someone has just gone "look this is what it says in my maths textbook" without any explanation. No discussion of why you'd use this over for example the Haversine function, of course, just a straight out copypasta and a demonstration of how clever someone is at the mathematical notation markup. Incidentally you…

It would sure be better if it had some concrete explanations and examples why vincenty is preferred. It's also barely any more computational load on modern computers so very little reason not to use it.

Haversine is strongly deprecated in even short distance applications like planning a 35 km point to point licensed band radio microwave link, because you risk having both slightly the wrong distance and the azimuth figure being off by a tenth of a degree.

Vincenty in python form is quite compact. Karney by comparison is something like 1000 lines of code. And the difference is going between like a few mm precision to nanometers.

Re: Turns are Better than Radians (2022)

#133
post #122

Earlier quoted context omitted.

The author's not talking about doing math, but about porting math into code. Counting turns is the same as counting cycles. People do that all the time. It works fine. And this math is kind of a mess. exp(x) is its own derivative but the log is not. (d/dx)log(x) = 1/x But, agreed, if you're going to do calculus, use radians.

> The author's not talking about doing math, but about porting math into code. If your code doesn't look like the math it's "ported" from, the odds of it being bad code go up like 100x

I tried to make my code exactly match the math it came from, but I didn’t have enough memory to store sqrt(2)

Re: Turns are Better than Radians (2022)

#134

Earlier quoted context omitted.

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

I absolutely love how full Wikipedia is of completely useless pages like the Vincenty's Formulae one, where someone has just gone "look this is what it says in my maths textbook" without any explanation. No discussion of why you'd use this over for example the Haversine function, of course, just a straight out copypasta and a demonstration of how clever someone is at the mathematical notation markup. Incidentally you…

Writing full articles takes time and effort. But the effort is cumulative, so these stub articles are really just the start. Some of the comment you made here would definitely improve the article. You are always welcome to edit and improve Wikipedia. I mean this literally and sincerely, it is one of the few places on the internet where you might benefit from posting.

Re: Turns are Better than Radians (2022)

#135
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…

You might find the following interesting. It is about trigonometry as practiced by early Indian mathematicians. Rather than using an unit circle they used a circle of 3438 units.

https://news.ycombinator.com/item?id=45129081

Now it is customary to standardized on the radius. Early Indian astronomers and mathematicians standardize on the arc length of a minute.

Re: Turns are Better than Radians (2022)

#136
post #122

Earlier quoted context omitted.

> The author's not talking about doing math, but about porting math into code. If your code doesn't look like the math it's "ported" from, the odds of it being bad code go up like 100x

I tried to make my code exactly match the math it came from, but I didn’t have enough memory to store sqrt(2)

If you look at the implementation of sqrt for a computer, it's usually implemented with Newton's algorithm, which is an iterative numerical method with high speed convergence. It is computationally efficient and looks approximately zero how √ looks.

Re: Turns are Better than Radians (2022)

#137
post #127

Earlier quoted context omitted.

In another comment I made in this thread https://news.ycombinator.com/item?id=49373317 I think it came to the understanding that a "turn" is similar to a dimensionless quantity, as it takes the full circle/cycle as a fundamental 1. Apparently, using the turn as a unit allows one to get rid of pi and e in Euler's formula in favor of 1 and -1.

Yeah. @ttoinou too, I think, had the same thing in mind. https://news.ycombinator.com/item?id=49371421

I see, maybe it's common sense but I do like "rediscovering" basic facts for myself. (:

Re: Turns are Better than Radians (2022)

#138

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

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!

TFA states “the less tau and pi, the better” and calls the radian-oriented functions “legacy”. I understand that a title like “Turns are Better than Radians” is intentionally inflammatory to get clicks, but I’d expect a more calibrated take in the article body. Phrasing like the above indicates the author doesn’t know what they’re talking about, even though I do agree turn-oriented functions would be useful.

Re: Turns are Better than Radians (2022)

#139

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

Your argument is correct and I'm sure you're really smart and all that.

However,

Proportion of code where radians are used to represent rotation in 2D (i.e. turns): 99.9999%

Proportion of code where radians are used to perform higher degree derivatives, symbolic computation, etc: 00.0001%

Re: Turns are Better than Radians (2022)

#140
post #127

Earlier quoted context omitted.

Yeah. @ttoinou too, I think, had the same thing in mind. https://news.ycombinator.com/item?id=49371421

I see, maybe it's common sense but I do like "rediscovering" basic facts for myself. (:

Absolutely !

I remember things the best (only) when I discover them for myself. Slow progress but high retention.

Post reply on HN