Geometric Fundamentals in Robotics Quaternions

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

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

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

Matrices A brief introduction

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

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

QUATERNIONS AND ROTATIONS

Clifford Algebras and Spin Groups

Quaternions and Octonions

A (Mostly) Linear Algebraic Introduction to Quaternions

Matrices A brief introduction

Rotation outline of talk

Complex Numbers and Quaternions for Calc III

MSMS Vectors and Matrices

Lecture 7. Quaternions

Special Lecture - The Octionions

Lie Algebra of Unit Tangent Bundle in Minkowski 3-Space

ECS 178 Course Notes QUATERNIONS

Quaternions and their applications

Lecture 10: A (Brief) Introduction to Group Theory (See Chapter 3.13 in Boas, 3rd Edition)

1 Vectors and Tensors

Matrices over Hyperbolic Split Quaternions

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

Math Problem set # 7

The Quaternions. The Quaternions. John Huerta. Department of Mathematics UC Riverside. Cal State Stanislaus

Chapter XI Novanion rings

ON A NEW SPECIES OF IMAGINARY QUANTITIES CONNECTED WITH A THEORY OF QUATERNIONS. William Rowan Hamilton

p 2 p 3 p y p z It will not be considered in the present context; the interested reader can find more details in [05].

1 Matrices and vector spaces

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

Quaternions and Groups

Introduction to Group Theory

Linear Algebra March 16, 2019

Some Geometric Applications of Timelike Quaternions

GENERALIZED QUATERNIONS AND ROTATION IN 3-SPACE E 3 αβ

Matrices A brief introduction

5. Vector Algebra and Spherical Trigonometry (continued)

Contents. D. R. Wilkins. Copyright c David R. Wilkins

Subalgebras of the Split Octonions

A FIRST COURSE IN LINEAR ALGEBRA. An Open Text by Ken Kuttler. Matrix Arithmetic

Hypercomplex numbers

Linear Algebra: Matrix Eigenvalue Problems

Unit Generalized Quaternions in Spatial Kinematics

On complexified quantum mechanics and space-time

The groups SO(3) and SU(2) and their representations

Dual unitary matrices and unit dual quaternions

The Quaternions & Octonions: A Basic introduction to Their Algebras. By: Kyle McAllister. Boise State University

Physics 557 Lecture 5

Division Algebras: Family Replication. Geoffrey Dixon 4 April 2004

:25 1. Rotations. A rotation is in general a transformation of the 3D space with the following properties:

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

4.3 Equations in 3-space

Chapter 2. Linear Algebra. rather simple and learning them will eventually allow us to explain the strange results of

Linear Equations and Matrix

Dr. Tess J. Moon, (office), (fax),

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

Sums of squares, the octonions, and (7, 3, 1)

Eigenvalues and Eigenvectors

arxiv: v1 [math.ds] 18 Nov 2008

Introduction to quaternions

Homogeneous Coordinates

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

MECH 576 Geometry in Mechanics September 16, 2009 Using Line Geometry

Unitary rotations. October 28, 2014

Appendix Composite Point Rotation Sequences

Applications of dual quaternions to kinematics

Lecture 3 Linear Algebra Background

1. Matrix multiplication and Pauli Matrices: Pauli matrices are the 2 2 matrices. 1 0 i 0. 0 i

Kinematics. Basilio Bona. Semester 1, DAUIN Politecnico di Torino. B. Bona (DAUIN) Kinematics Semester 1, / 15

Position and orientation of rigid bodies

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

Split Quaternions and Particles in (2+1)-Space

APPENDIX A. Background Mathematics. A.1 Linear Algebra. Vector algebra. Let x denote the n-dimensional column vector with components x 1 x 2.

Introduction to Lie Groups

The VQM-Group and its Applications

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

TABLE OF CONTENTS. Our aim is to give people math skillss in a very simple way Raymond J. Page 2 of 29

MATH Topics in Applied Mathematics Lecture 12: Evaluation of determinants. Cross product.

Lecture 4 Orthonormal vectors and QR factorization

Linear Algebra. Min Yan

B Elements of Complex Analysis

Kinematics. Basilio Bona. October DAUIN - Politecnico di Torino. Basilio Bona (DAUIN - Politecnico di Torino) Kinematics October / 15

Lecture 3: Matrix and Matrix Operations

Octonions? A non-associative geometric algebra. Benjamin Prather. October 19, Florida State University Department of Mathematics

Mobile Robotics 1. A Compact Course on Linear Algebra. Giorgio Grisetti

Physics 221A Fall 1996 Notes 9 Rotations in Ordinary Space

Mathematical Methods for Engineers and Scientists 1

Tutorials in Optimization. Richard Socher

CS 246 Review of Linear Algebra 01/17/19

A matrix over a field F is a rectangular array of elements from F. The symbol

Foundations of Matrix Analysis

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,

1.3 LECTURE 3. Vector Product

Quaternions An Algebraic View (Supplement)

Be fruitful and multiply Genesis 1:28

Semester University of Sheffield. School of Mathematics and Statistics

ANSWERS (5 points) Let A be a 2 2 matrix such that A =. Compute A. 2

Introduction to Modern Quantum Field Theory

A Tutorial on Euler Angles and Quaternions

Algebraic. techniques1

Transcription:

Geometric Fundamentals in Robotics Quaternions Basilio Bona DAUIN-Politecnico di Torino July 2009 Basilio Bona (DAUIN-Politecnico di Torino) Quaternions July 2009 1 / 47

Introduction Quaternions were discovered in 1843 by Sir William Hamilton, who was looking for the extension to 3D space of the complex numbers as rotation operators. Figure: Sir William Rowland Hamilton (1805-1865) and the plaque on Broom Bridge, where the quaternions were discovered. Basilio Bona (DAUIN-Politecnico di Torino) Quaternions July 2009 2 / 47

Definitions The generic quaternion will be indicated as q. Quaternions are elements of a 4D linear space H(R), defined on the real numbers fieldf =R, with base {1 i j k}. i, j and k are ipercomplex numbers that satisfy the following anticommutative multiplication rules: i 2 =j 2 =k 2 =ijk= 1 ij= ji=k jk= kj=i ki= ik=j Basilio Bona (DAUIN-Politecnico di Torino) Quaternions July 2009 3 / 47

Definitions A quaternion q H is defined as a linear combination expressed in the base {1 i j k}: q=q 0 1+q 1 i+q 2 j+q 3 k where the coefficients {q i } 3 i=0 are real. Another way to represent a quaternion is to define it as a quadruple of reals, (q 0,q 1,q 2,q 3 ) q=(q 0,q 1,q 2,q 3 ) in analogy with complex numbers c =a+jb, where c is represented by a couple of reals, c =(a,b), Basilio Bona (DAUIN-Politecnico di Torino) Quaternions July 2009 4 / 47

Definitions Quaternions are also defined as hypercomplex numbers, i.e., those complex numbers having complex coefficients: where c 1 =q 0 +kq 3 e c 2 =q 2 +kq 1. q=c 1 +jc 2, Therefore, considering multiplication rules, it results: q=c 1 +jc 2 =q 0 +kq 3 +jq 2 +jkq 1 =q 0 1+q 1 i+q 2 j+q 3 k Basilio Bona (DAUIN-Politecnico di Torino) Quaternions July 2009 5 / 47

Definitions In analogy with complex numbers that are the sum of a real part and an imaginary part, quaternions are the sum of a real part and a vectorial part. The real part q r is defined as q r =q 0, and the vectorial part q v is defined as q v =q 1 i+q 2 j+q 3 k. We write q=(q r, q v ) or q=q r +q v ; note that the vectorial part is not transposed since the conventional definition for the vectorial part of a quaternion assumes a row representation. Using the convention that defines vectors as column vectors, we can write q=(q r, q T v). Basilio Bona (DAUIN-Politecnico di Torino) Quaternions July 2009 6 / 47

Definitions Quaternions are general mathematical objects, that include real numbers complex numbers r =(r, 0, 0, 0), r R a+ib =(a, b, 0, 0), a,b R real vectors in R 3 (with some caution, since not all vectorial parts represents vectors) v=(0, v 1, v 2, v 3 ), v i R. In this last case, elements { i j k } are to be understood as unit vectors { i j k } forming an orthonormal base in a cartesian right-handed reference frame. Basilio Bona (DAUIN-Politecnico di Torino) Quaternions July 2009 7 / 47

Definitions Multiplication rules between elements i, j, k have the same properties of the cross product between unit vectors i,j,k: ij=k i j=k ji= k j i= k etc. In the following we will use all the possible alternative notations to indicate quaternions q=q 0 1+q 1 i+q 2 j+q 3 k=(q r,q v )=q r +q v =(q 0,q 1,q 2,q 3 ) i.e., a) a hypercomplex number; b) the sum of a real part and a vectorial part; c) a quadruple of reals. Basilio Bona (DAUIN-Politecnico di Torino) Quaternions July 2009 8 / 47

Definitions An alternative way to write a quaternion is the following where now 1= and i 2 = 1. q=q 0 1+q 1 i+q 2 j+q 3 k [ ] [ ] 1 0 i 0 ; i= ; j= 0 1 0 i Hence every matrix is of the form [ ] c d d c ; [ ] 0 1 ; k= 1 0 [ ] 0 i ; i 0 These matrices are called Cayley matrices [see Rotations - Pauli spin matrices]. Basilio Bona (DAUIN-Politecnico di Torino) Quaternions July 2009 9 / 47

Quaternions algebra Given a quaternion q=q 0 1+q 1 i+q 2 j+q 3 k=q r +q v =(q 0,q 1,q 2,q 3 ), the following properties hold: a null or zero 0 quaternion exists 0=01+0i+0j+0k=(0,0)=0+0=(0,0,0,0) a conjugate quaternion q exists, having the same real part and the opposite vectorial part: q =q 0 (q 1 i+q 2 j+q 3 k)=(q r, q v )=q r q v =(q 0, q 1, q 2, q 3 ) Conjugate quaternions satisfy (q ) =q Basilio Bona (DAUIN-Politecnico di Torino) Quaternions July 2009 10 / 47

Quaternions algebra a non-negative function, called quaternion norm exists q, defined as q 2 =qq =q q= 3 l=0 q 2 l =q 2 0+q T vq v A quaternion with unit norm q =1 is called unit quaternion. Quaternion q and its conjugate q have the same norm The quaternion q = q q v =01+q 1 i+q 2 j+q 3 k=(0,q v )=0+q v =(0,q 1,q 2,q 3 ), that has a zero real part is called pure quaternion or vector. The conjugate of a pure quaternion q v is the opposite of the original pure quaternion q v = q v Basilio Bona (DAUIN-Politecnico di Torino) Quaternions July 2009 11 / 47

Quaternions algebra Given two quaternions h=h 0 1+h 1 i+h 2 j+h 3 k=(h r,h v )=h r +h v =(h 0,h 1,h 2,h 3 ) and g=g 0 1+g 1 i+g 2 j+g 3 k=(g r,g v )=g r +g v =(g 0,g 1,g 2,g 3 ) the following operations are defined Basilio Bona (DAUIN-Politecnico di Torino) Quaternions July 2009 12 / 47

Sum Sum or addition h+g h+g = (h 0 +g 0 )1+(h 1 +g 1 )i+(h 2 +g 2 )j+(h 3 +g 3 )k = ((h r +g r ), (h v +g v )) = (h r +g r )+(h v +g v ) = (h 0 +g 0,h 1 +g 1,h 2 +g 2,h 3 +g 3 ) Basilio Bona (DAUIN-Politecnico di Torino) Quaternions July 2009 13 / 47

Difference Difference or subtraction h g = (h 0 g 0 )1+(h 1 g 1 )i+(h 2 g 2 )j+(h 3 g 3 )k = ((h r g r ), (h v g v )) = (h r g r )+(h v g v ) = (h 0 g 0,h 1 g 1,h 2 g 2,h 3 g 3 ) Basilio Bona (DAUIN-Politecnico di Torino) Quaternions July 2009 14 / 47

Product Product hg = (h 0 g 0 h 1 g 1 h 2 g 2 h 3 g 3 )1+ (h 1 g 0 +h 0 g 1 h 3 g 2 +h 2 g 3 )i+ (h 2 g 0 +h 3 g 1 +h 0 g 2 h 1 g 3 )j+ (h 3 g 0 h 2 g 1 +h 1 g 2 +h 0 g 3 )k = (h r g r h v g v, h r g v +g r h v +h v g v ) where h v g v is the scalar product h v g v = h vi g vi =h T vg v =g T vh v i defined in R n, and h v g v is the cross product (defined only in R 3 ) h v g v = h 2g 3 h 3 g 2 h 3 g 1 h 1 g 3 =S(h v )g v h 1 g 2 h 2 g 1 Basilio Bona (DAUIN-Politecnico di Torino) Quaternions July 2009 15 / 47

Product The quaternion product is anti-commutative, since, being it follows g v h v = h v g v gh=(h r g r h v g v, h r g v +g r h v h v g v ) hg; Notice that the real part remains the same, while the vectorial part changes. Product commutes only if h v g v =0, i.e., when the vectorial parts are parallel. The conjugate of a quaternion product satisfies The product norm satisfies (gh) =h g. hg = h g. Basilio Bona (DAUIN-Politecnico di Torino) Quaternions July 2009 16 / 47

Product properties associative multiplication by the unit scalar (gh)p = g(hp) 1q=q1=(1,0)(q r,q v )=(1q r,1q v )=(q r,q v ) multiplication by the real λ bilinearity, with real λ 1,λ 2 λq=(λ,0)(q r,q v )=(λq r,λq v ) g(λ 1 h 1 + λ 2 h 2 ) = λ 1 gh 1 + λ 2 gh 2 (λ 1 g 1 + λ 2 g 2 )h = λ 1 g 1 h+λ 2 g 2 h Basilio Bona (DAUIN-Politecnico di Torino) Quaternions July 2009 17 / 47

Product Alternative forms Quaternion product may be written as matrix product forms: or h 0 h 1 h 2 h 3 g 0 ] h hg= 1 h 0 h 3 h 2 g 1 h 2 h 3 h 0 h 1 g =[ g 0 h0 h T v g 1 2 h v h 0 I+S(h v ) g 2 h 3 h 2 h 1 h 0 g 3 g 3 =F L (h)g g 0 g 1 g 2 g 3 h 0 ] g hg= 1 g 0 g 3 g 2 h 1 g 2 g 3 g 0 g 1 h =[ h 0 g0 g T v h 1 2 g v g 0 I S(g v ) h 2 g 3 g 2 g 1 g 0 h 3 h 3 =F R (g)h Basilio Bona (DAUIN-Politecnico di Torino) Quaternions July 2009 18 / 47

Quotient Since the quaternion product is anti-commutative we must distinguish between the left and the right quotient or division. Given two quaternions h e p, we define the left quotient of p by h the quaternion q l that satisfies hq l =p while we define the right quotient of p by h the quaternion q r that satisfies q r h=p Hence q l = h h 2p; q r =p h h 2 Basilio Bona (DAUIN-Politecnico di Torino) Quaternions July 2009 19 / 47

Inverse Given a quaternion q, in principle one must define the right q 1 r and the left inverse q 1 l as qq 1 l =1=(1,0,0,0); q 1 r q=1=(1,0,0,0) Since qq =q q= q 2 = q q, one can write q q q = q q q q =1=(1,0,0,0) q It follows that right inverse and left inverse are equal q 1 l =q 1 r =q 1 = q q 2 similar to c 1 = c c 2 Basilio Bona (DAUIN-Politecnico di Torino) Quaternions July 2009 20 / 47

Inverse For a unit quaternion u, u =1, inverse and conjugate coincide u 1 =u, u =1 and for a pure unit quaternion q=(0,q v ), q =1, i.e., a unit vector Inverse satisfies q 1 v =q v = q v. (q 1 ) 1 =q; (pq) 1 =q 1 p 1 Basilio Bona (DAUIN-Politecnico di Torino) Quaternions July 2009 21 / 47

Selection function We define the selection function ρ(q)=q 0 =q r as the function that extracts the real part of a quaternion This function satisfies ρ(q)= q+q. 2 Basilio Bona (DAUIN-Politecnico di Torino) Quaternions July 2009 22 / 47

Hamilton product If we multiply two pure quaternions, i.e., two vectors and we obtain u v =(0,u v )=u 1 i+u 2 j+u 3 k v v =(0,v v )=v 1 i+v 2 j+v 3 k u v v v =( u v v v, u v). Hence, with a slight notation abuse, we can define a new vector product, called Hamilton product uv= u v+u v. This product implies uu= u u, and for this reason, among others the quaternions were abandoned in favor of vectors. Nonetheless the quaternion product has an important role in representing rotations. Basilio Bona (DAUIN-Politecnico di Torino) Quaternions July 2009 23 / 47

Unit quaternions Before starting to illustrate the relations between quaternions and rotation, we look closer to the properties of the unit quaternions, that we indicate with the symbol u. A unit quaternion ( u =1) has an unit inverse and the product of two unit quaternions is still a unit quaternion. We assume that a unit quaternion is represented by a sum of two trigonometric functions u=cosθ+usinθ=(cosθ,usinθ) where u is a unit norm vector and θ a generic angle. Basilio Bona (DAUIN-Politecnico di Torino) Quaternions July 2009 24 / 47

Unit quaternions Notice the analogy with the unit complex number expression c =cosθ+jsinθ The analogy applies also to the exponential expression c =e jθ ; substituting x with uθ in the series expansion of e x and recalling that uu= 1, we have e uθ =cosθ+usinθ=u The relation above shows a formal identity between a unit quaternion and the exponential of a unit vector multiplied by a scalar θ Notice the similarity between u=e uθ and R(u,θ)=e S(u)θ Basilio Bona (DAUIN-Politecnico di Torino) Quaternions July 2009 25 / 47

Unit quaternions From the previous relation one obtains the power p of a unit quaternion as u p =(cosθ+usinθ) p =e uθp =cos(θp)+usin(θp) and the logarithm of a unit quaternion logu=log(cosθ+usinθ)=log(e uθ )=uθ Notice that the anti-commutativity of the quaternion product inhibits to use the standard identities between exponential and logarithms. For instance, e u 1 e u 2 it is not necessarily equal to e u 1+u 2, and log(u 1 u 2 ) is not necessarily equal to log(u 1 )+log(u 2 ). Basilio Bona (DAUIN-Politecnico di Torino) Quaternions July 2009 26 / 47

Quaternions and Rotations Now we relate rotations and unit quaternions Given the unit quaternion u=(u 0,u 1,u 2,u 3 )=(u 0,u)=cosθ+usinθ this represents the rotation Rot(u,2θ) around u= [ u 1 u 2 u 3 ] T The converse is also true, i.e., given a rotation Rot(u,θ) of an angle θ around the axis specified by the unit vector u= [ u 1 u 2 u 3 ] T, the unit quaternion ( u= cos θ 2,u 1sin θ 2,u 2sin θ 2,u 3sin θ ) ( = cos θ 2 2, usin θ ) = 2 represents the same rotations. cos θ 2 +usin θ 2 Basilio Bona (DAUIN-Politecnico di Torino) Quaternions July 2009 27 / 47

Quaternions and Rotations We know that a rigid rotation in R 3 is represented by a rotation (orthonormal) matrix R SO(3) R 3 3. We can associate to every rotation matrix R a unit quaternion u and viceversa, indicating this relation as R(u) u. Basilio Bona (DAUIN-Politecnico di Torino) Quaternions July 2009 28 / 47

Quaternions and Rotations To compute the rotation matrix R(u) given a unit quaternion u=(u 0,u), we use the following relation R(u)=(u0 2 ut u)i+2uu T 2u 0 S(u)= u 2 0 +u2 1 u2 2 u2 3 2(u 1 u 2 u 3 u 0 ) 2(u 1 u 3 +u 2 u 0 ) 2(u 1 u 2 +u 3 u 0 ) u0 2 u2 1 +u2 2 u2 3 2(u 2 u 3 u 1 u 0 ) 2(u 1 u 3 u 2 u 0 ) 2(u 2 u 3 +u 1 u 0 ) u0 2 u2 1 u2 2 +u2 3 where S(u) is an antisymmetric matrix. Basilio Bona (DAUIN-Politecnico di Torino) Quaternions July 2009 29 / 47

Quaternions and Rotations To compute the unit quaternion u=(u 0,u) given a rotation matrix R we use the following relation u 0 =± 1 2 (1+r11 +r 22 +r 33 ) u 1 = 1 4u 0 (r 32 r 23 ) u 2 = 1 4u 0 (r 13 r 31 ) u 3 = 1 4u 0 (r 21 r 12 ) Basilio Bona (DAUIN-Politecnico di Torino) Quaternions July 2009 30 / 47

Quaternions and Rotations Another alternative relation is u 0 = 1 2 (1+r11 +r 22 +r 33 ) u 1 = 1 2 sign(r 32 r 23 ) (1+r 11 r 22 r 33 ) u 2 = 1 2 sign(r 13 r 31 ) (1 r 11 +r 22 r 33 ) u 3 = 1 2 sign(r 21 r 12 ) (1 r 11 r 22 +r 33 ) where sign(x) is the sign function, with sign(0)=0. This relation is never singular compared with the previous one that is singular for u 0 =0 Basilio Bona (DAUIN-Politecnico di Torino) Quaternions July 2009 31 / 47

Quaternions and Rotations Elementary rotations around the three principal axes R(i, α), R(j, β) and R(k, γ), correspond to the following elementary quaternions R(i,α) u x = (cos α 2, sin α ) 2 (cos, 0, 0 β2, 0, sin β2 ), 0 R(j,β) u y = R(k,γ) u z = ( cos γ 2, 0, 0, sin γ ) 2 It is easy to see hat the vectorial base of quaternions correspond to elementary rotations of π around the principal axes i=(0,1,0,0) R(i,π) j=(0,0,1,0) R(j,π) k=(0,0,0,1) R(k,π) Basilio Bona (DAUIN-Politecnico di Torino) Quaternions July 2009 32 / 47

Quaternions and Rotations Notice an important fact: while the product among the unit base quaternions gives ii=jj=kk=ijk=( 1, 0, 0, 0), the product among the associated rotation matrices gives: R(i,π)R(i,π)=R(j,π)R(j,π)=R(k,π)R(k,π)= R(i,π)R(j,π)R(k,π)=I Since I represents a rotation that leaves the vectors unchanged, it seems natural to associate it to positive unit scalar, i.e., the quaternion (1,0,0,0). The apparent discrepancy between the two results can be explained only introducing a most basic mathematical quantity, called spinor, not discussed in the present context Basilio Bona (DAUIN-Politecnico di Torino) Quaternions July 2009 33 / 47

Quaternions and Rotations We shall see now some correspondence between quaternion operations and matrix operations Rotation product Given n rotations R 1, R 2,, R n and the corresponding unit quaternions u 1, u 2,, u n, the product corresponds to the product in the shown order. R(u)=R(u 1 )R(u 2 ) R(u n ) u=u 1 u 2 u n Basilio Bona (DAUIN-Politecnico di Torino) Quaternions July 2009 34 / 47

Quaternions and Rotations Transpose matrix Given the rotation R(u) and its corresponding unit quaternion u, the transpose matrix (i.e., the inverse rotation) R T corresponds to the conjugate unit quaternion u (i.e., the inverse quaternion) R u R T u Basilio Bona (DAUIN-Politecnico di Torino) Quaternions July 2009 35 / 47

Quaternions and Rotations Vector rotation Given a generic vector x, and the corresponding pure quaternion q x =(0,x)=(0,x 1,x 2,x 3 ) and given a rotation matrix R(u) with its corresponding unit quaternion u, the rotated vector y=r(u)x is given by the vectorial part of the quaternion obtained as q y =(0,y)=uq x u where qy = qx Basilio Bona (DAUIN-Politecnico di Torino) Quaternions July 2009 36 / 47

The map q x q y =uq x u y=r(u)x that transforms a pure vector into its rotated counterpart, in quaternion form, is called conjugation by u. Notice that the transpose map is equivalent to exchange the order of the conjugation q x q y =u q x u y=r T (u)x Quaternions u and u =u 1 are called antipodal, because they represent opposite points on the 3-sphere of unit quaternions. Basilio Bona (DAUIN-Politecnico di Torino) Quaternions July 2009 37 / 47

Quaternions and Rotations If we use the homogeneous coordinates to express the vector x x= [ wx 1 wx 2 wx 3 w ] T and the quaternion x is defined as x=(w,wx) the product uxu provides the quaternion y, defined as y=(w,wr(u)x) The resulting vector y, in homogeneous coordinates is therefore ỹ= [ wy 1 wy 2 wy 3 w ] T y=r(u)x Basilio Bona (DAUIN-Politecnico di Torino) Quaternions July 2009 38 / 47

Quaternions and Rotations Product matrices Since the bi-linearity property holds for the product between two quaternions, this can be represented by linear operators (i.e., matrices). We recall that the product qp can be expressed in matrix form as qp=f L (q)p This can be interpreted as the left product of q by p. Similarly for the right product pq, expressed as pq=f R (q)p. Basilio Bona (DAUIN-Politecnico di Torino) Quaternions July 2009 39 / 47

Quaternions and Rotations We can obtain pq as F R (q )p and where the matrix Q R 4 4 is qpq =F L (q)f R (q )p=qp Q=F L (q)f R (q )= q 2 0 +q2 1 q2 2 q2 3 2(q 1 q 2 q 3 q 0 ) 2(q 1 q 3 +q 2 q 0 ) 0 2(q 1 q 2 +q 3 q 0 ) q 2 0 q2 1 +q2 2 q2 3 2(q 2 q 3 q 1 q 0 ) 0 2(q 1 q 3 q 2 q 0 ) 2(q 2 q 3 +q 1 q 0 ) q0 2 q2 1 q2 2 +q2 3 0 0 0 0 q 2 We observe that the upper left 3 3 matrix of Q equals the matrix R(q) previously defined Basilio Bona (DAUIN-Politecnico di Torino) Quaternions July 2009 40 / 47

Quaternions in Aerospace literature In space applications quaternions are used when dealing with satellite orientation control; unfortunately they may be organized in a different way wrt to our conventions: often the real part is the last element of quaternions q=(q 1,q 2,q 3,q 0 ) Basilio Bona (DAUIN-Politecnico di Torino) Quaternions July 2009 41 / 47

Historical notes Hamilton tried to use the quaternions for a unified description of space-time physics (before Einstein), considering the real part of the quaternion as the representation of time, and the vectorial part as the representation of space q=(t,x,y,z). Unfortunately the quadratic form q q=qq =t 2 +x 2 +y 2 +z 2 has the wrong signature (+,+,+,+). We know that, in special relativity, the Minkowski spacetime standard basis has a set of four mutually orthogonal vectors (e 0,e 1,e 2,e 3 ) such that (e 0 ) 2 =(e 1 ) 2 =(e 2 ) 2 =(e 3 ) 2 =1 with signature (+,,, ) or (,+,+,+). Basilio Bona (DAUIN-Politecnico di Torino) Quaternions July 2009 42 / 47

The development of hyperbolic quaternions in the 1890s prepared the way for Minkowski space. Indeed, as a mathematical structure, Minkowski space can be taken as hyperbolic quaternions minus the multiplicative product, retaining only the bilinear form η(p,q)= pq +(pq ) 2 which is generated (evidently) by the hyperbolic quaternion product pq. [from Wikipedia: Minkowski space] Basilio Bona (DAUIN-Politecnico di Torino) Quaternions July 2009 43 / 47

Hamilton tried for many years to extend the complex numbers rotation operator from plane to space trying with triads of real number (a,b,c), with base (1,i,j), but he did not succeed. A story goes that every morning his sons would inquire Well, Papa can you multiply triplets? The problem is that the general result on which he based his reasoning, i.e., the extension of the complex number result (a 2 1+a 2 2)(b 2 1+b 2 2)=(c 2 1 +c 2 2) to the R 3 space, cannot be solved with triads of numbers, i.e., (a 2 1+a 2 2+a 2 3)(b 2 1+b 2 2+b 2 3) (c1 2 +c 2 2 +c 2 3) that is the same to ask for the existence a b = ab in general cases (three components vectors in particular). [from J. Stillwell, Mathematics and Its History, Springer] Basilio Bona (DAUIN-Politecnico di Torino) Quaternions July 2009 44 / 47

The problem is that, while for complex numbers the product result is well known (a 1 +ja 2 )(b 1 +jb 2 )=a 1 b 1 a 2 b 2 +j(a 2 b 1 +a 1 b 2 ) or (a 1,a 2 )(b 1,b 2 )=(a 1 b 1 a 2 b 2,a 2 b 1 +a 1 b 2 ) for triad of numbers it is impossible. Hamilton failed to acknowledge this and did not notice a result already given by Diophantus, that for example, 3=1 1 +1 2 +1 2 and 5=0 2 +1 2 +2 2 are both sums of three squares, but their product 15 is not. So he persisted for 13 years before discovering that he needed four numbers, i.e., the quaternions. Basilio Bona (DAUIN-Politecnico di Torino) Quaternions July 2009 45 / 47

By the way the only number systems with a product satisfying a b = ab are the real numbers R=R 1. the complex numbers C=R 2 ; they are couples or real numbers. the quaternions H=R 4 ; they are couples or complex numbers. the octonions O=R 8 ; they are couples or quaternions. Basilio Bona (DAUIN-Politecnico di Torino) Quaternions July 2009 46 / 47

Commutative multiplication is possible only on R 1 and R 2 and it yields the number systems R and C. Associative, but noncommutative, multiplication is possible only on R 4, and it yields the quaternions H. Alternative, but nonassociative, multiplication is possible only on R 8, and it yields a system called the octonions O. Partial associativity law called cancellation or alternativity a 1 (ab)=b =(ba)a 1 Basilio Bona (DAUIN-Politecnico di Torino) Quaternions July 2009 47 / 47