Live data from Hacker News

Turns are better than radians

computerenhance.com

461–470 of 494 posts

Re: Turns are better than radians

#461
post #369

Earlier quoted context omitted.

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 :-)

Speaking of reference frames, I deal with quite a few for Earth-bound things, and the primary ones we use are ECEF (Earth-Centered, Earth-Fixed) and ECI (Earth-Centered, Inertial), which then we will often move to a relative local frame for whatever object matters. Is the equivalent set available for Martian Nav (MCMF/MCI, I guess), or do you have different/specialized/etc. frames based on something unique to Mars.

Yes... there are similar frames for Mars and other bodies. A good intro: https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/Tutorials/pd...

For the rover, we're pretty much always dealing in local coordinate systems based on reference frames defined using the rover's observations of the sun and alignment of local imagery with orbital imagery. The two frames used most frequently are called RNAV (centered on the rover) and SITE (centered on where we last did a sun observation). But then there is a tree of frame transformations for knowing the location and orientation of each part of the rover with a lot of named frames (especially important for operating the robotic arm, which I also do).

Re: Turns are better than radians

#462

In Julia multiple dispatch you could just call sin(3 turns) which would dispatch the unit to the optimized nsin. Would the compiler optimize it to be overhead free though?

Yes, it would devirtualize the dispatches for that kind of thing at compile time if the argument type is known at compile time. See how Unitful.jl works. You can then see inside of the LLVM and native code that it swaps in the required functions.

Re: Turns are better than radians

#463
post #84

y’’ = -y Radians are God’s chosen angular unit. If you want to do mathematics, you have to use radians.

What subfield of mathematics? Surely if you do differential equations, your trigonometric functions will eat radians. But e.g. for geometry, where you do basic arithmetic operations on angles, turns are a bit more convenient than radians. (Radians are not that inconvenient if you denote 6.28 somehow, but then again, why not just use turns.)

Parent comment is way too dogmatic for my taste. It even mentions a mythological entity as an appeal to authority.

In my opinion, mathematicians always choose the notation that's more convenient for them, at the moment, for a particular problem.

If a given problem is easier using another form of sin/cos, etc., they will use it, and it will be used without hesitation. In that sense, mathematicians could not be more pragmatic.

However, for many things, as long as the result is correct, they don't care about the operations' computability. Performance is an afterthought because for them (a*п)/п is exactly the same as 'a'. All operations are instantaneous.

Taylor series for example are a perfectly fine final answer in calculus, but to a programmer they are an infinite set of partial approximations that can take any arbitrary time to execute.

This is what makes computer science fascinating =)

Re: Turns are better than radians

#464

Earlier quoted context omitted.

But the angle is an adimensional unit (it's the ratio of two distances, one along the circumference and one along the radius) so 1 rad = 1. Therefore 1 degree is 0.0174... radians but it is also just 0.0174.

No, you're describing one particular way to measure angles. Radians express such a ratio, but degrees don't. 1° is not a ratio between distance along a circumference and radius, it's a ratio between amount rotated and complete revolution. 1° actually stands for 1/360 (of a revolution). Which is why it's important to add the unit after the measurement. If someone tells you an angle measures 1, can you tell whether it'…

Angles in the SI are a ratio of two lengths (and solid angles are a ratio of two surfaces), so degrees are also a ratio of two lengths. 1 degree is a ratio of pi/180=0.01745, which happens to be 1/360th of a revolution; and you have to write down the unit to indicate the multiplicative factor. But writing down radians is just for clarity.

Re: Turns are better than radians

#465

Earlier quoted context omitted.

No, you're describing one particular way to measure angles. Radians express such a ratio, but degrees don't. 1° is not a ratio between distance along a circumference and radius, it's a ratio between amount rotated and complete revolution. 1° actually stands for 1/360 (of a revolution). Which is why it's important to add the unit after the measurement. If someone tells you an angle measures 1, can you tell whether it'…

Angles in the SI are a ratio of two lengths (and solid angles are a ratio of two surfaces), so degrees are also a ratio of two lengths. 1 degree is a ratio of pi/180=0.01745, which happens to be 1/360th of a revolution; and you have to write down the unit to indicate the multiplicative factor. But writing down radians is just for clarity.

I don't understand the debate, radians & degrees are just 2 proportional units, just like meter & kilometer

Re: Turns are better than radians

#466
post #455

As already mentioned by others, radians are not arbitrary units for angles; in fact, they are the "natural" "units", so to speak. By definition, an angle is just the ratio of a circular arc ( s ) to its radius ( r ), θ = s / r (as an exercise, imagine how to apply this definition to the angle between two intersecting lines). When the length of the circular arc equals its radius ( s = r ), the angle subtended is exact…

A radian is 1turn/2pi. It is not dimensionless. A radian, or a turn, has a dimension: angle. Saying 1radian=1 is just as senseless as saying 1m=1=$1. It's true that abstract math often drops units because some things (like Taylor series) work nicely in certain units. That doesn't make the unit meaningless. Street-Fighting Mathematics, thesis/book by Sanjoy Mahajan, shows what amazing things you can die in abstract ma…

It is de juro dimensionless, SI said so, and your government most likely made it official.

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

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

I am not sure that the current definitions are consistent or useful, but I myself don't know better.

Re: Turns are better than radians

#467

On the frontend, one thing that I discovered when implementing color spaces into my canvas library was that the CSS HWB standard[1] allows the hue part of a color (which is an angle value) to be supplied supplied as either 'Ndeg', 'Nrad', 'Ngrad' or 'Nturn' values. Other CSS color spaces involving hue don't see to accept 'turn' (though I could be misunderstanding them). [1] - https://developer.mozilla.org/en-US/docs/…

You’re misunderstanding things. CSS is typed, and deg/rad/grad/turn are all just angle units; anything that takes an supports angles in any unit. hsl(0.5turn 100% 50%) is equivalent to hsl(180deg 100% 50%) and #00ffff (and infinite other spellings). When it was introduced, hsl() only took a for hue, which was interpreted as degrees, but it has had proper support for over a decade (apart from Opera which only got it w…

Ah! Thanks for the explanation. I'll need to fix this in my library.

Re: Turns are better than radians

#468
> But math never decreed that sine and cosine have to take radian arguments!

To quote a really important comment posted by Eduardo Vasquez on the article:

> [...] all those formulas of derivatives and primitives of trig functions in standard calculus books assume that arguments are expressed in radians. Say, the derivative of sin(x) w.r.t. x is cos(x) --- that is only true if x is in radians. Otherwise, you would get an extra factor, due to the chain rule. [...]

(There are a few comments here that point this out, but they are nested pretty deep so I thought it was worth repeating.)

Re: Turns are better than radians

#469

Earlier quoted context omitted.

You’re misunderstanding things. CSS is typed, and deg/rad/grad/turn are all just angle units; anything that takes an supports angles in any unit. hsl(0.5turn 100% 50%) is equivalent to hsl(180deg 100% 50%) and #00ffff (and infinite other spellings). When it was introduced, hsl() only took a for hue, which was interpreted as degrees, but it has had proper support for over a decade (apart from Opera which only got it w…

Ah! Thanks for the explanation. I'll need to fix this in my library.

I recommend reading specs regularly when doing anything like this. Web specs are generally pretty approachable, and they generally match implementations very closely these days (largely because the implementers are the spec-writers, which wasn’t so much the case before, say, the HTMLL5 effort), with the caveat that parts of these drafts precede the implementations and thus may end up being altered due to implementation experience.

Re: Turns are better than radians

#470

If you like turns you might like https://en.wikipedia.org/wiki/Gradian which is ¼₀₀ of a turn. I guess the metric way to do it is use centiturns (4 gradians), milliturns, etc. On the other hand if you like metric and radians you might like https://en.wikipedia.org/wiki/Milliradian

> ¼₀₀

{vulgar fraction one quarter}{subscript zero}{subscript zero} is the wrong way of writing this, generally producing a suboptimal result (denominators and subscripts occupy different lines, and the known fractions often have slightly different, more manually-optimised layouts anyway). The proper way is {digit one}{fraction slash}{digit four}{digit zero}{digit zero}: 1⁄400. Won’t render looking like a fraction with split numerator and denominator in all fonts, but it should mostly look better.

Post reply on HN