From cbloom@cbloom.com Thu Dec 12 22:38:46 2002 Date: Sun, 10 Nov 2002 12:41:26 -0800 From: Charles Bloom To: Casey Muratori , Jonathan Blow Cc: cbloom@cbloom.com Subject: Re: (very) rough draft At 12:21 PM 11/10/2002 -0800, Charles Bloom wrote: >Consider two vectors in the exponential map : > >r1 = n1 * theta1 >r2 = n2 * theta2 > >Here the "n" are unit vectors an the theta are angles in [0,pi]. >Each rotation has a "mirror" that must be considered : > >r1' = n1 * (theta1 - 2pi) >r2' = n2 * (theta2 - 2pi) It's useful to compare this to what you have to do with quats. With quats, you start with two rotations {q1,q2}. You need to consider the mirrors -q1 and -q2. You have to consider q1->q2, q1->(-q2), q2->(-q1), and (-q1)->(-q2) Neatly enough, there are actually only two cases here, since q1->(-q2) is the same as q2->(-q1) and (-q1)->(-q2) is the same as q1->q2 So, to get the shortest path, all you have to do is : z = q1 DOT q2 if z >= 0 , use q1->q2 else , use q1->(-q2) Note that this is also a better distance metric. The proper distance metric for rotations is the length of the geodesic between them on the surface of S3. This is just acos(z) for quats, so using "z" means you are correctly choosing the shorter geodesic. In the exponential map, it's not even clear that you *want* to choose the shorter geodesic, since interpolation doesn't go across geodesics on S3. ------------------------------------------------------- Charles Bloom cb@cbloom.com http://www.cbloom.com