Rotations of Moment of Inertia Tensor

Similar documents
Determination of Locally Varying Directions through Mass Moment of Inertia Tensor

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

Programming Project 2: Harmonic Vibrational Frequencies

Manipulator Dynamics 2. Instructor: Jacob Rosen Advanced Robotic - MAE 263D - Department of Mechanical & Aerospace Engineering - UCLA

COMP 175 COMPUTER GRAPHICS. Lecture 04: Transform 1. COMP 175: Computer Graphics February 9, Erik Anderson 04 Transform 1

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

Problem Set 2 Due Tuesday, September 27, ; p : 0. (b) Construct a representation using five d orbitals that sit on the origin as a basis: 1

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

Orientation of Piezoelectric Crystals and Acoustic Wave Propagation

CP1 REVISION LECTURE 3 INTRODUCTION TO CLASSICAL MECHANICS. Prof. N. Harnew University of Oxford TT 2017

Rigid body simulation. Once we consider an object with spatial extent, particle system simulation is no longer sufficient

Closed-Form Solution Of Absolute Orientation Using Unit 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,

Applications of Eigenvalues & Eigenvectors

Multipole moments. Dipole moment. The second moment µ is more commonly called the dipole moment, of the charge. distribution and is a vector

A DARK GREY P O N T, with a Switch Tail, and a small Star on the Forehead. Any

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

PALACE PIER, ST. LEONARDS. M A N A G E R - B O W A R D V A N B I E N E.

Problem Set 2 Due Thursday, October 1, & & & & # % (b) Construct a representation using five d orbitals that sit on the origin as a basis:

Lesson Rigid Body Dynamics

. D CR Nomenclature D 1

Spacecraft Dynamics and Control

Homework 1/Solutions. Graded Exercises

Exercise 1: Inertia moment of a simple pendulum

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

Deep Learning Book Notes Chapter 2: Linear Algebra

Matrix Operations. Linear Combination Vector Algebra Angle Between Vectors Projections and Reflections Equality of matrices, Augmented Matrix

Classical Mechanics. Luis Anchordoqui

Rotational & Rigid-Body Mechanics. Lectures 3+4

1. Vectors.

Artificial Intelligence & Neuro Cognitive Systems Fakultät für Informatik. Robot Dynamics. Dr.-Ing. John Nassour J.

CSE 167: Introduction to Computer Graphics Lecture #2: Linear Algebra Primer

Appendix Composite Point Rotation Sequences

Linear Algebra. Chapter 8: Eigenvalues: Further Applications and Computations Section 8.2. Applications to Geometry Proofs of Theorems.

Point cloud to point cloud rigid transformations. Minimizing Rigid Registration Errors

7.4 Rigid body simulation*

CSE 167: Introduction to Computer Graphics Lecture #2: Linear Algebra Primer

Chapter Two Elements of Linear Algebra

MAE 323: Lecture 1. Review

An Introduction to Matrix Algebra

MECH 5312 Solid Mechanics II. Dr. Calvin M. Stewart Department of Mechanical Engineering The University of Texas at El Paso

6. 3D Kinematics DE2-EA 2.1: M4DE. Dr Connor Myant

Hilbert s Metric and Gromov Hyperbolicity

EEL6667: Homework #1 Solutions

Stress, Strain, Mohr s Circle

Octonions. Robert A. Wilson. 24/11/08, QMUL, Pure Mathematics Seminar

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

Useful Formulae ( )

Hong Kong Institute of Vocational Education (Tsing Yi) Higher Diploma in Civil Engineering Structural Mechanics. Chapter 2 SECTION PROPERTIES

CHAPTER 3 BOOLEAN ALGEBRA

Inverse of a Square Matrix. For an N N square matrix A, the inverse of A, 1

M5 Simple Beam Theory (continued)

Chapter 5: Application of Filters to Potential Field Gradient Tensor Data

Lagrange Multipliers

3D Elasticity Theory

Subalgebras of the Split Octonions

CGAlgebra: a Mathematica package for conformal geometric algebra

Eigen decomposition for 3D stress tensor

Synopsis of Numerical Linear Algebra

Quaternion Dynamics, Part 1 Functions, Derivatives, and Integrals. Gary D. Simpson. rev 00 Dec 27, 2014.

AB-267 DYNAMICS & CONTROL OF FLEXIBLE AIRCRAFT

Computer Applications in Engineering and Construction Programming Assignment #9 Principle Stresses and Flow Nets in Geotechnical Design

Review of Coordinate Systems

Chapter 4 The Equations of Motion

Rigid body dynamics. Basilio Bona. DAUIN - Politecnico di Torino. October 2013

Signal Processing s Importance in Manufacturing of a Special Device

Introduction. How to use this book. Linear algebra. Mathematica. Mathematica cells

Polyhedral Mass Properties (Revisited)

Simplified Analytical Model of a Six-Degree-of-Freedom Large-Gap Magnetic Suspension System

review To find the coefficient of all the terms in 15ab + 60bc 17ca: Coefficient of ab = 15 Coefficient of bc = 60 Coefficient of ca = -17

. ffflffluary 7, 1855.

Properties of the stress tensor

Matrix Algebra: Vectors

Matrices. Background mathematics review

Properties of surfaces II: Second moment of area

Lecture 8. Stress Strain in Multi-dimension

Contents. Appendix D (Inner Product Spaces) W-51. Index W-63

Quantum Information & Quantum Computing

Linear Algebra: Matrix Eigenvalue Problems

2.003J Spring 2011: Dynamics and Control I On Notation Massachusetts Institute of Technology Department of Mechanical Engineering Feb.

A VERY BRIEF LINEAR ALGEBRA REVIEW for MAP 5485 Introduction to Mathematical Biophysics Fall 2010

- 1 - Items related to expected use of technology appear in bold italics.

Moments of inertia of a cross section

Geometric Fundamentals in Robotics Quaternions

Elements of Continuum Elasticity. David M. Parks Mechanics and Materials II February 25, 2004

Complex Variables. Chapter 1. Complex Numbers Section 1.2. Basic Algebraic Properties Proofs of Theorems. December 16, 2016

Linear Algebra & Geometry why is linear algebra useful in computer vision?

Sec. 1.1: Basics of Vectors

GG303 Lecture 6 8/27/09 1 SCALARS, VECTORS, AND TENSORS

Tensor Visualization. CSC 7443: Scientific Information Visualization

Vectors and Matrices

Inverses of Square Matrices

Vector Calculus - GATE Study Material in PDF

Game Engineering: 2D

Rotational Motion. Chapter 4. P. J. Grandinetti. Sep. 1, Chem P. J. Grandinetti (Chem. 4300) Rotational Motion Sep.

We wish to solve a system of N simultaneous linear algebraic equations for the N unknowns x 1, x 2,...,x N, that are expressed in the general form

A Learning Progression for Complex Numbers

Algebraic Expressions and Identities

ELEMENTARY MATRIX ALGEBRA

1/30. Rigid Body Rotations. Dave Frank

Transcription:

Rotations of Moment of Inertia Tensor using Quaternions Mikica B Kocic, 202-04-22, v0.3 There is a wonderful connection between complex numbers (and quaternions, as their extension) and geometry in which, translations correspond to additions, rotations and scaling to multiplications, and reflections to conjugations. However, the beauty of describing spatial rotations with quaternions is shadowed by an expression like: - 2 Iy 2 + z 2 M 2 xy- 2 wz 2 wy+ 2 xz 2 xy+ 2 wz - 2 Ix 2 + z 2 M 2 yz- 2 wx ÿ 2 xz- 2 wy 2 wx+ 2 yz - 2 Ix 2 + y 2 M - 2 Iy 2 + z 2 M 2 xy- 2 wz 2 wy+ 2 xz T ÿ ÿ 2 xy+ 2 wz - 2 Ix 2 + z 2 M 2 yz- 2 wx 2 xz- 2 wy 2 wx+ 2 yz - 2 Ix 2 + y 2 M which actually represents such simple transformation as the rotation of moment of inertia tensor using quaternions [2]. The purpose of this document is to express spatial rotations of a moment of inertia tensor in the pure quaternionic form and to highlight the algebraical meaning behind such rotations by proving some interesting theorems. ü Conventions and Definitions Load quaternions package (see Quat.nb for the annotated source code) Get@ "Quat.m", Path > 8 NotebookDirectory @D < D; ô Conventions In this document, matrices, vectors and matrix representation of quaternions are shown in uppercase font (roman-bold font in text) and quaternions and other numbers are shown in lowercase font (italic font in text). Since the symbol I in Mathematica is used for imaginary unit, the selected symbol for moment of inertia is the uppercase script J i.e.. The identity matrix is suffixed with a number of dimensions, i.e. I4 represents the identity matrix in 4. Matrices 4ä4 originated from quaternions may be geometrically partitioned into scalar (real), vector (pure imaginary) and cross-product parts [3]. Such partitions are visualized using row and column divider lines throughout this document: scalar É vector É É É É É vector É cross product É É É É É ô General symbols and variables used in theorems (definitions) Hamilton's quaternions q, q and q 2 with real number components (but not with complex number components as biquaternions; see definition of default $Assumptions bellow): q = @ w, x, y, z D; q = @ w, x, y, z D; q2 = @ w2, x2, y2, z2 D; Identity matrix I4 in 4 : I4 = IdentityMatrix@4D;

2 Rotations of Tensors using Quaternions v0.3.nb Common 4 matrices A and B: A = Aww Awx Awy Awz Axw Axx Axy Axz Ayw Ayx Ayy Ayz Azw Azx Azy Azz ; B = Bww Bwx Bwy Bwz Bxw Bxx Bxy Bxz Byw Byx Byy Byz Bzw Bzx Bzy Bzz ; Symmetrical 4 matrix representing moment of inertia tensor : = 0 0 0 0 Ixx Ixy Ixz ; 0 Ixy Iyy Iyz 0 Ixz Iyz Izz Default assumption used for all asserted statements and expressions in this notebook is that previously defined entities q, q, q 2, A, B and are on field of, i.e. that their components are elements in : $Assumptions = latten@8 ToList ê@ 8 q, q, q2 <, A,B, < Reals; ü Different Types of Multiplications The ordirary notation for multiplication in Mathematica is A. B a ä b p ** q multiplication between matrices ("dot" multiplication) cross-product between 3D vectors quaternion multiplication (both in Quat.m and Mathematica Quaternions package) Beside the ordinary notation for multiplication, this document also introduces the following notation based on the center dot ( ) operator. A B p q q A := multiplication between matrices := quaternion multiplication := column-wise quaternion-matrix multiplication Note that the center dot operator in Mathematica is without built-in meaning. ô Matrix multiplication Define center dot operator A B as matrix multiplication (otherwise, Mathematica uses plain dot "." for matrix multiplications). CenterDot@ m? MatrixQ D := Dot@ m D ô Quaternion multiplication Mathematica uses non-commutative multiply (**) operator as symbol for quaternion multiplication. The Quat.m package and this document follow this convention. Here we define also the center dot operator as symbol for quaternion multiplication, just for convinience and esthetics CenterDot@ q? Q D := NonCommutativeMultiply@ q D

Rotations of Tensors using Quaternions v0.3.nb 3 ô Column-wise (or horizontal) quaternion-matrix multiplication Let us now define multiplication between quaternion q and matrix M, where it is assumed that matrix is a row vector of quaternions in columns, i.e. M = H q q 2... q n L, so that quaternion multiplication is done between q and q j in every column j. q q j q n qq q j = qq j qq n q q 2 q n q q 2 q n q ÿ q 2 q 22 q 2n q 3 q 32... q 3n := q 2 q 22 q 2n q 3 q 32... q 3n q 4 q 42 q 4n q 4 q 42 q 4n Since the quaternion multiplication is not commutative, there are several cases to distinguish: a) Left multiplication q ÿ M, where a quaternion in each column in M is multiplied by the quaternion q from the left: CenterDot@ q_? Q, mat_? MatrixQ D := Transpose@ TableA ToListA q To @ mat PAll,jT, 9j,, Dimensions@matD P2T = b) Right multiplication M ÿ q, where a quaternion in each column in M is multiplied by the quaternion q from the right: CenterDot@ mat_? MatrixQ, q_? Q D := Transpose@ TableA ToListA To @ mat PAll,jT q, 9j,, Dimensions@matD P2T = c) Compound multiplication from both sides p ÿ M ÿ q, where multiplication of each column in M by the quaternion p from the left and q from the right: CenterDot@ q_? Q, mat_? MatrixQ, q2_? Q D := Transpose@ TableA ToListA q To @ mat PAll,jT q2, 9j,, Dimensions@matD P2T = The multiplication between a quaternion and a matrix is associative, i.e. it holds: q ÿ M ÿ q 2 ã q ÿ HM ÿ q 2 L ã Hq ÿ ML ÿ q 2 which is proved as a theorem in the following sections. Note that for a single column matrix M, the multiplication between a quaternion and a matrix falls back to an ordinary quaternion multiplication. ô Row-wise (or vertical) quaternion-matrix multiplication Row-wise quaternion-matrix multiplication can be defined by transposing matrices and using column-wise multiplication: I q ÿ M ÿ q 2 M ô Conj[] matrix operator Conj[] operator conjugates only the vector part of the matrix, but not the scalar and the cross product parts: Conj@ q_? MatrixQ D := q P,T q P,2T q P,3T q P,4T q P2,T q P2,2T q P2,3T q P2,4T q P3,T q P3,2T q P3,3T q P3,4T q P4,T q P4,2T q P4,3T q P4,4T Note that Conj[] is not a conjugate of a quaternion! The conjugate of a quaternion corresponds to the plain transpose of the matrix.

4 Rotations of Tensors using Quaternions v0.3.nb Idea behind quaternion-matrix multiplication Basic idea behind the quaternion-matrix multiplication comes from an expression: AssertA @, 0, 0, 0 D q @, 0, 0, 0 D q, for which it is assumed to be also valid when transforming identity matrix I4 that is equvalent representation of the quaternion [, 0, 0, 0 ] in matrix form, i.e. that there should be kind of multiplication where: H 0 0 0 L q H 0 0 0 L q, ü Theorems ô Quaternion-matrix multiplication Quaternion multiplication associativity (sanity-check): q q q2 q H q q2l Hq ql q2 Quaternion-matrix multiplication associativity theorems: q A q2 q H A q2 L H q A L q2 q A q H q A L q q A q q H A q L H q I4 L q I4 H I4 q L I4 q Hq I4L A q A HI4 ql A A q Hq I4L HI4 q2l q I4 q2

Rotations of Tensors using Quaternions v0.3.nb 5 HI4 q2l HHq I4L A L Hq AL q2 q A q2 HI4 q2l Hq I4L A q A q2 Ï HI4 q2l Hq I4L A q A q2 Ï Hq I4L HI4 q2l A q A q2 Ï Hq I4 q2l A q A q2 Conjugations of quaternion-matrix multiplications: Conj@ q A D Conj@AD q Conj@ A q D q Conj@AD Conj@ q A q2d Conj@ q HA q2ld Conj@A q2d q q2 Conj@AD q Conj@ q A q D q Conj@AD q ô Left and right rotation matrices Because the quaternion multiplication is bilinear, it can be expressed in a matrix form, and in two different ways ([]). Multiplication on the left qp gives L q ÿp where p is now treated as a 4-dimensional column vector p and multiplication on the right pq gives p ÿr q. Let us define L q and R q as quaternion-multiplication with identity matrix: ClearAll@ L, R, Q D L q_ := q I4 R q_ := I4 q Q q_ := L q R q Proof that the quaternion multiplication can be decomposed into L&R matrix parts and that L q R q * p corresponds to qpq * : AssertA L q R q ToVector@qD ToVector@ q q q D, ô Properties of L, R and Q matrices L q IL q M R q IR q M I q R q M A q I R q A M IL q A M q

6 Rotations of Tensors using Quaternions v0.3.nb Q q L q R q IR q L q M IR q L q M R q L q Q q R q L q == L q R q Q q Q q q 4 I4 ConjAL q A q ConjA q IL q AM êêassert ConjAL q A q ConjAL q A q ô L & R matrices components Grid @9 9 "L q ", "L q ", "R q ", "R q " =, 9 L q êê Qorm, L q êê Qorm, R q êê Qorm, R q êê Qorm = = L q L q R q R q w x y z w x y z w x y z w x y z x w z y y z w x z y x w x w z y y z w x z y x w x w z y y z w x z y x w x w z y y z w x z y x w ô Rotation matrix Q components Grid @9 9 "Q q L q R q R q L q ", "Q q L q R q R q L q " =, 9 SimplifyA Q q, êê Qorm, SimplifyA Q q, êê Qorm = = Q q L q R q R q L q Q q L q R q R q L q 0 0 0 0 0 0 0 2y 2 2z 2 2xy 2wz 2Hw y+ xzl 0 2y 2 2z 2 2 Hx y+ wzl 2 wy+ 2xz 0 2 Hx y+ wzl 2x 2 2z 2 2wx+ 2yz 0 2 x y 2wz 2x 2 2z 2 2 Hw x+ yzl 0 2 wy+ 2xz 2Hw x+ yzl 2x 2 2y 2 0 2 Hw y+ xzl 2 wx+ 2yz 2x 2 2y 2 ô Shoemake's rotation matrix from quaternion Classical Shoemake's form of the rotation matrix from a quaternion is given as (a transformation matrix based on the Cayley- Klein parameters; see [2]): RotationMatrix4@ q D êê Qorm 0 0 0 0 2 Iy 2 + z 2 M 2xy 2wz 2wy+ 2xz 0 2xy+ 2wz 2 Ix 2 + z 2 M 2 wx+ 2yz 0 2 wy+ 2xz 2wx+ 2yz 2 Ix 2 + y 2 M

Rotations of Tensors using Quaternions v0.3.nb 7 ô Scalar, vector and cross-product parts of L&R matrices Scalar part: 2 IL q + L q M 2 IR q + R q M Vector part: w 0 0 0 0 w 0 0 0 0 w 0 0 0 0 w 2 IL q R qm == 2 IR q L qm 0 x y z x 0 0 0 y 0 0 0 z 0 0 0 2 IL q R q M == 2 IR q L q M 0 x y z x 0 0 0 y 0 0 0 z 0 0 0 Cross product part: 2 IL q R q M 0 0 0 0 0 0 z y 0 z 0 x 0 y x 0 2 IL q R q M 0 0 0 0 0 0 z y 0 z 0 x 0 y x 0 Q Q + 2 Q (vector part) form. Note that the vector part is a pure imaginary part of a quaternion. To @0 q 2 + 2 q To @Im@q D q 2 Q q == L q L q + 2 L q 0 x y z x 0 0 0 y 0 0 0 z 0 0 0 L q L q + 2 L q 2 IR q L qm L q R q 2 L q IL q L q Q q M == 2 IL q R q M

8 Rotations of Tensors using Quaternions v0.3.nb quality of rotation matrix from quaternion and uler-rodrigues' formula uler-rodrigues' formula for the rotation matrix corresponding to a rotation by an angle q about a fixed axis specified by the unit vector u. Reference: http://mathworld.wolfram.com/rodriguesrotationormula.html ulerrodrigues@ θ_, 8 x_, y_, z_ <D:= Cos@θD 0 0 0 0 0 0 + H Cos@θDL xx yx zx xy yy zy xz yz zz + Sin@θD 0 z y z 0 x y x 0 Proof that the rotation matrix from a quaternion (as defined in Quat.m package) is equivalent to uler-rodrigues' formula. BlockA 8 x, y, z, θ, q<, q = To $AngleAxis@ θ, 8 x, y, z <D; AssertA RotationMatrix@ q D ulerrodrigues@ θ, 8 x, y, z <D, Assumptions π θ πïx 2 + y 2 + z 2 Ï8x, y, z, θ < Reals ô Rotation matrix theorems RM = RotationMatrix4@ q D; RM êê Qorm 0 0 0 0 2 Iy 2 + z 2 M 2xy 2wz 2wy+ 2xz 0 2xy+ 2wz 2 Ix 2 + z 2 M 2 wx+ 2yz 0 2 wy+ 2xz 2wx+ 2yz 2 Ix 2 + y 2 M RM Q q L q R q Ì RM Q q R q L q, AssertA RM ToVector@qD L q R q ToVector@qD ToVector@ q q q D,

Rotations of Tensors using Quaternions v0.3.nb 9 RM A RM Q q A Q q L q R q A L q R q J q H q A q L q N, I4 Hq I4 q L I4 Hq I4 q L IL q R q M I4 IL q R q M L q R q I4 R q L q L q IR q I4 R q M L q, RM A RM Hq I4 q L A Hq I4 q L IL q R q M A IL q R q M L q R q A R q L q L q IR q A R q M L q, Proof that both Q q and R M are orthogonal matrices: Q q Q q IL q R q M IL q R q M L q R q IR q M IL q M L q R q R q L q I4,

0 Rotations of Tensors using Quaternions v0.3.nb AssertA Q q Q q Q q Q q RM RM I4, ô Quaternionic meaning of RHqL A RHqL T The hint how quaternion multplication affects a (moment of inertia or any other) tensor A can be seen from the earlier proven theorem: RM A RM J q H q A q L q N, which shows that the tensor A is rotated, at first, by rotating quaternions across each column A c = q ÿ A ÿ q *, and at second, by rotating quaternions across each row A rc = Iq ÿ HA c L ÿ q * M. q ÿ HL q ÿ HL q q 2 q 3 q 4 q 2 q 22 q 23 q 24 q 3 q 32 q 33 q 34 q 4 q 42 q 43 q 44 HL ÿ q * HL ÿ q * The meaning of the compound multiplications across columns and rows is extracting and affecting individual components of quaternions embedded from the previous rotations of the tensor. The moment of inertia tensor can always be reduced to its principal axes in diagonal form. In a matrix representation of a quaternion, the diagonal of the matrix contains the repeated scalar (real) part of the quaternion. (or any quaternion q there exist quaternion p such that qp is scalar.) The principal moment of inertia, on the other hand, has on its diagonal three different scalars in general case, which gives origin to three different quaternions that are embedded and independently shuffled across-columns/rows during rotations. ü References [] berly, David H. with a contrib. by Shoemake, Ken - Game Physics, Morgan Kaufmann, 2004, Chapter 0 "Quaternions", pp. 507-544, http://books.google.se/books?id=a9szhpj0mwc [2] Shoemake, Ken - Uniform random rotations, in: D. Kirk (d.), Graphics Gems III, Academic Press, London, 992, pp. 24-32, http://books.google.se/books?id=xmw_u3mqlmqc [3] Shoemake, Ken - Quaternions, Department of Computer and Information Science, University of Pennsylvania, 2005-0-07, downloaded from C+MS course CS7 at Caltech: http://courses.cms.caltech.edu/cs7/quatut.pdf