Reference: “3D Math Primer for Graphics and Game Development”, chapter 4 INTRO TO MATRICES.

Slides:



Advertisements
Similar presentations
Intro to Matrices Reference: “3D Math Primer for Graphics and Game Development”, chapter 4.
Advertisements

Matrices A matrix is a rectangular array of quantities (numbers, expressions or function), arranged in m rows and n columns x 3y.
Lecture 9: Introduction to Matrix Inversion Gaussian Elimination Sections 2.4, 2.5, 2.6 Sections 2.2.3, 2.3.
Chapter 2 Matrices Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
3_3 An Useful Overview of Matrix Algebra
Maths for Computer Graphics
Goldstein/Schnieder/Lay: Finite Math & Its Applications, 9e 1 of 86 Chapter 2 Matrices.
Matrix Operations. Matrix Notation Example Equality of Matrices.
Chapter 2 Matrices Definition of a matrix.
ECIV 520 Structural Analysis II Review of Matrix Algebra.
MOHAMMAD IMRAN DEPARTMENT OF APPLIED SCIENCES JAHANGIRABAD EDUCATIONAL GROUP OF INSTITUTES.
Finite Mathematics & Its Applications, 10/e by Goldstein/Schneider/SiegelCopyright © 2010 Pearson Education, Inc. 1 of 86 Chapter 2 Matrices.
Computer Graphics (Fall 2005) COMS 4160, Lecture 2: Review of Basic Math
Intro to Matrices Don’t be scared….
Arithmetic Operations on Matrices. 1. Definition of Matrix 2. Column, Row and Square Matrix 3. Addition and Subtraction of Matrices 4. Multiplying Row.
Gauss-Jordan Matrix Elimination Brought to you by Tutorial Services – The Math Center.
Reference: “3D Math Primer for Graphics and Game Development”, chapter 4 INTRO TO MATRICES.
CE 311 K - Introduction to Computer Methods Daene C. McKinney
Week 4 - Monday.  What did we talk about last time?  Vectors.
Chapter 7 Matrix Mathematics Matrix Operations Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Elementary Linear Algebra Howard Anton Copyright © 2010 by John Wiley & Sons, Inc. All rights reserved. Chapter 1.
2IV60 Computer Graphics Basic Math for CG
Foundations of Computer Graphics (Fall 2012) CS 184, Lecture 2: Review of Basic Math
1 Matrix Math ©Anthony Steed Overview n To revise Vectors Matrices n New stuff Homogenous co-ordinates 3D transformations as matrices.
Elementary Linear Algebra Howard Anton Copyright © 2010 by John Wiley & Sons, Inc. All rights reserved. Chapter 1.
Graphics CSE 581 – Interactive Computer Graphics Mathematics for Computer Graphics CSE 581 – Roger Crawfis (slides developed from Korea University slides)
6.837 Linear Algebra Review Patrick Nichols Thursday, September 18, 2003.
ECON 1150 Matrix Operations Special Matrices
Patrick Nichols Thursday, September 18, Linear Algebra Review.
Little Linear Algebra Contents: Linear vector spaces Matrices Special Matrices Matrix & vector Norms.
THU, JAN 8, 2015 Create a “Big Book of Matrices” flip book using 4 pages. Do not make your tabs big! BIG BOOK OF MATRICES What is a Matrix? Adding & Subtracting.
ENM 503 Block 2 Lesson 7 – Matrix Methods
6.837 Linear Algebra Review Patrick Nichols Thursday, September 18, 2003.
Row 1 Row 2 Row 3 Row m Column 1Column 2Column 3 Column 4.
CMPS 1371 Introduction to Computing for Engineers MATRICES.
Overview Definitions Basic matrix operations (+, -, x) Determinants and inverses.
Chapter 2 Systems of Linear Equations and Matrices
Matrices. A matrix, A, is a rectangular collection of numbers. A matrix with “m” rows and “n” columns is said to have order m x n. Each entry, or element,
10.4 Matrix Algebra 1.Matrix Notation 2.Sum/Difference of 2 matrices 3.Scalar multiple 4.Product of 2 matrices 5.Identity Matrix 6.Inverse of a matrix.
Matrices. Definitions  A matrix is an m x n array of scalars, arranged conceptually as m rows and n columns.  m is referred to as the row dimension.
6.837 Linear Algebra Review Rob Jagnow Monday, September 20, 2004.
Linear Algebra 1.Basic concepts 2.Matrix operations.
Lesson 11-1 Matrix Basics and Augmented Matrices Objective: To learn to solve systems of linear equation using matrices.
Copyright © 2011 Pearson Education, Inc. Solving Linear Systems Using Matrices Section 6.1 Matrices and Determinants.
 6. Use matrices to represent and manipulate data, e.g., to represent payoffs or incidence relationships related in a network.  7. Multiply matrices.
MATRIX A set of numbers arranged in rows and columns enclosed in round or square brackets is called a matrix. The order of a matrix gives the number of.
Intro to Matrices Reference: “3D Math Primer for Graphics and Game Development”, chapter 7.1.
Linear Algebra Review Tuesday, September 7, 2010.
Linear Algebra Engineering Mathematics-I. Linear Systems in Two Unknowns Engineering Mathematics-I.
Designed by Victor Help you improve MATRICES Let Maths take you Further… Know how to write a Matrix, Know what is Order of Matrices,
Matrix Algebra Definitions Operations Matrix algebra is a means of making calculations upon arrays of numbers (or data). Most data sets are matrix-type.
Matrices. Variety of engineering problems lead to the need to solve systems of linear equations matrixcolumn vectors.
1 SYSTEM OF LINEAR EQUATIONS BASE OF VECTOR SPACE.
Section 6-2: Matrix Multiplication, Inverses and Determinants There are three basic matrix operations. 1.Matrix Addition 2.Scalar Multiplication 3.Matrix.
1 Matrix Math ©Anthony Steed Overview n To revise Vectors Matrices.
College Algebra Chapter 6 Matrices and Determinants and Applications
MTH108 Business Math I Lecture 20.
Linear Algebra review (optional)
Chapter 7 Matrix Mathematics
Matrix Operations Add and Subtract Matrices Multiply Matrices
Matrix Operations SpringSemester 2017.
MATRICES MATRIX OPERATIONS.
Lecture 11 Matrices and Linear Algebra with MATLAB
Matrix Solutions to Linear Systems
Review of Matrix Algebra
Lecture 8 System of Linear Differential Equations fall semester
Linear Algebra review (optional)
MATRICES MATRIX OPERATIONS.
Matrix Operations SpringSemester 2017.
Presentation transcript:

Reference: “3D Math Primer for Graphics and Game Development”, chapter 4 INTRO TO MATRICES

MATRICES VS. VECTORS Two ways of looking at this: Three Vector2’s – Column-Major Two Vector3’s – Row-Major Used in Right-handed systems Used in Left-handed systems (and in the book)

 Take this matrix:  The dimension of M is: 2x3 (2 rows, 3 columns – always put the row number first – even in left-handed systems)  The elements are referred to like this:  0 is m00 4 is m01 9 is m02  -1 is m10 2 is m11 5 is m12  Note: The book uses m11 for 0 (the “index numbers” are 1-based; I use 0-based “index numbers”) DIMENSIONS OF A MATRIX (4.1)

 A square matrix has dimensions n x n  In other words, the #rows = #columns  We’ll mainly use 4x4 and 3x3 matrices  There are some “Shortcuts” you can take for some square matrices.  A special square matrix is the identity matrix  Multiplying by the identity doesn’t change anything  Compare this to the multiplicative identity (1.0)  For 3x3…  For 4x4… SQUARE + IDENTITY MATRICES (4.1.2)

VECTORS & MATRICES (4.1.3) But…it’s also a 1x3 matrix Which is also a 3x1 matrix

 “Flips” the matrix along the diagonal.  Transpose is indicated by using a “T” super-script  This doesn’t mean raise the matrix to the “T” power. TRANSPOSITION (4.1.4)

 Example: TRANSPOSITION, CONT. The first column of M becomes the first row of. The second column of M becomes the second row of. Another observation: if the dimension of M is n x m, the dimension of M T is m x n.

 First, you must decide if you can even do the multiplication:  The first matrix must have #cols = the second matrix’s #rows.  Said mathematically,  The result (C) will be a matrix of dimension m x p.  NOTE: Matrix multiplication is NOT commutative. MATRIX-MATRIX MULTIPLICATION (4.1.6) Must be the same. Dimension of result.

MATRIX-MATRIX MULTIPLICATION, CONT. Example: Q: Can we do A * B? A: “2x3” times “3x4”. Yes A’s #cols=B’s #rows Q: What is the dimensions of the result? A: “2x4” The of value of the element in the R’th row and the C’th column is:

MATRIX-MATRIX MULTIPLICATION, CONT.

MATRIX-VECTOR MULTIPLICATION Note: I’ll soon use a term for this operation: “w was TRANSFORMED into r by M” “M is a TRANSFORMATION matrix”

 A collection of linear equations.  E.g. I went to the store twice.  The first time, I bought 5 apples and 2 pears for $4  The next time, I bought 1 apple and 3 pears for $2.75  Q: What is the unit price of each? OK, BUT WHAT IS THE MATRIX? As a set of linear equations 5a + 2p = 4 a + 3p = 2.75

MATRIX INVERSE

 Some things to note when inverting:  Multiplying a row (and the right-side) by a scalar doesn’t change the meaning.  E.g. “I bought 5 apples and 2 pears for $4” gives us the same info as “I bought 10 apples and 4 pears for $8”  Interchanging rows doesn’t change anything.  A matrix is just a list of equations.  Adding a row to another doesn’t change anything.  Maybe not so obvious…  Eq1: 5a + 2p = 4  Eq2: a + 3p = 2.75  Adding Eq1 to Eq2:  Eq2’: 6a + 5p = 6.75  The equation has definitely changed, but the information in the set hasn’t…  These are the “tools” used to calculate the matrix inverse. MATRIX INVERSE, CONT.

 Repeat for each value of i from 0 to n-1 (where the matrix is n x n): a.Find the row (looking at rows i to n-1) with the biggest value in column i. The row number is the pivot and the biggest value is the pivot value. i.If the pivot value is 0, there is no inverse. STOP. b.Multiply row# pivot by 1.0 / pivot_value. c.For every row except that of the pivot index, add a multiple of the pivot row such that we get 0 in the pivot column. d.If necessary, swap the pivot row so that it is in row i.  The inverse of the matrix is the final n columns of the augmented matrix. INVERTING A MATRIX (GAUSSIAN ELIMINATION) Carl Friedrich Gauss (1777 – 1855AD) "Nine Chapters on the Mathematical Arts" (179BC)

PRACTICE

 For orthonormal (which are common in graphics)…  ortho = orthogonal (all columns are perpendicular)  normal = all columns are unit-length  …the inverse is just the transpose! AN OPTIMIZATION