Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Matrix Math ©Anthony Steed 1999. 2 Overview n To revise Vectors Matrices n New stuff Homogenous co-ordinates 3D transformations as matrices.

Similar presentations


Presentation on theme: "1 Matrix Math ©Anthony Steed 1999. 2 Overview n To revise Vectors Matrices n New stuff Homogenous co-ordinates 3D transformations as matrices."— Presentation transcript:

1 1 Matrix Math ©Anthony Steed 1999

2 2 Overview n To revise Vectors Matrices n New stuff Homogenous co-ordinates 3D transformations as matrices

3 3 Vectors and Matrices n Matrix is an array of numbers with dimensions M (rows) by N (columns) 3 by 6 matrix element 2,3 is (3) n Vector can be considered a 1 x M matrix

4 4 Types of Matrix n Identity matrices - I n Diagonal n Symmetric Diagonal matrices are (of course) symmetric Identity matrices are (of course) diagonal

5 5 Operation on Matrices n Addition Done elementwise n Transpose “Flip” (M by N becomes N by M) Anthony Steed: EQ needs fixing Anthony Steed: EQ needs fixing

6 6 Operations on Matrices n Multiplication Only possible to multiply of dimensions –x 1 by y 1 and x 2 by y 2 iff y 1 = x 2 resulting matrix is x 1 by y 2 –e.g. Matrix A is 2 by 3 and Matrix by 3 by 4 resulting matrix is 2 by 4 –Just because A x B is possible doesn’t mean B x A is possible!

7 7 Matrix Multiplication Order n A is n by k, B is k by m n C = A x B defined by n BxA not necessarily equal to AxB

8 8 Example Multiplications

9 9 Inverse n If A x B = I and B x A = I then A = B -1 and B = A -1

10 10 3D Transforms n In 3-space vectors are transformed by 3 by 3 matrices n Example? Anthony Steed: EQ needs fixing Anthony Steed: EQ needs fixing

11 11 Scale n Scale uses a diagonal matrix n Scale by 2 along x and -2 along z

12 12 Rotation n Rotation about z axis n Note z values remain the same whilst x and y change Y X

13 13 Rotation X, Y and Scale n About X n About Y n Scale (should look familiar)

14 14 Homogenous Points n Add 1D, but constrain that to be equal to 1 (x,y,z,1) n Homogeneity means that any point in 3- space can be represented by an infinite variety of homogenous 4D points (2 3 4 1) = (4 6 8 2) = (3 4.5 6 1.5) n Why? 4D allows as to include 3D translation in matrix form

15 15 Homogenous Vectors n Vectors != Points n Remember points can not be added n If A and B are points A-B is a vector n Vectors have form (x y z 0) n Addition makes sense

16 16 Translation in Homogenous Form n Note that the homogenous component is preserved (* * * 1), and aside from the translation the matrix is I

17 17 Putting it Together n R is rotation and scale components n T is translation component

18 18 Order Matters n Composition order of transforms matters Remember that basic vectors change so “direction” of translations changed

19 19 Exercises n Show that rotation by  /2 about X and then  /2 about Y is equivalent to  /2 about Y then  /2 about X n Calculate the following matrix  /2 about X then  /2 about Y then  /2 about Z (remember “then” means multiply on the right). What is a simpler form of this matrix? n Compose the following matrix translate 2 along X, rotate  /2 about Y, translate -2 along X. Draw a figure with a few points (you will only need 2D) and then its translation under this transformation.

20 20 Summary n Rotation, Scale, Translation n Composition of transforms n The homogenous form


Download ppt "1 Matrix Math ©Anthony Steed 1999. 2 Overview n To revise Vectors Matrices n New stuff Homogenous co-ordinates 3D transformations as matrices."

Similar presentations


Ads by Google