atan2 for quaternions?greenspun.com : LUSENET : quaternions : One Thread
Hello - straight to point - Maple 7 defines the arctangent for 2 complex arguments -> arctan(a+I*b,c+I*d) -> the answer is really long if fully expanded, I won't write it hear. Question is, has such a function been defined for quaternions? If so, what is the definition? Would be cool because then I avoid dividing by zero, no special cases. Even if the answer is 10 pages long, as long as it is known, please let me know the formula/equation! Thanks in advance.
-- Robert Blair Aldridge III (email@example.com), September 10, 2003
Don't think I have an answer for you, but do have a few thoughts, even some animations to look at.
I have figured out how to translate a wide variety of unary complex trig functions into quaternions. For a complete list of the algebra, go here:
On to your specific question. The tangent function has a periodicity of pi, not two pi. This means that the points are double-valued. Tangent's inverse, ArcTan, also has a period of pi. If one takes the ArcTan of 5/5, the angle in radians is pi/4, or 45 degrees. What upsets people is the ArcTan of (-5)/(-5) is the same. "That's in the lower quadrant!" they shout. I want to stay away from any function where 1 and 1 written another way gives a different value.
ArcTan is a unary function, taking only one number ever. ArtTan2 is binary. In Mathematica at least, including the imaginary part of the number does not change the result of ArcTan2 in any way (test if that is the case for Maple too). Basically it calculates Artcan (a/b) and then figures out if it needs to add pi to a depending on the quadrant a and b are in.
Quaternions are essentially three complex numbers that share a real number. For the quaternion (t, x, y, z), one could determine the quadrant (t, x) was in.the third quadrant, where both were negative. The next complex number, (t, y), t is negative, but y could be either negative or positive. Looks like the real t axis must be verticle, so that (t, y) is in the third or fourth quadrant, and one will need to add in pi.
That's about all I can figure out for now.
If you are into number driven animations, you might want to look at how I have animated complex and quaternion trig functions. Definietly an odd form of entertainment. I doubt your profs have ever seen anything like it, because it is not vector or pixel based. Instead it uses quaternions for all input and output. You will need a Mozilla based browser (ie NOT IE) such as Netscape 7.
Dynamic graphs URL: http://sdm.openacs.org/wp/display/1238/
-- Doug Sweetser (firstname.lastname@example.org), September 11, 2003.