Live data from Hacker News

Turns are Better than Radians (2022)

computerenhance.com

91–100 of 225 posts

Re: Turns are Better than Radians (2022)

#91

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…

Also with radians the differential equation x''''(t)=x(t) has {exp(t), exp(-t), sin(t), cos(t)} as the (real) canonical base for its solution space. And x''(t)=-x(t) gets {sin(t), cos(t)} where they even result from the simplest possible (non-trivial) initial conditions (x(0)=0,x'(0)=1 and x(0)=1,x'(0)=0).

If you look at all the simplest differential equations you can think of, the sin(t)/cos(t) functions in radians are almost inevitable independent from their geometric usage.

Re: Turns are Better than Radians (2022)

#92
post #77

Earlier quoted context omitted.

You generally can’t apply functions to dimensional units. The only thing units can do is be multiplied or divided together. So I can multiply a mass by a distance or divide a distance by a speed, and I can multiply the result by a scalar; but I can’t take the sine of a distance or the logarithm of a time or exponentiate a mass. Those are things I can only do to scalars. ‘But wait!’ You may cry: ‘the formula for a tra…

> You generally can’t apply functions to dimensional units. Perhaps not in mathematics, but in programming that's clearly possible. I guess programming is more general than mathematics.

This is precisely why (programming language) types are poor model of physics units, despite often being touted for this exact use case. 3m is not the same thing as "the value 3 of type meter". It is the multiplication of the dimensionless scalar 3 with the special "m" constant for meters.

That's why pow(3m, 2) = 9 m^2, and not `the value 9 of type meter`. Of course, you can define the type `square meter` as well, and define `pow -> meters -> positive integer -> square meters`. However this quickly becomes overwhelming once you start doing more complex expressions with multiple types. What is the type of `pow (3kg^2 * m/s, 3/2)`?

Edit to add: also, there is a simple fact that "sin(pi/2 kg)" is just not defined, in programming or math or physics or any other useful system. It's definitely not 1kg, just like sin ( (pi/2) * 2) is not sin (pi/2) * sin (2).

Re: Turns are Better than Radians (2022)

#93
post #77

Earlier quoted context omitted.

You generally can’t apply functions to dimensional units. The only thing units can do is be multiplied or divided together. So I can multiply a mass by a distance or divide a distance by a speed, and I can multiply the result by a scalar; but I can’t take the sine of a distance or the logarithm of a time or exponentiate a mass. Those are things I can only do to scalars. ‘But wait!’ You may cry: ‘the formula for a tra…

> You generally can’t apply functions to dimensional units. Perhaps not in mathematics, but in programming that's clearly possible. I guess programming is more general than mathematics.

No, it's definitely possible in mathematics, they've left out some details as to what the units are doing that makes them unable to be assigned to functions. I mean a regular ODE that you get from newtons laws is a set of functions that take position and time as inputs, which all have units. What they mean should be "dimensionless functions cannot be applied to dimensional variables". These are commonly functions like sin cos exp log and so on.

Re: Turns are Better than Radians (2022)

#94

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…

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 the azimuth between two points on a map. Such as for microwave radio link planning purposes.

Karney (2013) is also radian dependent.

https://github.com/pbrod/karney

Re: Turns are Better than Radians (2022)

#95
post #52

Earlier quoted context omitted.

> all angles are without a unit. Dimensionless, sure, but what do you mean here? Radians and degrees are units, are they not?

In a very awkward way: rad is m/m, which is 1...

Dimensions and units are separate things, though. For example, 1 minute and 1 second are different units of the same time dimension. Similarly, 1 rad and 1 degree are both dimensionless, but they are both different units.

Re: Turns are Better than Radians (2022)

#96
post #82

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…

In another comment, I asked why people chose to use the symbol τ over just writing turn or " rev (olution)" (defined to be the constant ≈ 6.28318530718 ) given how unambiguous the latter is as a name for 2π. And why not just write sinrev() or sinturn(), and leave the symbols sin() and rev (defined to be ≈ 6.28318530718) alone?

The naming is irrelevant here. The point is that sin(x) ~ x for small x, whereas sinrev(x) ~ rev * x for small x, which is much uglier. And similar things happen to the derivative of sinrev() vs regular sin() and so on. So switching to preferring to express angles in revs instead actually complicates most formulas, at least in some domans.

Re: Turns are Better than Radians (2022)

#97
post #67

Even better : did you know (-1)^x draws the unit circle in the complex plane ? No need for complex exp and i*pi

You do in fact need the complex exponential to define this correctly because the function a^x for nonintegers x is only unambiguously defined when a is a positive real number. For example, your function could be either e^(pi i x) or e^(-pi i x), which trace the circle in opposite directions as x varies over the reals. (They happen to agree when x is an integer.)

Re: Turns are Better than Radians (2022)

#98
Rather than sin(), cos() and motion on a circle it is fun to consider uniform speed motion along the perimeter of a regular polygon and its projection hor() and ver() along horizontal and vertical directions.

You can parameterized the motion in terms of the time T to complete one period and consider it's horizontal (or vertical) shadow at any t mod T.

This is related to DFT. As one increases the number of vertices of the regular polygon we will recover sin and cos in the limit. 2 \pi will show up in the ratio of the distance covered in one period of the uniform speed motion and the extents of the projected motion.

Another interesting (and fundamental) construction is to forget about circles and polygons entirely. Simply consider a periodic function over a bounded length L. Consider first the discrete case where the domain is divided into k parts. We want to find an orthonormal basis for all nicely behaved (smooth) periodic functions on this domain.

But there are infinitely many orthonormal basis sets for periodic functions on this domain. We are free to choose any. One choice is that adjacent values do not have large adjacent differences. This can be measured by squared adjacent differences. We choose that basis set that minimizes this quantity.

For the discrete case we recover DFT basis and taking limits carefully we end up with sinusoids.

\Pi will show up because of the requirement of orthonormality.

Post reply on HN