
Lecture 8 Quaternions Overview, motivation Background Definition and Lecture 8 properties Rotation using unit Quaternions quaternions Intuition Using quaternions to represent Matthew T. Mason rotations Why we love quaternions. Mechanics of Manipulation Lecture 8 Today’s outline Quaternions Overview, Overview, motivation motivation Background Definition and Background properties Rotation using unit quaternions Definition and properties Intuition Using quaternions to represent Rotation using unit quaternions rotations Why we love quaternions. Intuition Using quaternions to represent rotations Why we love quaternions. Lecture 8 Motivation Quaternions Overview, motivation Background Definition and Motivation properties Rotation using unit quaternions I Quaternions have nice geometrical interpretation. Intuition I Quaternions have advantages in representing Using quaternions to represent rotation. rotations I Quaternions are cool. Even if you don’t want to use Why we love quaternions. them, you might need to defend yourself from quaternion fanatics. 3 Lecture 8 Why can’t we invert vectors in R ? Quaternions Overview, motivation Background 1 Definition and I We can invert reals. x × x = 1. properties 2 Rotation using unit I We can invert elements of R using complex quaternions ∗ 2 ∗ numbers. z × z =jzj = 1, where is complex Intuition conjugate. Using quaternions 3 to represent I Can we invert v 2 R ? rotations I No. Why we love quaternions. 4 I How about v 2 R ? 4 I Yes! Hamilton’s quaternions are to R what complex numbers are to R2. Lecture 8 Complex numbers versus quaternions Quaternions Definition (Complex numbers) Overview, motivation I Define basis elements 1 and i; Background Definition and I Define complex numbers as a vector space over properties reals: elements have the form x + iy; Rotation using unit quaternions 2 I One more axiom required: i = −1. Intuition Using quaternions to represent Definition (Quaternions) rotations Why we love quaternions. I Define basis elements 1, i, j, k; I Define quaternions as a vector space over reals: elements have the form q0 + q1i + q2j + q3k; I One more axiom: i2 = j2 = k 2 = ijk = −1 Lecture 8 Basis element multiplication Quaternions Overview, From that one axiom, we can derive other products: motivation Background ijk = −1 Definition and properties i(ijk) = i(−1) Rotation using unit quaternions − = − jk i Intuition jk = i Using quaternions to represent rotations Writing them all down: Why we love quaternions. ij = k; ji = −k jk = i; kj = −i ki = j; ik = −j Quaternion products of i; j; k behave like cross product. Lecture 8 Quaternion notation Quaternions Overview, motivation Background We can write a quaternion several ways: Definition and properties q = q0 + q1i + q2j + q3k Rotation using unit quaternions q = (q0; q1; q2; q3) Intuition q = q + q Using quaternions 0 to represent rotations Why we love Definition (Scalar part; vector part) quaternions. For quaternion q0 + q, q0 is the scalar part and q is the vector part Lecture 8 Quaternion product Quaternions Overview, We can write a quaternion product several ways: motivation Background Definition and pq = (p0 + p1i + p2j + p3k)(q0 + q1i + q2j + q3k) properties = (p0q0 − p1q1 − p2q2 − p3q3) + ::: i + ::: j + ::: k Rotation using unit quaternions pq = (p0 + p)(q0 + q) Intuition = (p q + p q + q p + pq) Using quaternions 0 0 0 0 to represent rotations The last product includes many different kinds of product: Why we love quaternions. product of two reals, scalar product of vectors. But what is pq? Cross product? Dot product? Both! Cross product minus dot product! pq = (p0q0 − p · q + p0q + q0p + p × q) Lecture 8 Conjugate, length Quaternions Definition (Conjugate) Overview, motivation ∗ Background q = q0 − q1i − q2j − q3k Definition and properties Rotation using unit Note that quaternions Intuition ∗ qq = (q0 + q)(q0 − q) Using quaternions to represent 2 rotations = q0 + q0q − q0q − qq 2 Why we love = q0 + q · q − q × q quaternions. 2 2 2 2 = q0 + q1 + q2 + q3 Definition (Length) q p ∗ 2 2 2 2 jqj = qq = q0 + q1 + q2 + q3 Lecture 8 Quaternion inverse Quaternions Overview, motivation Every quaternion except 0 has an inverse: Background q∗ Definition and −1 = properties q 2 jqj Rotation using unit quaternions Without commutativity, quaternions are a division ring, or Intuition Using quaternions a non-commutative field, or a skew field. to represent Just as complex numbers are an extension of the reals, rotations Why we love quaternions are an extension of the complex numbers quaternions. (and of the reals). If 1D numbers are the reals, and 2D numbers are the complex numbers, then 4D numbers are quaternions, and that’s all there is. (Frobenius) (Octonions are not associative.) Lecture 8 Rotation using unit quaternions Quaternions Overview, motivation Background Definition and I Let q be a unit quaternion, i.e. jqj = 1. properties Rotation using unit I It can be expressed as quaternions θ θ Intuition q = cos + sin n^ Using quaternions 2 2 to represent rotations I Let x = 0 + x be a “pure vector”. Why we love 0 ∗ quaternions. I Let x = qxq . 0 I Then x is the pure vector rot(θ; n^)x!!! Lecture 8 Proof that unit quaternions work Quaternions Overview, motivation Background Definition and properties ∗ Rotation using unit I Expand the product qxq ; quaternions I Apply half angle formulas; Intuition Using quaternions I Simplify; to represent rotations I Compare with Rodrigues’s formula. Why we love quaternions. Sadly, not all proofs confer insight. ∗ Lecture 8 Why θ=2? Why qxq instead of qx? Quaternions Overview, In analogy with complex numbers, why not use motivation Background p = cos θ + n^ sin θ Definition and properties 0 x = px Rotation using unit quaternions Intuition To explore that idea, define a map Lp(q) = pq. Note that Using quaternions Lp(q) can be written: to represent rotations 0 1 0 1 Why we love p0 −p1 −p2 −p3 q0 quaternions. B p1 p0 −p3 p2 C B q1 C Lp(q) = B C B C @ p2 p3 p0 −p1 A @ q2 A p3 −p2 p1 p0 q3 Note that the matrix above is orthonormal. Lp is a rotation of Euclidean 4 space! Lecture 8 Geometrical explanation Quaternions Although Lp(q) rotates the 4D space of quaternions, it is Overview, not a rotation of the 3D subspace of pure vectors. Some motivation Background of the 3D subspace leaks into the fourth dimension. Definition and Consider an example using p = i. Is it a rotation about i properties Rotation using unit of π=2? quaternions Intuition Using quaternions to represent Li qiq iqiLR q Ri qqi i i rotations i iiWhy we love no quaternions. 1- i plane 2 2 rotation 1 1 1 k k k j- k plane 2 2 j jj Lecture 8 What do we do with a representation? Quaternions ∗ Rotate a point: qxq . Overview, motivation Compose two rotations: Background Definition and q(pxp∗)q∗ = (qp)x(qp)∗ properties Rotation using unit quaternions Convert to other representations: Intuition I From axis-angle to quaternion: Using quaternions to represent rotations θ θ q = cos + sin n^ Why we love 2 2 quaternions. I From quaternion to axis-angle: −1 θ = 2 tan (jqj; q0) n^ = q=jqj assuming θ is nonzero. Lecture 8 From quaternion to rotation matrix Quaternions Overview, motivation Background Definition and properties Just expand the product Rotation using unit quaternions qxq∗ = Intuition 0 2 2 2 2 1 Using quaternions q0 + q1 − q2 − q3 2(q1q2 − q0q3) 2(q1q3 + q0q2) to represent 2 2 2 2 rotations @ 2(q1q2 + q0q3) q0 − q1 + q2 − q3 2(q2q3 − q0q1) A x 2 2 2 2 Why we love 2(q1q3 − q0q2) 2(q2q3 + q0q1) q0 − q1 − q2 + q3 quaternions. Lecture 8 From rotation matrix to quaternion Quaternions Overview, Given R = (rij ), solve expression on previous slide for motivation quaternion elements qi Background Definition and Linear combinations of diagonal elements seem to solve properties the problem: Rotation using unit quaternions Intuition 2 1 q0 = (1 + r11 + r22 + r33) Using quaternions 4 to represent rotations 2 1 q1 = (1 + r11 − r22 − r33) Why we love 4 quaternions. 1 q2 = (1 − r + r − r ) 2 4 11 22 33 1 q2 = (1 − r − r + r ) 3 4 11 22 33 so take four square roots and you’re done? You have to figure the signs out. There is a better way ::: Lecture 8 Look at the off-diagonal elements Quaternions Overview, I motivation 1 Background q0q1 = (r32 − r23) Definition and 4 properties 1 q q = (r − r ) Rotation using unit 0 2 4 13 31 quaternions 1 Intuition q0q3 = (r21 − r12) Using quaternions 4 to represent 1 rotations q1q2 = (r12 + r21) Why we love 4 quaternions. 1 q q = (r + r ) 1 3 4 13 31 1 q q = (r + r ) 2 3 4 23 32 I Given any one qi , could solve the above for the other three. Lecture 8 The procedure Quaternions Overview, motivation 1. Use first four equations to find the largest q2. Take its Background i Definition and square root, with either sign. properties Rotation using unit 2. Use the last six equations (well, three of them quaternions anyway) to solve for the other qi . Intuition Using quaternions to represent I That way, only have to worry about getting one sign rotations right. Why we love quaternions. I Actually q and −q represent the same rotation, so no worries about signs. I Taking the largest square root avoids division by small numbers. Lecture 8 Properties of unit quaternions Quaternions Overview, motivation Background Definition and properties Rotation using unit 4 quaternions I Unit quaternions live on the unit sphere in R . Intuition I Quaternions q and −q represent the same rotation. Using quaternions ∗ to represent I Inverse of rotation q is the conjugate q . rotations Why we love I Null rotation, the identity, is the quaternion 1.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages24 Page
-
File Size-