Lecture 7. Quaternions

Similar documents
Complex Numbers and Quaternions for Calc III

Matrices and Vectors

Quaternions and Groups

sin(α + θ) = sin α cos θ + cos α sin θ cos(α + θ) = cos α cos θ sin α sin θ

ECS 178 Course Notes QUATERNIONS

Introduction to quaternions

QUATERNIONS AND ROTATIONS

Geometry of the Special Unitary Group

INNER PRODUCT SPACE. Definition 1

Course 2BA1: Hilary Term 2007 Section 8: Quaternions and Rotations

Leandra Vicci. Microelectronic Systems Laboratory. Department of Computer Science. University of North Carolina at Chapel Hill. 27 April 2001.

Algebra I Fall 2007

ECS130 Scientific Computing. Lecture 1: Introduction. Monday, January 7, 10:00 10:50 am

Quaternions. Basilio Bona. Semester 1, DAUIN Politecnico di Torino. B. Bona (DAUIN) Quaternions Semester 1, / 40

Linear Algebra Review. Vectors

Special Lecture - The Octionions

Linear Algebra Massoud Malek

33AH, WINTER 2018: STUDY GUIDE FOR FINAL EXAM

Closed-Form Solution Of Absolute Orientation Using Unit Quaternions

Why Transforms? Want to animate objects and camera Translations Rotations Shears And more.. Want to be able to use projection transforms

Lecture 02: 2D Geometry. August 24, 2017

Math 3108: Linear Algebra

1 Matrices and Systems of Linear Equations

Quaternions. R. J. Renka 11/09/2015. Department of Computer Science & Engineering University of North Texas. R. J.

LECTURE 16: LIE GROUPS AND THEIR LIE ALGEBRAS. 1. Lie groups

BSc (Hons) in Computer Games Development. vi Calculate the components a, b and c of a non-zero vector that is orthogonal to

Linear Algebra March 16, 2019

Lie Algebra of Unit Tangent Bundle in Minkowski 3-Space

,, rectilinear,, spherical,, cylindrical. (6.1)

Lecture Notes 1: Vector spaces

Vectors. September 2, 2015

Physically Based Rendering ( ) Geometry and Transformations

Math 350 Fall 2011 Notes about inner product spaces. In this notes we state and prove some important properties of inner product spaces.

Clifford Algebras and Spin Groups

Course MA2C02, Hilary Term 2010 Section 4: Vectors and Quaternions

Group, Rings, and Fields Rahul Pandharipande. I. Sets Let S be a set. The Cartesian product S S is the set of ordered pairs of elements of S,

On complexified quantum mechanics and space-time

I = i 0,

1. What is the determinant of the following matrix? a 1 a 2 4a 3 2a 2 b 1 b 2 4b 3 2b c 1. = 4, then det

REPRESENTATION THEORY WEEK 7

Outline. Linear maps. 1 Vector addition is commutative: summands can be swapped: 2 addition is associative: grouping of summands is irrelevant:

DS-GA 1002 Lecture notes 0 Fall Linear Algebra. These notes provide a review of basic concepts in linear algebra.

Dot Products, Transposes, and Orthogonal Projections

Quaternions and Octonions

Linear Algebra. Workbook

Linear Algebra Review

AMS526: Numerical Analysis I (Numerical Linear Algebra)

Linear Algebra. Min Yan

Review of Coordinate Systems

Vectors and matrices: matrices (Version 2) This is a very brief summary of my lecture notes.

EXERCISES ON DETERMINANTS, EIGENVALUES AND EIGENVECTORS. 1. Determinants

j=1 [We will show that the triangle inequality holds for each p-norm in Chapter 3 Section 6.] The 1-norm is A F = tr(a H A).

BASIC NOTIONS. x + y = 1 3, 3x 5y + z = A + 3B,C + 2D, DC are not defined. A + C =

What is the Matrix? Linear control of finite-dimensional spaces. November 28, 2010

MATH 315 Linear Algebra Homework #1 Assigned: August 20, 2018

18.312: Algebraic Combinatorics Lionel Levine. Lecture 22. Smith normal form of an integer matrix (linear algebra over Z).

Vectors To begin, let us describe an element of the state space as a point with numerical coordinates, that is x 1. x 2. x =

Vectors. Section 3: Using the vector product

Rotational motion of a rigid body spinning around a rotational axis ˆn;

Introduction to Lie Groups

Linear Algebra Prof. Dilip P Patil Department of Mathematics Indian Institute of Science, Bangalore

Advanced Engineering Mathematics Prof. Pratima Panigrahi Department of Mathematics Indian Institute of Technology, Kharagpur

Modern Algebra Prof. Manindra Agrawal Department of Computer Science and Engineering Indian Institute of Technology, Kanpur

Notes for FP3 matrices and vectors

Quadrature for the Finite Free Convolution

The Matrix Representation of a Three-Dimensional Rotation Revisited

Math 520 Exam 2 Topic Outline Sections 1 3 (Xiao/Dumas/Liaw) Spring 2008

Subalgebras of the Split Octonions

A (Mostly) Linear Algebraic Introduction to Quaternions

MA232A Euclidean and Non-Euclidean Geometry School of Mathematics, Trinity College Michaelmas Term 2017 Vector Algebra and Spherical Trigonometry

CP3 REVISION LECTURES VECTORS AND MATRICES Lecture 1. Prof. N. Harnew University of Oxford TT 2013

FFTs in Graphics and Vision. Groups and Representations

4.7 The Levi-Civita connection and parallel transport

2D Geometry. Tuesday September 2 rd, 2014.

carroll/notes/ has a lot of good notes on GR and links to other pages. General Relativity Philosophy of general

1 Fields and vector spaces

Linear Algebra Review

Physics 331 Introduction to Numerical Techniques in Physics

Linear Algebra 2 Spectral Notes

Matrices over Hyperbolic Split Quaternions

Chapter 8 Vectors and Scalars

Math 4310 Solutions to homework 7 Due 10/27/16

Lecture # 3 Orthogonal Matrices and Matrix Norms. We repeat the definition an orthogonal set and orthornormal set.

LINEAR ALGEBRA BOOT CAMP WEEK 4: THE SPECTRAL THEOREM

REPRESENTATION THEORY WEEK 5. B : V V k

Quaternions and their applications

PHYS 705: Classical Mechanics. Rigid Body Motion Introduction + Math Review

Matrix Algebra for Engineers Jeffrey R. Chasnov

DUAL SPLIT QUATERNIONS AND SCREW MOTION IN MINKOWSKI 3-SPACE * L. KULA AND Y. YAYLI **

Math Problem set # 7

A Brief History of Ring Theory. by Kristen Pollock Abstract Algebra II, Math 442 Loyola College, Spring 2005

Rotation outline of talk

Understanding Quaternions: Rotations, Reflections, and Perspective Projections. Ron Goldman Department of Computer Science Rice University

Chapter XI Novanion rings

Chapter 2 Math Fundamentals

Quaternion Algebras. Properties and Applications. Rob Eimerl. May 5th, University of Puget Sound. 1 Department of Mathematics

Vectors and Coordinate Systems

Numerical Linear Algebra

Geometric and Arithmetic Aspects of Homogeneous Dynamics

PROFESSOR ANDREY MISHCHENKO S MATH 296 LECTURE NOTES JANUARY 24 28, 2011

Transcription:

Matthew T. Mason Mechanics of Manipulation Spring 2012

Today s outline

Motivation Motivation have nice geometrical interpretation. have advantages in representing rotation. are cool. Even if you don t want to use them, you might need to defend yourself from quaternion fanatics.

Why can t we invert vectors in R 3? We can invert reals. x 1 x = 1. We can invert elements of R 2 using complex numbers. z z / z 2 = 1, where is complex conjugate. Can we invert v R 3? No. How about v R 4? Yes! Hamilton s are to R 4 what complex numbers are to R 2.

Complex numbers versus Definition (Complex numbers) Define basis elements 1 and i; Define complex numbers as a vector space over reals: elements have the form x + iy; One more axiom required: i 2 = 1. Definition () Define basis elements 1, i, j, k; Define as a vector space over reals: elements have the form q 0 + q 1 i + q 2 j + q 3 k; One more axiom: i 2 = j 2 = k 2 = ijk = 1

Basis element multiplication From that one axiom, we can derive other products: ijk = 1 i(ijk) = i( 1) jk = i jk = i Writing them all down: ij = k, ji = k jk = i, kj = i ki = j, ik = j Quaternion products of i, j, k behave like cross product.

Quaternion notation We can write a quaternion several ways: q = q 0 + q 1 i + q 2 j + q 3 k q = (q 0, q 1, q 2, q 3 ) q = q 0 + q Definition (Scalar part; vector part) For quaternion q 0 + q, q 0 is the scalar part and q is the vector part

Quaternion product We can write a quaternion product several ways: pq = (p 0 + p 1 i + p 2 j + p 3 k)(q 0 + q 1 i + q 2 j + q 3 k) = (p 0 q 0 p 1 q 1 p 2 q 2 p 3 q 3 ) +... i +... j +... k pq = (p 0 + p)(q 0 + q) = (p 0 q 0 + p 0 q + q 0 p + pq) The last product includes many different kinds of product: product of two reals, scalar product of vectors. But what is pq? Cross product? Dot product? Both! Cross product minus dot product! pq = (p 0 q 0 p q + p 0 q + q 0 p + p q)

Conjugate, length Definition (Conjugate) Note that q = q 0 q 1 i q 2 j q 3 k qq = (q 0 + q)(q 0 q) = q0 2 + q 0q q 0 q qq = q0 2 + q q q q = q0 2 + q2 1 + q2 2 + q2 3 Definition (Length) q = qq = q 2 0 + q2 1 + q2 2 + q2 3

Quaternion inverse Every quaternion except 0 has an inverse: q 1 = q q 2 Without commutativity, are a division ring, or a non-commutative field, or a skew field. Just as complex numbers are an extension of the reals, are an extension of the complex numbers (and of the reals). If 1D numbers are the reals, and 2D numbers are the complex numbers, then 4D numbers are, and that s all there is. (Frobenius) (Octonions are not associative.) 238 3:)6)(

Let q be a unit quaternion, i.e. q = 1. It can be expressed as q = cos θ 2 + sin θ 2 ˆn Let x = 0 + x be a pure vector. Let x = qxq. Then x is the pure vector rot(θ, ˆn)x!!!

Proof that unit work Expand the product qxq ; Apply half angle formulas; Simplify; Compare with Rodrigues s formula. Sadly, not all proofs confer insight.

Why θ/2? Why qxq instead of qx? 8,-770-();%7238 3:)6)( In analogy with complex numbers, why not use p = cos θ + ˆn sin θ x = px To explore that idea, define a map L p (q) = pq. Note that L p (q) can be written: L p (q) = p 0 p 1 p 2 p 3 p 1 p 0 p 3 p 2 p 2 p 3 p 0 p 1 p 3 p 2 p 1 p 0 q 0 q 1 q 2 q 3 Note that the matrix above is orthonormal. L p is a rotation of Euclidean 4 space!

Geometrical explanation 8,-770-();%7238 3:)6)( Although L p (q) rotates the 4D space of, it is not a rotation of the 3D subspace of pure vectors. Some of the 3D subspace leaks into the fourth dimension. Consider an example using p = i. Is it a rotation about i of π/2? 1- i plane i L i q iq R i q qi iqi L i R i q 2 2 i i no rotation 1 1 1 j- k plane k 2 2 k k j j j

What do we do with a representation? Rotate a point: qxq. Compose two : q(pxp )q = (qp)x(qp) Convert to other representations: From axis-angle to quaternion: q = cos θ 2 + sin θ 2 ˆn From quaternion to axis-angle: assuming θ is nonzero. θ = 2 tan 1 ( q, q 0 ) ˆn = q/ q

From quaternion to rotation matrix Just expand the product qxq = q0 2 + q2 1 q2 2 q2 3 2(q 1 q 2 q 0 q 3 ) 2(q 1 q 3 + q 0 q 2 ) 2(q 1 q 2 + q 0 q 3 ) q0 2 q2 1 + q2 2 q2 3 2(q 2 q 3 q 0 q 1 ) x 2(q 1 q 3 q 0 q 2 ) 2(q 2 q 3 + q 0 q 1 ) q0 2 q2 1 q2 2 + q2 3

From rotation matrix to quaternion 8,-770-();%7238 3:)6)( Given R = (r ij ), solve expression on previous slide for quaternion elements q i Linear combinations of diagonal elements seem to solve the problem: q 2 0 =1 4 (1 + r 11 + r 22 + r 33 ) q 2 1 =1 4 (1 + r 11 r 22 r 33 ) q 2 2 =1 4 (1 r 11 + r 22 r 33 ) q 2 3 =1 4 (1 r 11 r 22 + r 33 ) so take four square roots and you re done? You have to figure the signs out. There is a better way...

Look at the off-diagonal elements 8,-770-();%7238 3:)6)( q 0 q 1 = 1 4 (r 32 r 23 ) q 0 q 2 = 1 4 (r 13 r 31 ) q 0 q 3 = 1 4 (r 21 r 12 ) q 1 q 2 = 1 4 (r 12 + r 21 ) q 1 q 3 = 1 4 (r 13 + r 31 ) q 2 q 3 = 1 4 (r 23 + r 32 ) Given any one q i, could solve the above for the other three.

The procedure 8,-770-();%7238 3:)6)( 1. Use first four equations to find the largest q 2 i. Take its square root, with either sign. 2. Use the last six equations (well, three of them anyway) to solve for the other q i. That way, only have to worry about getting one sign right. Actually q and q represent the same rotation, so no worries about signs. Taking the largest square root avoids division by small numbers.

Properties of unit 8,-770-();%7238 3:)6)( Unit live on the unit sphere in R 4. q and q represent the same rotation. Inverse of rotation q is the conjugate q. Null rotation, the identity, is the quaternion 1.

Metric on SO(3) 8,-770-();%7238 3:)6)( What is the right metric between two spatial? I.e. between two points in SO(3)? I provided an answer in Lecture 2! SO(3) is a configuration space. Let R 1 and R 2 be two displacements of the sphere S 2. Let x by a point on the sphere. Let α be the usual metric on the sphere the length of the shortest great circle arc joining two points. Define d(r 1, R 2 ) = max x S 2 α(r 1 (x), R 2 (x)). That is equivalent to taking the rotation angle of R 1 1 R 2. In brief, the angle of the rotation that takes you from R 1 to R 2.

Metric on sphere of unit 8,-770-();%7238 3:)6)( Consider unit quaternion q = cos θ 2 + sin θ 2 ˆn Shortest path on the unit sphere joining ±q with 1 has length θ/2. What is the shortest distance on the unit quaternion sphere S 3 from ±p to ±q? Multiplication by a unit quaternion is a rotation of the unit quaternion sphere. I.e. distance-preserving. So the distance from ±p to ±q is the same as the distance from ±pq to 1. I.e. α/2, where α is the rotation angle required from p to q. So usual metric on the sphere, applied to unit, is the right metric for SO(3). (Factor of two is irrelevant.)

Topology of SO(3) 8,-770-();%7238 3:)6)( The right metric matters. Our representation is smooth and one-to-one, apart from the fact that antipodes represent the same rotation. That means the unit, with antipodes identified, have the same topology as SO(3). That s how we know the topology of SO(3) is Projective 3-space, P 3.

Measure, probabilities, sampling 8,-770-();%7238 3:)6)( Likewise we can turn our attention to measure. Easiest way is to think in terms of probabilities. Suppose you are given some probability density function on SO(3). How can you decide whether it is unbiased? Pick some subset of SO(3), integrate the probability of that subset. Now rigidly rotate that subset. If the probability is invariant with respect to rotation, the PDF is unbiased. A measure with this property is the Haar measure, and it is uniquely determined up to some scale factor. Look at a uniform density function on the unit quaternion sphere S 3. It has the right property it is invariant with respect to. The quaternion representation gives you the right measure, and is an easy way to correctly sample SO(3).