Live data from Hacker News

Turns are better than radians

computerenhance.com

421–430 of 494 posts

Re: Turns are better than radians

#421
post #370

Earlier quoted context omitted.

If you're not using derivatives, integrals, or complex numbers, maybe you'd be better off using Wildberger's "rational trigonometry" with quadrances and spreads instead of angles? I haven't actually tried it myself. Wildberger's motivation is a sort of ultra-strict Platonism* mixed with the desire to extend analytic geometry to fields other than the real numbers, though, so it wouldn't be surprising if it wasn't actu…

So if I wanted to, say, calculate the height of a pole from the length of its shadow, I should use Wildberger's rational trig, because I don't need derivatives, integrals, or complex numbers? :)

Sure. No smiley face needed, unless geometry makes you smile.

Re: Turns are better than radians

#422
post #29

Earlier quoted context omitted.

360 comes from the Babylonians, who used base-60 for numbers much for the reasons you describe (and who gave us the 24-hour day, 60 minute hour and 60-minute second, not to mention the 7-day week). NATO forces have compasses labelled in mils or milliradians, which are not actually 1/1000 of a radian but as an approximation 1/6400 of a full turn. I still have my Silva military compass from 1989 graduated thus. https:/…

I heard that the reason is 1km away it makes a difference of 1m, so easy to figure out how far enemy troops are from each other.

More importantly, it can be used for ranging. The average human height is known, and (usually) so are the sizes of whatever vehicles the other side might be using. Thus, when observing things of known size through some optic with a reticle graduated in mils, you can easily determine the range to them. Which then gives you e.g. the amount of holdover necessary to hit the target with a gun (which can itself be expressed as number of mils on the reticle to aim above).

Re: Turns are better than radians

#423
Lots of things work better in radians: s=r * theta, area = 1/2 theta^2 * r, d(sin(x))/dx = cos(x) (etc, for slopes and numerical algorithms), simpler series approximations and algorithms for computing these and other functions, movement rates of things using gears or wheels are simpler to calculate, radians are dimensionless whereas anything else is not (when used in nearly any physics or math uses), hardware support for lots of related functions, interoperability with legions of existing software, papers, book, and algorithms...

Re: Turns are better than radians

#424

Earlier quoted context omitted.

Ouch. Less than 1 degree of accuracy? Well, I guess if it’s good enough for Asteroid, it’s good enough for me

The sin/cos lookup tables would only contain an octant of the circle and use various symmetries to map other values to that range. Thus the resolution is ~0.176 degrees for a 256-entry table. sin(x) = -sin(-x) = sin(pi - x) = cos(pi/2 - x) cos(x) = cos(-x) = -cos(pi - x) = sin(pi/2 - x)

The limit on precision wasn't the size of the lookup table, it was the size of the integers. The CPU's integers were only 8-bits. So if you're using native integers (i.e.: [0,256) == [0°,360°) ), you can't get angles more precise than 1.4°.

Re: Turns are better than radians

#425

Earlier quoted context omitted.

Ouch. Less than 1 degree of accuracy? Well, I guess if it’s good enough for Asteroid, it’s good enough for me

You can always do one cycle of newton-raphson to get nearly double the accuracy with only one extra lookup-multiply-add.

The MOS 6502 didn't have a multiply.

Re: Turns are better than radians

#426

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'd argue it's not so much taught in the US as it is tested. The common core standards say [0] that students should: > Understand radian measure of an angle as the length of the arc on the unit circle subtended by the angle. > Explain how the unit circle in the coordinate plane enables the extension of trigonometric functions to all real numbers, interpreted as radian measures of angles traversed counterclockwise aro…

No, you’re missing the point. I went to school in the 80s and learned this stuff without multiple choice and fully understood it all of the way through undergrad where I took up through calc 3 and differential equations. Then I spent nearly 30 years as a SWE not using it and forgot nearly all of the details within maybe 15 years.

This happens with very basic things like human languages. Bilingual people can forget an entire secondary language if they don’t use it for a decade+.

Re: Turns are better than radians

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

Effectively yes. A tiny subset of programmers need trig.

Re: Turns are better than radians

#428
post #258

The author makes the point that turns allow for exact representation of many commonly used angles, but with binary floating point, many common angles (1/6 of a turn, for example) are inexact. This could be addressed by using a whole number other than 1 to represent a turn ... one that is a multiple of 3 (or 3x3) and 5, and while we're at it, 2 (or 2x2x2), so most commonly-used angles are whole numbers! That gives us…

There's no need to represent fractions of a turn as binary fractions, since you don't ever need more than 1 turn. You can represent fractions of a turn as (pair of integer) rationals, and round on the rare occasion that the denominator gets too big.

Re: Turns are better than radians

#429
post #112

Indeed, maths never "decreed that sine and cosine have to take radian arguments". But thinking that makes any sort of point is a fundamental misunderstanding of maths. There are infinitely many sinusoidal functions out there. You can just adjust amplitude, frequency and phase to your heart's content. Trigonometry basically requires that sine and cosine have specific amplitudes and phases, but gives not one shit about…

> Degrees are completely arbitrary Degrees are very natural in the context of ancient astronomy/astrology, where you have (1) ~365 days in a year, so that if you look at the path of something that takes a year you get about one degree change per day but with a number that is more easily divisible. (2) approximately 4y, 10y, 8y, 15y, 12y, 30y cycles for the moon and various planets. (3) A calendar with 12 months, 12 z…

That's... convenient for approximately our specific arbitrary position in the universe, but not mathematicallly natural.

Re: Turns are better than radians

#430
post #378

Bravo! Bravo!! Now if we can just make base10 math the default in modern languages and only let the very few propeller headed weenies that really need it ever pay attention to floating point math and IEEE-754 Hell, we can join the 21st century we were promised. (Oh, where's my flying car, dammit?!)

IEEE 754 has had decimal (base10) math for close to 15 years now.
Post reply on HN