Live data from Hacker News

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

blogs.scientificamerican.com

51–60 of 144 posts

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

#51
Anyone can explain the meaning behind this:

> When the Onion imitates real life, it's usually tragic.

linking to an article titled "Man Puts Glass Of Water On Bedside Table In Case He Needs To Make Huge Mess In Middle Of Night"?

Is the word "tragic" in the OP article here used jokingly, or is it a reference to an actually tragic event I don't know about?

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

#52

"goobledegook = e + 5.6. Wow you didn't know about goobledegook? Let me teach you about this revolutionary concept." I majored in mathematics and can say I've never heard of versine and have probably used it many times without knowing. I don't think everything needs a name.

> I don't think everything needs a name.

And you are wrong, at least historically: The article points that without the access to the computers and to achieve numerical precision having precalculated tables of such functions was of direct practical use.

Even if you personally and more recently didn't need that, the said names were needed and used, and that's why they exist.

Had you been you born, for example, more than 100 years ago, you could have been one of the persons assigned to spend maybe years just carefully calculating (or just verifying) the tables of one of those functions which today are seldom referenced by a name. Or at least with a job which involved using such tables (and the names too).

Also, in current computing practice, one can still write programs which produce wrong results if one is not aware of the limits of the partial numerical calculations, including these named. One doesn't have to know the names, but in some specific cases it could be needed to have separate functions calculating exactly the values of the functions named. As we start to discover again that the custom processors could calculate more with less binary digits, knowing this becomes even more important compared to the times where "just use doubles" was enough.

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

#54

Earlier quoted context omitted.

I recently learned about the existence of the Prosthaphaeresis algorithm [0], an even more ancient and obsolete trigonometric calculation technique. It allows you to use a trig table to do calculations when you don't have a log table. To calculate a x b , find arccos( a ) and arccos( b ), then use the product-to-sum formula: cos( a ) x cos( b ) = 1/2 x [cos( a + b ) + cos( a - b )]. For example, to calculate 42949672…

Prosthaphaeresis works because an angle measure inherently is a type of logarithm. It’s the logarithm of a rotation, instead of the logarithm of a scale. Like other kinds of logarithms, this converts multiplication (composition of rotations) to addition (addition of angle measures). If you want to multiply two numbers, you can treat them as rotations, take the logarithm of each (i.e. find the angle measure), add the…

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://mathworld.wolfram.com/ProsthaphaeresisFormulas.html

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

#56

Earlier quoted context omitted.

> 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.

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.

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

#57
post #51

Anyone can explain the meaning behind this: > When the Onion imitates real life, it's usually tragic. linking to an article titled "Man Puts Glass Of Water On Bedside Table In Case He Needs To Make Huge Mess In Middle Of Night"? Is the word "tragic" in the OP article here used jokingly, or is it a reference to an actually tragic event I don't know about?

[deleted]

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

#58
post #16

I'm not that old, but I learned the haversine formula in a marine navigation class I took through (boy) scouts. Our instructor was a retired merchant navy officer who was somewhat upset that the curriculum didn't include it, and deemed that we should know it. My A-level (≈ AP) maths teacher was mildly amused that I knew it and digressed about log tables. We were (I believe) the last cohort to be issued log-tables, bu…

> given the choice in examinations between log-tables, slide-rule, or calculator, we all made the same choice Students would benefit greatly if given a slide rule instead of an electronic calculator for their exams. The former is an effective teacher which viscerally reveals crucial insights, while the latter is pedagogically almost useless; using an electronic calculator to solve problems consists of nothing beyond…

When I did my A-levels, we were taught to give answers as surds the exams usually asked for this when we were doing trig and it was generally accepted to give answers as fractions so I think I ended up using my expensive graphic calculator once or twice in 6 hours of maths exams.

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

#59
post #48

Earlier quoted context omitted.

> given the choice in examinations between log-tables, slide-rule, or calculator, we all made the same choice Students would benefit greatly if given a slide rule instead of an electronic calculator for their exams. The former is an effective teacher which viscerally reveals crucial insights, while the latter is pedagogically almost useless; using an electronic calculator to solve problems consists of nothing beyond…

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 are 5%; the parameters that characterize transistors, say, frequently are known only to a factor of two); (b) one mark of a good circuit design is insensitivity of the finished circuit to precise values of the components (there are exceptions, of course). You'll also learn circuit intuition more quickly if you get into the habit of doing approximate calculations in your head, rather than watching meaningless numbers pop up on a calculator display.

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

#60
post #7

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/

Yup, I felt incredibly stupid about six months ago finding out about atan2 for the first time, given the number of times I've made stupid errors using atan, and then correcting those errors by manually checking what quadrant I was in.

Same.

My favorite "looks simple but is hard" task is "given object position and angle and target position return +1 if the object should turn clockwise and -1 if the object should turn counterclockwise to face the target".

I've got it subtly wrong so many times and using atan2 only solves half the problems. Now I just copypaste it from my previous game :)

Post reply on HN