Live data from Hacker News

Turns are Better than Radians (2022)

computerenhance.com

191–200 of 225 posts

Re: Turns are Better than Radians (2022)

#191

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…

Why not e^{2 pi i x} = cos x + i sin x then? We already handle e^{2 pi/360 i x} = cos x + i sin x for x in degrees just fine. It's not that euler no longer holds, it's that you just have to be clear about what units[0] you use when comparing the explicitly angular/geometric cos and sin with the numeric exponential, and then deciding on a default numeric cos and sin/a default "unit" for angles. If we want to get real…

The problem is that angles in the complex plane are related to multiplication, which is related to exponentiation.

When you multiply two complex numbers z1 and z2, their angles add: Arg(z1 z2) = Arg(z1) + Arg(z2).

That carries into exponentiation: Arg(z^2) = 2 Arg(z). The exponent 2 has an interpretation as doubling the angle.

In other words, e^2πix has an interpretation as working with angles.

When you have that 2π in there, but not in the sin and cos expressions, you're using different angles for multiplication/exponentiation and for sin/cos.

Your left side shows that you are sticking with Arg(z) being in radians!

But on your right side, you have turns: the expression cos x + i sin x is literally saying that the point whose angle is x on the unit circle in the complex plane is the complex number .

But your left side essentially says that the Arg of this point: Arg(cos x + i sin x) is not x, but 2πx!

When we have a point on a unit circle whose Arg is x, then if we raise e to the power of ix, we get that point. That's what the original left hand says, without the pi.

You have a "trigonometric angle" and "Arg" that are separate, right in a fundamental equation.

Re: Turns are Better than Radians (2022)

#192

Earlier quoted context omitted.

It’s good to know you don’t want your house powered by AC power anymore. It’s a weird take, but you do you.

As I have already said, and I am an electronics engineer, the design of any electrical or electronic system, including anything that uses AC power, can be done faster and with less numerical errors, if instead of using complex exponentials one uses 2 other exponential functions: "2^x" and "1^x", with arguments and value domains as I have written above. Unfortunately, this requires the use of a custom library of trans…

A similar thought (about 1^x) had occurred to me, but I wasn't aware that it was common practice (in some field, at least).

Do you have a reference?

Re: Turns are Better than Radians (2022)

#193
post #175

Earlier quoted context omitted.

Right. I was hoping to highlight that difference with a joke.

Sometimes a person will tell a story which is untrue, with the purpose of bringing levity to a conversation. This may be termed a joke. These stories may also be used to illustrate a point. It's important to note that such cases are not always clearly signaled as being humor or untrue. It is a part of the joke's effect that the reader or listener will not at first know it is a joke, but will realize it after noticing…

It is important that they not be clearly signaled.

Re: Turns are Better than Radians (2022)

#194
post #106

Earlier quoted context omitted.

> with the special "m" constant for meters. Isn't the "special constant" exactly "value 1, type meters", defined as equal to "value type atoms" etc? If not, then what would be the result of the multiplication of 3 with "m"? > Of course, you can define the type `square meter` as well, and define `pow -> meters -> positive integer -> square meters` As long as your power is an integer, you can reduce it to multiplicatio…

> If not, then what would be the result of the multiplication of 3 with "m"? The answer is not, and the result of 3 multiplied by m is 3m. Just like 3 multiplied by pi is 3pi; or, perhaps more accurately, you can view m as a kind of vector unit, and 3m as the scalar product. Of course, none of this is exactly matching - dimensions are different from irrationals, vectors, complex numbers, etc, they are mostly a thing…

> dimensions are different from irrationals, vectors, complex numbers, etc, they are mostly a thing of their own.

I harbor a terrible internal mental model of dimensions which I have never really validated or explored fully, where I like to think they might be vector exponents, or something vaguely similar. If we assign each dimension to be a dimension of a vector - (length, mass, time, etc…) then a ‘distance’ might be e^((1,0,0,…)); a ‘duration’ e^((0,0,1,…)).

These have the requisite properties that when we multiply and divide them, we end up adding and subtracting these vectors.

So a distance times a distance is e^((2,0,0,…)) and a distance over a duration (a speed) is e^((1,0,-1,…))

They have the right basic algebraic behavior but who knows what terrible consequences they would have.

Re: Turns are Better than Radians (2022)

#196

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…

The radians provide absolute no help for your problem. There are alternative trigonometric functions with the argument measured in cycles that can be used instead of those with argument measured in radians. All formulae written with sin, cos and atan can be rewritten with sin2pi, cos2pi and atan2pi, or whatever names you want for those functions. Moreover, before the electronic computers, nobody in the entire history…

Some anecdotes to support and color your point.

The sin function has Indian and Greek roots. Part of that history is in the name 'sin' itself. I will let you all look that up. It's quite a funny story especially the jya to jayb bit.

This comment is about computation of sin in Indian mathematics and its definition.

The analogue of the sin function in Indian mathematics was a function from length to length. It was defined as the length of the half chord that corresponds to the angle, not of a unit radius circle but of a circle of radius 3438 units.

But why 3438 ?

That requires understanding the Indian system of measuring angles by length.

They wanted to have a numeric precision of 1 arc minute but weren't very fond of manipulating fractions. So they incorporated their requirement in how they standardized their circle -- Not by radius or diameter but by arc length. They chose that circle to be the standard for which the arc length of one arc minute is unit length.

If one does the math, it is 360 * 60 / 2π. Plugin the accuracy of π that was known to Indian mathematicians of that time you get a radius of 3438 units.

If you are curious about their numeric calculation of sin look up Aryabhatta and Bhaskara. Wikipedia is quite informative.

https://en.wikipedia.org/wiki/%C4%80ryabha%E1%B9%ADa's_sine_...

https://en.wikipedia.org/wiki/Bh%C4%81skara_I%27s_sine_appro...

Re: Turns are Better than Radians (2022)

#197

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…

The radians provide absolute no help for your problem. There are alternative trigonometric functions with the argument measured in cycles that can be used instead of those with argument measured in radians. All formulae written with sin, cos and atan can be rewritten with sin2pi, cos2pi and atan2pi, or whatever names you want for those functions. Moreover, before the electronic computers, nobody in the entire history…

> The radians became popular in the 19th century

Something akin to radians was widely used in ancient India. That is, sine tables constructed for a circle with circumference 360·60 (angular minutes) and radius 3438 ≈ 360·60/2π.

In Europe, radians per se developed in the early 18th century. What is true is that the name radian came about in the late 19th century.

> trigonometric functions with arguments in radians are harmful

Trigonometric functions are not inherently "harmful", but they are sometimes cumbersome. Changing the units doesn't make all that much practical difference.

Avoiding transcendental functions in favor of vector methods is often a good strategy though, especially in code.

Re: Turns are Better than Radians (2022)

#198

Earlier quoted context omitted.

The radians provide absolute no help for your problem. There are alternative trigonometric functions with the argument measured in cycles that can be used instead of those with argument measured in radians. All formulae written with sin, cos and atan can be rewritten with sin2pi, cos2pi and atan2pi, or whatever names you want for those functions. Moreover, before the electronic computers, nobody in the entire history…

> The radians became popular in the 19th century Something akin to radians was widely used in ancient India. That is, sine tables constructed for a circle with circumference 360·60 (angular minutes) and radius 3438 ≈ 360·60/2π. In Europe, radians per se developed in the early 18th century. What is true is that the name radian came about in the late 19th century. > trigonometric functions with arguments in radians are…

[deleted]

Re: Turns are Better than Radians (2022)

#200
post #144
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’ve been writing code for 46 years. Not once have I had to code a derivative. And for all the people who are concerned about how sin' 2πx = 2π cos 2πx, in actual code, it doesn’t matter. Let’s say that I’m writing a basic graphing function and I want to be able to display the slope of the sin curve at any point. I am not going to expose the turn-based units to the user. Caring about slopes implies that I’m doing cal…

> I’ve been writing code for 46 years. Not once have I had to code a derivative.

It sounds like discussions about "porting from math" do not pertain to you then?

Post reply on HN