MSMS Vectors and Matrices Basilio Bona DAUIN Politecnico di Torino Semester 1, 2015-2016 B. Bona (DAUIN) MSMS-Vectors and matrices Semester 1, 2015-2016 1 / 39
Introduction Most of the topics introduced in this course require the knowledge of few basic mathematical concepts and tools, namely those of VECTORS and MATRICES. Loosely speaking, vectors are used to represent many different quantities (physical and geometrical) in the three-dimensional (3D) space, and matrices are used as operators, acting on vectors. Vectors are a way to represent points in the 3D space or physical quantities that have both a magnitude and a direction. Vector may also have a number of other meanings depending on context. The 3D space is also called Euclidean Space, since we assume that it is endowed with a number of properties, that we will specify later on, coming from the axioms of geometry due to Euclid. B. Bona (DAUIN) MSMS-Vectors and matrices Semester 1, 2015-2016 2 / 39
Introduction Vectors are mainly used in this course to represent two types of mathematical or physical entities, namely geometrical quantities, like points, lines, planes, etc., and physical quantities, like velocities, accelerations, forces, torques, gradients, etc. To use vectors and operate on them, it is necessary to understand their mathematical representation. This representation may assume different forms, but in a 3D space it always consists of three real numbers, called the vector components. Vectors obey to a number of rules that will be specified later on. B. Bona (DAUIN) MSMS-Vectors and matrices Semester 1, 2015-2016 3 / 39
Introduction Matrices are mainly used in this course to represent two types of operators, namely rigid motions in 3D, and operators acting on vectors to transform them for some specified scope. To use matrices and operate on them, it is necessary to give them a mathematical representation. This representation may assume different forms, but in a 3D space is always determined by a row-column array of real numbers, called the matrix components. Matrices obey to a number of rules that will be specified later on. B. Bona (DAUIN) MSMS-Vectors and matrices Semester 1, 2015-2016 4 / 39
Introduction In these slides a generic vector v is written as a small boldface fonts, but often you may find other graphical symbols, small or capital, boldface or not, with arrows or underlined; see some examples v, v, v, V, v, v, V, v, v On the blackboard, for practical reasons, vectors will be always small underlined fonts, as in v. In these slides a generic matrix M is written in capital boldface font, but you can find the same variety of representations as with vectors. On the blackboard, for practical reasons, matrices will be always capital non-underlined fonts, as in M. Many textbooks, coming from the mechanical engineering community, represents vectors and matrices in the following way vector {V}, matrix [M] B. Bona (DAUIN) MSMS-Vectors and matrices Semester 1, 2015-2016 5 / 39
1. Geometrical vectors The position of a geometrical point P in n-dim space is always given by n coordinates, relative to some pre-defined reference frame. The most used reference frame is the orthogonal cartesian reference frame (or simply cartesian frame). In orbit dynamics, the 3D polar frame is often used. If we want to represent a geometrical point, we use a geometrical vector p to represents it. If the point P is in the 3D space R 3 then the representation is p a R 3 = p x p 1 p y p z p i is the i-th coordinate; the index a indicates the reference frame R a that we use to represented the point. If we change the reference frame, the representation changes too. We will see later how to transform the point representation from one frame to another. a B. Bona (DAUIN) MSMS-Vectors and matrices Semester 1, 2015-2016 6 / 39 p 2 p 3 a
Affine geometry To treat points as vectors implies the definition of a zero point (the origin of the reference frame), i.e., a point with particular privileged place in space. Since, in many applications, this may not be required, a particular geometry that is origin-free must be considered. This geometry is called affine geometry and is defined on affine spaces. Affine geometry is at the base of projective geometry and perspective transforms, as well as homogeneous vectors, that are the mathematical tools for image representation and analysis in computer graphics. Affine geometry will not be considered in this course. B. Bona (DAUIN) MSMS-Vectors and matrices Semester 1, 2015-2016 7 / 39
2. Physical vectors Many physical quantities possess both magnitude and direction. If we want to represent them, we use again the vector notation. A physical vector QP represents a physical quantity, for instance, linear or angular velocity, gravitational acceleration, force, torque, gradient, etc. Therefore, a physical vectors may be represented by an oriented segment (or directed line segment), with an application point Q (that can be free to move in space or constrained to some body), a direction and a magnitude. QP may be reference-free (e.g., physically independent from the way we represent it, or from an origin), and sometimes it is customary to represent it by the difference of two geometrical vectors (for example to represent a translation) QP =(P Q) v QP R 3 =p q= p 1 q 1 p 2 q 2 v 1 v 2 p 3 q 3 v 3 B. Bona (DAUIN) MSMS-Vectors and matrices Semester 1, 2015-2016 8 / 39
Examples Ex1: the local gravitational acceleration has direction and magnitude that are absolute, since they do not depend on the reference frame chosen, but on the space-time geometry. Usually, having define a local reference frame with the z-axis pointing upward, the gravity acceleration is represented by the vector g= 0 0 G where G varies from one place to the other, but is approximately equal to G =9,81ms 2 on the Earth surface. Ex2: the velocity of a body is given by a vector that may have different representations in different reference frames, but its magnitude is independent from the reference frame chosen. B. Bona (DAUIN) MSMS-Vectors and matrices Semester 1, 2015-2016 9 / 39
Physical vectors The lines below give some more ideas. Figure: Physical vectors. B. Bona (DAUIN) MSMS-Vectors and matrices Semester 1, 2015-2016 10 / 39
Physical vectors We represents physical vectors using an icon; the most used icon is the arrow. Figure: The arrow icon. Obviously this arrow does not exist in space, and can often be misleading, considering the following properties of physical vectors. B. Bona (DAUIN) MSMS-Vectors and matrices Semester 1, 2015-2016 11 / 39
Polar vectors There are two types of physical vectors: polar and axial ones. Polar vectors (see [01]) are physical vectors that are symmetrical wrt a reflection through a parallel plane, and are skew-symmetrical wrt a reflection through a perpendicular plane. Examples of physical polar vectors are displacements, linear velocities and forces. Figure: Polar vector. B. Bona (DAUIN) MSMS-Vectors and matrices Semester 1, 2015-2016 12 / 39
Axial vectors Axial vectors are physical vectors that are skew-symmetrical wrt a reflection through a parallel plane, and are symmetrical wrt a reflection through a perpendicular plane. Examples of physical axial vectors are angular velocities, torques, magnetic field due to electrical currents, etc. Figure: Axial vector. B. Bona (DAUIN) MSMS-Vectors and matrices Semester 1, 2015-2016 13 / 39
Discussion The different symmetry properties of polar and axial vectors show that the arrow icon may be a misleading icon. One must therefore always keep in mind the meaning of the associated entity, that can be a geometrical point, a translation, a velocity, a torque, etc. B. Bona (DAUIN) MSMS-Vectors and matrices Semester 1, 2015-2016 14 / 39
3. Mathematical vectors The name vector is also given to mathematical entities. In particular a (mathematical) vector is an abstract entity belonging to a vector space. Vector Space Given a field F ={F;+, }, a vector space V(F), is the set of elements, called vectors, and two operators + and, that satisfy the following axiomatic properties: Vector sum: the operation +, called vector sum, is defined so that {V(F); +} is a commutative (abelian) group; the identity element is called 0; v+0=v Product by a scalar: For each α F and each v V(F), it exists a vector αv V(F); B. Bona (DAUIN) MSMS-Vectors and matrices Semester 1, 2015-2016 15 / 39
Vector space For each α,β F and each v,w V(F) the following relations hold true: associative property wrt product by a scalar: α(βv)=(αβ)v existence of the identity wrt product by a scalar: 1(v)=v; v distributive property wrt vector sum: α(v+w)=αv+αw distributive property wrt product by a scalar: (α+ β)v=αv+βv B. Bona (DAUIN) MSMS-Vectors and matrices Semester 1, 2015-2016 16 / 39
Linear functions and dual spaces Given two vector spaces, V(F) and U(F), both defined on the same field F, a function f :V U is linear, if, for every v,w V and λ F the following axioms are true: f(v+w)=f(v)+f(w)=fv+fw f(λv)=λf(v)=λfv The linear function L :U U is also called linear operator, linear transformation, linear application or endomorphism. The set of all linear functions L :U V defines a linear vector space L(F). The set of all linear function L from V(F) to F (where usually F =R) L :V R, defines a dual vector space, called V (F). Given a vector v V(F), the simplest example of dual vector v V (F) is v1v 1 + +vnv n = v,v = v,v ; f :=v = [ v1 vn ] B. Bona (DAUIN) MSMS-Vectors and matrices Semester 1, 2015-2016 17 / 39
Scalar product The definition of vector spaces does not include a product between elements of the space. But when a metric (i.e., a measure) is necessary or required, usually it is defined by the scalar product. Given two physical vectors a= QP,b= SR, the scalar product or inner product a b is a real number defined (geometrically) as: a b= a b cosθ where a is the vector length and θ, (0 θ 180 ) is the angle between a and b; some indicate the product as a,b (see also dual spaces). Given two mathematical vectors a,b V(R) the scalar product is defined as a b= a k b k =a T b k B. Bona (DAUIN) MSMS-Vectors and matrices Semester 1, 2015-2016 18 / 39
Properties: distributive wrt sum (x+y) z=x z+y z distributive wrt product by scalar α(x y)=(αx) y=x (αy) commutative x y=y x positive x x>0, x 0;x x=0 iff x=0 The vector norm is a quantity derived by the scalar product x = x x= xk 2 = x T x k and the angle between x and y is defined as ( ) x y θ =cos 1 x y B. Bona (DAUIN) MSMS-Vectors and matrices Semester 1, 2015-2016 19 / 39
Cross product Scalar product acts between two vectors and produces a scalar; in general we would also like to define a product that produces a vector. If we stay in the 3D case, we can define the cross product, aka external product, or vectorial product. Given two physical 3D vectors a= QP,b= SR, the cross product c=a b is a vector orthogonal to the plane of a,b, whose length is c = a b sinθ where θ is the minimum angle that takes a to b counterclockwise (right-hand rule). Given two mathematical vectors x= [ x 1 x 2 x 3 ] T, y= [ y1 y 2 y 3 ] T, with x,y R 3 the cross product x y is a vector z such that z=x y= x 2y 3 x 3 y 2 x 3 y 1 x 1 y 3 x 1 y 2 x 2 y 1 B. Bona (DAUIN) MSMS-Vectors and matrices Semester 1, 2015-2016 20 / 39
This relation can be written as z=x y= x 2y 3 x 3 y 2 x 3 y 1 x 1 y 3 = 0 x 3 x 2 x 3 0 x 1 y 1 y 2 =S(x)y x 1 y 2 x 2 y 1 x 2 x 1 0 y 3 where S(x) is a skew-symmetric matrix. Cross Product Properties: anticommutative x y= (y x) distributive wrt sum x (y+z)=(x y)+(x z) distributive wrt product by a scalar α(x y)=(αx) y=x (αy) non associative x (y z) (x y) z Jacobi identity a (b c)+b (c a)+c (a b)=0 B. Bona (DAUIN) MSMS-Vectors and matrices Semester 1, 2015-2016 21 / 39
Given three 3D vectors x,y,z, the triple product is a non associative product: x (y z) (x y) z with the following (Grassmann) identities: x (y z) = (x z)y (x y)z (x y) z = (x z)y (y z)x The following relation (between scalars) holds as well (x y) z= (z y) x The cross product is only defined in R 3 ; in order to generalize it in higher dimensional spaces n > 3 it is necessary to introduce the Clifford Algebras. B. Bona (DAUIN) MSMS-Vectors and matrices Semester 1, 2015-2016 22 / 39
Conclusions The operations and properties illustrated above may be applied to physical vectors, and sometimes to geometrical vectors, to produce meaningful results; for example, given the angular velocity ω of a body, we can compute the linear velocity v of a geometrical point p on the body, as v=ω p Figure: Example. B. Bona (DAUIN) MSMS-Vectors and matrices Semester 1, 2015-2016 23 / 39
Matrices Some matrices are of particular interest in dynamic modelling; namely the orthogonal and the skew-symmetric matrices, apart from others types that will be introduced when used. B. Bona (DAUIN) MSMS-Vectors and matrices Semester 1, 2015-2016 24 / 39
Orthogonal matrices A square matrix A R n is called orthogonal when with α i 0. α 1 0 0 A T 0 α A= 2 0...... 0 0 α n A square orthogonal matrix U R n is called orthonormal when all the constants α i are 1: U T U=UU T =I Therefore U 1 =U T B. Bona (DAUIN) MSMS-Vectors and matrices Semester 1, 2015-2016 25 / 39
Orthonormal matrices Other properties: The columns, as well as the rows, of U are orthogonal to each other and have unit norm. U =1; The determinant of U has unit module: det(u) =1 therefore it can be +1 or 1. Given a vector x, its orthonormal transformation is y=ux. B. Bona (DAUIN) MSMS-Vectors and matrices Semester 1, 2015-2016 26 / 39
Orthonormal matrices If U is an orthonormal matrix, then AU = UA = A. This property in general valid also for unitary matrices, i.e., those defined as U U=I. When U R 3 3, only 3 out of its 9 elements are independent. Scalar product is invariant to orthonormal transformations, (Ux) (Uy)=(Ux) T (Uy)=x T U T Uy=x T y=x y This means that vector lengths are invariant wrt orthonormal trasformations Ux =(Ux) T (Ux)=x T U T Ux=x T Ix=x T x= x B. Bona (DAUIN) MSMS-Vectors and matrices Semester 1, 2015-2016 27 / 39
Orthonormal matrices When considering orthonormal transformations, it is important to distinguish the two cases: When det(u)=+1, U represents a proper rotation or simply a rotation, when det(u) = 1, U represents an improper rotation or reflection. The set of rotations forms a continuous non-commutative (wrt product) group; the set of reflections do not have this quality. Intuitively this means that infinitesimal rotations exist, while infinitesimal reflections do not have any meaning. Nonetheless, reflections are the most basic transformation in 3D spaces, in the sense that translations, rotations and roto-reflections (slidings) are obtained from the composition of two or three reflections B. Bona (DAUIN) MSMS-Vectors and matrices Semester 1, 2015-2016 28 / 39
Figure: Reflections producing rotations and translation in R 2. B. Bona (DAUIN) MSMS-Vectors and matrices Semester 1, 2015-2016 29 / 39
Orthonormal matrices If U is an orthonormal matrix, the distributive property wrt the cross product holds: U(x y)=(ux) (Uy) (with general A matrices this is not true). For any proper rotation matrix U and a generic vector x the following holds ( ) US(x)U T y = U x (U T y) = (Ux) (UU T y) = (Ux) y = S(Ux)y where S(x) is the skew-symmetric matrix associated with x; therefore: US(x)U T = S(Ux) US(x) = S(Ux)U B. Bona (DAUIN) MSMS-Vectors and matrices Semester 1, 2015-2016 30 / 39
Skew-symmetric matrices Skew-symmetric matrix A square matrix S is called skew-symmetric or antisymmetric when S+S T =O or S= S T A skew-symmetric matrix has the following structure 0 s 12 s 1n s A n n = 12 0 s 2n...... s 1n s 2n 0 Therefore there it has at most n(n 1) 2 independent elements. B. Bona (DAUIN) MSMS-Vectors and matrices Semester 1, 2015-2016 31 / 39
Skew-symmetric matrices For n=3 it results n(n 1) =3, hence an skew-symmetric matrix has as 2 many element as a 3D vector v. Given a vector v= [ v 1 v 2 v 3 ] T it is possible to build S, and given a matrix S it is possible to extract the associated vector v. We indicate this fact using the symbol S(v), where, by convention S(v)= 0 v 3 v 2 v 3 0 v 1 v 2 v 1 0 B. Bona (DAUIN) MSMS-Vectors and matrices Semester 1, 2015-2016 32 / 39
Skew-symmetric matrices Some properties: Given any vector v R 3 : Given two scalars λ 1,λ 2 R: Given any two vectors v,u R 3 : S T (v)= S(v)=S( v) S(λ 1 u+ λ 2 v)=λ 1 S(u)+λ 2 S(v) S(u)v=u v= v u=s( v)u=s T (v)u Therefore S(u) is the representation of the operator (u ) and viceversa. B. Bona (DAUIN) MSMS-Vectors and matrices Semester 1, 2015-2016 33 / 39
Skew-symmetric matrices The matrix S(u)S(u)=S 2 (u) is symmetrical and S 2 (u)=uu T u 2 I Hence the dyadic product can be written as D(u,u)=uu T =S 2 (u)+ u 2 I B. Bona (DAUIN) MSMS-Vectors and matrices Semester 1, 2015-2016 34 / 39
Eigenvalues and eigenvectors of skew-symmetric matrices Given an skew-symmetric matrix S(v), its eigenvalues are λ 1 =0, λ 2,3 =±j v The eigenvalue related to the eigenvector λ 1 =0 is v; the other two are complex conjugate. The set of skew-symmetric matrices is a vector space, denoted as so(3). Given two skew-symmetric matrices S 1 and S 2, we call commutator or Lie bracket the following operator that is itself skew-symmetric. [S 1,S 2 ] def = S 1 S 2 S 2 S 1 Skew-symmetric matrices form a Lie algebra, which is related to the Lie group of orthogonal matrices. B. Bona (DAUIN) MSMS-Vectors and matrices Semester 1, 2015-2016 35 / 39
Summary 1 Vectors represent geometrical points or physical quantities. 2 Vectors are associated to a representation that changes with reference frames. 3 Vectors are polar or axial. 4 Matrices represent linear transformations. 5 Orthogonal matrices represent reference frames or rotations. 6 Skew-symmetric matrices represent cross products. 7 Skew-symmetric matrices are important for angular velocities. B. Bona (DAUIN) MSMS-Vectors and matrices Semester 1, 2015-2016 36 / 39
References [01] S.L. Altmann, Icons and Symmetries, Clarendon Press, 1992. [02] Van Der Ha, Shuster, A Tutorial on Vectors and Attitude. [03] K. Jänich, Linear Algebra, Springer, 1994. [04] J. Stillwell, Mathematics and Its History, Springer, 2002. [05] J. Gallier, Geometric Methods and Applications, Springer, 2001. B. Bona (DAUIN) MSMS-Vectors and matrices Semester 1, 2015-2016 37 / 39
Additional material: Dyadic Product Given two vectors x,y R n, the dyadic product is defined as Properties x 1 y 1 x 1 y n x y=xy T =D(x,y)=. x i y i. x n y 1 x n y n (αx) y = x (αy)=α(x y) x (y+z) = x y+x z (x+y) z = x y+x z (x y)z = x(y z) x(y z) = (x y)z B. Bona (DAUIN) MSMS-Vectors and matrices Semester 1, 2015-2016 38 / 39
Some texts call this product external product, adding noise to the nomenclature, since the external product is another type of product introduce by Grassmann. The product is non commutative: xy T yx T, since D(x,y)=D T (y,x) The matrix D has always rank ρ(d)=1, whatever its dimension n. Relations between dyadic and cross product x (y z) = [(x z)i z x]y (x y) z = [(x z)i x z]y It is interesting to note that, while the cross product is only defined for 3D vectors, the right terms are defined for any dimension n. B. Bona (DAUIN) MSMS-Vectors and matrices Semester 1, 2015-2016 39 / 39