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 .
Obsolete trig functions and why we don't use them anymore (2013)
121–130 of 144 posts
Re: Obsolete trig functions and why we don't use them anymore (2013)
#122Earlier quoted context omitted.
I generally just know that any trig formula can be converted to quite a few different other ones visa trig identities. Whether a certain expression is more or less complex than another is a matter of perspective and context. If I'm stuck with a trig function I don't know what to do with, I just look on Wikipedia for a trig identity and don't worry about derivations or memorization. This trick is good for exam setting…
What kind of exam requires you to memorize trig identities? Were they trying to prepare you for a world without paper or computers to look them up on? Or to be a smidgen faster at hand calculations?
Yes, most high schools spend a few months teaching “trigonometry” as a system for simplifying formulas that was primarily useful historically to save time for human calculators working with pen/paper and a printed lookup table. In the modern world this is entirely anachronistic and the content could be profitably compressed down to a couple weeks, with the saved time spent on something else. The main remaining utility is as rather cumbersome, unpleasant, and unenlightening algebra practice.
Re: Obsolete trig functions and why we don't use them anymore (2013)
#123Earlier quoted context omitted.
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
The part that makes the expression flashy is that the rotation is written via its logarithm, which can be represented as the length of a circular arc (“angle measure”).
It’s a useful fact to know, but is vastly overrated.
Re: Obsolete trig functions and why we don't use them anymore (2013)
#124Earlier quoted context omitted.
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 :)
That is, if your direction is the vector (a, b), and the displacement to the target is the vector (c, d), you can compute ad – bc. If this quantity is positive turn left, else turn right.
Re: Obsolete trig functions and why we don't use them anymore (2013)
#125"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 think the point of these was for when they read low-precision values out of a printed table and then multiplied them using slide rules. Even though the article doesn't say it, I can't think of any other practical reason to multiply by adding logarithms.
Re: Obsolete trig functions and why we don't use them anymore (2013)
#126Earlier quoted context omitted.
I generally just know that any trig formula can be converted to quite a few different other ones visa trig identities. Whether a certain expression is more or less complex than another is a matter of perspective and context. If I'm stuck with a trig function I don't know what to do with, I just look on Wikipedia for a trig identity and don't worry about derivations or memorization. This trick is good for exam setting…
What kind of exam requires you to memorize trig identities? Were they trying to prepare you for a world without paper or computers to look them up on? Or to be a smidgen faster at hand calculations?
In the same sense that doing this work by hand will build depth of understanding, I know that remembering the trig identities came before really understanding their relationships. And that also came far before I could truly understand Euler's formula, radians, etc.
Re: Obsolete trig functions and why we don't use them anymore (2013)
#127Earlier quoted context omitted.
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://mathw…
Re: Obsolete trig functions and why we don't use them anymore (2013)
#128Earlier quoted context omitted.
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 .
I wish we used different words for domain and range. Like "input range" and "output range" or something. It's an endless source of confusion, especially since range can legitimately be used for the domain if you phrase it like "the range of values we can use for the input of the inverse tangent function is -infinity to infinity."
https://gowers.wordpress.com/2011/10/13/domains-codomains-ra...
Re: Obsolete trig functions and why we don't use them anymore (2013)
#129Earlier quoted context omitted.
It kind of helps a non Mathie like me doing trig. But I'll ask fof one better: I would love an application that lets me plug in what I have (coords and angles), what I want, and for it to show me how to get it.
Does it? No one does this: var STRAWBERRY_PI = 1 + Math.PI; For example, no one doing math will use τ (2𝛑) and 𝛑 simultaneously. Choose one or the other, otherwise you are increasing the number of symbols someone has to learn to understand your math. Naming everything is overwhelming. Mathematics is about similarities, not differences. If the transformation is trivial, then don't bother creating a new symbol. It wi…
Re: Obsolete trig functions and why we don't use them anymore (2013)
#130Earlier quoted context omitted.
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…