Live data from Hacker News

Obsolete trig functions and why we don't use them anymore (2013)

blogs.scientificamerican.com

71–80 of 144 posts

Re: Obsolete trig functions and why we don't use them anymore (2013)

#71

Earlier quoted context omitted.

Is there a more general definition of logarithms than being the inverse of the exponential function? Mathworld says Prosthapharesis formulas "convert a product of functions into a sum or difference" [0], which resembles a property of logarithms (i.e. log(ab) == log(a) + log(b)). However I don't quite get how angle measurement itself is a type of logarithm. Maybe something to do with Euler's formula? [0] https://mathw…

Starting for Euler's formula you can write cos(x) = (exp(ix) + exp(-ix))/2 so the cosine is in some sense a "type of exponential". If the cosine is a type of exponential then its inverse (the function that takes you to the angle measurement) is inherently a "type of logarithm". This is a very handwavey statement. I would say a more precise statement is that the proper exponential and log maps are the "correct" thing…

The angle measure i acos(x) is the logarithm of the rotation x + i√(1 − x²).

If you want to compute the product of two rotations, you can take logarithms and rewrite it as a sum of angle measures:

[x + i√(1 − x²)][y + i√(1 − y²)] = exp(i acos(x) + i acos(y))

[x + i√(1 − x²)][y − i√(1 − y²)] = exp(i acos(x) − i acos(y))

Now if you just look at the real parts, you can write:

xy − √(1 − x²)√(1 − y²) = cos(acos(x) + acos(y))

xy + √(1 − x²)√(1 − y²) = cos(acos(x) − acos(y))

Taking the sum on each side:

2xy = cos(acos(x) + acos(y)) + cos(acos(x) − acos(y))

This method is rather more cumbersome (due to rescaling and then converting the factors to rotations as an intermediate step) but fundamentally based on the same concept as:

xy = exp(log(x) + log(y))

Re: Obsolete trig functions and why we don't use them anymore (2013)

#73

atan2() is incredibly useful in game development. You can use it to determine the angle between objects, calculate the angle of a 2d vector, and other useful things. https://ryankubik.com/blog/atan2/

> atan2() is incredibly useful in game development Why game development? It's useful everywhere! I have never found a genuine usage of atan(), it's always atan2() that is natural to use.

[deleted]

Re: Obsolete trig functions and why we don't use them anymore (2013)

#74
post #48

Earlier quoted context omitted.

What I liked is the awareness of the inexactness which is inherent in everything but which slide rules made more obvious. The joke from these times was "ask an engineer what is 2 times 3 and he'll take out his slide rule and say between 5.9 and 6.1" Whoever thought that up maybe wanted to show how the engineers just use tools and don't think, but I've seen the opposite: it was some with just a theoretical mathematica…

The Art of Electronics warns the reader in the first chapter: > There is a tendency among beginners to want to compute resistor values and other circuit component values to many significant places, and the availability of inexpensive calculators has only made matters worse. There are two reasons you should try to avoid falling into this habit: (a) the components themselves are of finite precision (typical resistors a…

There's a small book called "Errors of Observation and Their Treatment", ISBN 978-94-011-6928-8, which seemed dull in class but it emphasized being able to express and defend a numerical result as x +/- y . I did that thereafter and it made a lot of difference in my understanding of the result. It isn't done by many engineers any more, and I always look with suspicion on results claiming absurd precision. There isn't so much understanding there and people who engage in it are much more likely to submit work with multiple order-of-magnitude errors. They do not -know- the answer, they accept the line on the screen un-critically.

Re: Obsolete trig functions and why we don't use them anymore (2013)

#75

Earlier quoted context omitted.

As on example, to find longitude and latitude on a sphere from stereographic projection (given as Cartesian coordinates) you need both: [ x, y ] ↦ [ atan2(y, x), π/2 − 2 atan(√(x² + y²)) ] But atan per se comes up all over the place if you start doing much work with angle measures.

shouldn't that be atan(1/sqrt(x^2+y^2))? In that case, I'd still use atan2 with y=1.

[deleted]

Re: Obsolete trig functions and why we don't use them anymore (2013)

#76

haversine is incredibly useful when you're doing quick distance calculations between points on the Earth though...

But first everyone must agree on the radius of the earth!

And if the distances are known to be small it may be quicker to calculate the chord length.

Re: Obsolete trig functions and why we don't use them anymore (2013)

#77
post #69

Let me teach you a secret: You don't need to memorize any trig identities, you just need to know Euler's formula and one or two more facts: exp(ix) = cos(x) + i*sin(x) [cos(x)]^2 + [sin(x)]^2 = 1 i*i = -1 That is, the complex number exp(ix), which lies on the unit circle in the complex plane, has real component cos(x) and imaginary component sin(x). Consequently, the line from 0 to exp(ix) in the complex plane makes…

As the math teacher at the first year of university once said: "i know two things: [cos(x)]^2 + [sin(x)]^2 = 1 i*i = -1 but can re-derive all the rest"

Good luck deriving group theory from that. :)

(Though, yes, there's a bit of a connection with group theory, but not enough to help you.)

Re: Obsolete trig functions and why we don't use them anymore (2013)

#78
post #69

Let me teach you a secret: You don't need to memorize any trig identities, you just need to know Euler's formula and one or two more facts: exp(ix) = cos(x) + i*sin(x) [cos(x)]^2 + [sin(x)]^2 = 1 i*i = -1 That is, the complex number exp(ix), which lies on the unit circle in the complex plane, has real component cos(x) and imaginary component sin(x). Consequently, the line from 0 to exp(ix) in the complex plane makes…

As the math teacher at the first year of university once said: "i know two things: [cos(x)]^2 + [sin(x)]^2 = 1 i*i = -1 but can re-derive all the rest"

From these two facts, you can come to the conclusion that sin(x) == 0 and cos(x) == 1, for any x. I.e., you need to know more.

Re: Obsolete trig functions and why we don't use them anymore (2013)

#79
post #69

Let me teach you a secret: You don't need to memorize any trig identities, you just need to know Euler's formula and one or two more facts: exp(ix) = cos(x) + i*sin(x) [cos(x)]^2 + [sin(x)]^2 = 1 i*i = -1 That is, the complex number exp(ix), which lies on the unit circle in the complex plane, has real component cos(x) and imaginary component sin(x). Consequently, the line from 0 to exp(ix) in the complex plane makes…

As the math teacher at the first year of university once said: "i know two things: [cos(x)]^2 + [sin(x)]^2 = 1 i*i = -1 but can re-derive all the rest"

My math teacher was in love with the Euler's identity written like this: 1+e^(i*pi) = 0

He said it relates the most important numbers and constants of the universe. He had it embroidered and framed on his office wall

Re: Obsolete trig functions and why we don't use them anymore (2013)

#80

atan2() is incredibly useful in game development. You can use it to determine the angle between objects, calculate the angle of a 2d vector, and other useful things. https://ryankubik.com/blog/atan2/

Nitpick: this blog post makes an incorrect statement, namely that the domain of the inverse tangent function is -pi/2 to pi/2.

The domain of a function is the set of all possible inputs. In particular, the domain of the inverse tangent consists of all real numbers.

The author means the range.

Post reply on HN