Live data from Hacker News

Turns are better than radians

computerenhance.com

241–250 of 494 posts

Re: Turns are better than radians

#241
Radians are just half-turns, so we use turns either way. Some equations look better in turns and some in half-turns, but the math works fine either way.

Instead to decide which is better think of how a new student might learn this intuitively:

How far around is it? 2.5 turns.

This is so much clearer than 5.0 half-turns.

Turns a more clear. No one

Re: Turns are better than radians

#242

Earlier quoted context omitted.

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, 0 https://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…

"One of the best ways to calculate sin and cos is CORDIC" This is extremely false. Cordic is 1 bit per iteration, while polynomials (Chebyshev or minmax) converge exponentially faster.

Re: Turns are better than radians

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

> radian is not an arbitrary unit but a dimensionless one

This is by convention, but has been and is still being debated because calling it dimensionless causes some problems. https://en.wikipedia.org/wiki/Radian#Dimensional_analysis

Furthermore, the whole reason to treat radians as dimensionless, the problem, is with angles, not with radians specifically. Degrees are also considered dimensionless. So, a turn could be treated as dimensionless too, with a conversion constant to radians & degrees, just like between degrees and radians.

Of course, the declared dimensionlessness of angles like radians isn’t something generally discussed in pre-college trig courses, that’s a subtle subject that matters more in physics. In my high school trig, we all understood radians to be a unit of angle and never pondered whether angles had dimension.

Also subtle point, but dimensionless doesn’t mean unitless. It’s another separate convention to drop the units when working with radians.

Re: Turns are better than radians

#244

My favourite way of handling angles was always with either unsigned char or 16bit unsigned int that was treated as 1/nth of turn. Usually in these cases cos/sin tables were pre-calculated for speed, although that need went away to an extent. As long as as the calculations wrap around on the underlying system, it makes angles much easier to manage, because angle1 + angle2 = angle3 is always within 0 to 255 or 0 to 655…

For overflowing integers in JS, you can use single-value long typed arrays. I just checked with an Uint16Array and it wraps back to 0 after 65536.

Thank you! This works great as well for my purposes:

  > a = new Uint16Array(1)
  Uint16Array(1) [ 0 ]
  > a[0]
  0
  > a[0] = a[0] + 65537
  65537
  > a[0]
  1

Re: Turns are better than radians

#245

Earlier quoted context omitted.

> there are no important applications for those series. I cannot believe I just read this.

When have you ever used the Taylor series of sine and cosine for anything (outside school) ? When you approximate functions by polynomials, including the trigonometric functions, the Taylor series are never used, because they are inefficient (too much computation for a given error). Other kinds of polynomials are used for function approximations. The Taylor series are a tool used in some symbolic computations, e.g. f…

> When have you ever used the Taylor series of sine and cosine for anything (outside school) ?

I've used them a few times, mostly in the embedded space, and mostly in conjunction with lookup tables and/or Newton's method, but yes I've absolutely used them outside school (years ago, I forget the exact details).

- implementing my own trig functions for embedded applications where I wanted fine control over the computation-vs-precision tradeoff

- implementing my own functions for hypercomplex numbers (quaternions, duals, dual quaternions, and friends).

- automatic differentiation

Does the Taylor series form survive to the final application? Usually not, usually it gets optimized to something else, but "start with Taylor series and get back to basics to get a slow but accurate function" has gotten me out of several pickles. And the final form usually has some chunks of the Taylor series.

Re: Turns are better than radians

#247
post #202
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…

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

Think it's part of the equality/blank-slate myth that everyone is the same and has the same potential and natural abilities.

Re: Turns are better than radians

#248

Saying "rad" are bad units for sin is like saying e is a bad base for logarithms. The only "bad" thing about rads is that they're not taught early enough so that culturally 45 degrees are not know as pi/4. Then a turn would be known as simply as 2pi (or "a one eighty" as Americans infuriatingly like to call it when someone rotates 360 about themselves)

I'm actually more familiar with the reverse mistake, when people say someone "did a full 360" to mean they have changed their mind/approach.

I suppose the confusion there is with the association of "full 360" with "comprehensive" (as in looking all around, without any blind spots), which is valid.

Re: Turns are better than radians

#249

Radians are just half-turns, so we use turns either way. Some equations look better in turns and some in half-turns, but the math works fine either way. Instead to decide which is better think of how a new student might learn this intuitively: How far around is it? 2.5 turns. This is so much clearer than 5.0 half-turns. Turns a more clear. No one

> Radians are just half-turns, so we use turns either way.

What? This thread is full of weird statements, but this one is among the weirdest. In what way is a radian a half-turn?

Re: Turns are better than radians

#250

Earlier quoted context omitted.

Whats wrong with long variable names?

Nothing, but their use in mathematical equations will certainly conflict with the implicit multiplication in equations (i.e. `abc` in a formula means `a * b * c`, not a variable abc).

This is already a problem, sin is the sine function, not sin.
Post reply on HN