Week 4 - Monday CS361.

Slides:



Advertisements
Similar presentations
Points, Vectors, Lines, Spheres and Matrices
Advertisements

CS 450: COMPUTER GRAPHICS LINEAR ALGEBRA REVIEW SPRING 2015 DR. MICHAEL J. REALE.
1 3D Vector & Matrix Chapter 2. 2 Vector Definition: Vector is a line segment that has the direction. The length of the line segment is called the magnitude.
Linear Algebra.
2D Geometric Transformations
Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1 : “shiv rpi” Linear Algebra A gentle introduction Linear Algebra has become as basic and as applicable.
Chapter 4.1 Mathematical Concepts
Chapter 4.1 Mathematical Concepts. 2 Applied Trigonometry Trigonometric functions Defined using right triangle  x y h.
CSCE 590E Spring 2007 Basic Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.
3-D Geometry.
Computer Graphics CSC 630 Lecture 2- Linear Algebra.
Chapter 3 Determinants and Matrices
Chapter 2 Matrices Definition of a matrix.
Ch 7.2: Review of Matrices For theoretical and computation reasons, we review results of matrix theory in this section and the next. A matrix A is an m.
CSci 6971: Image Registration Lecture 2: Vectors and Matrices January 16, 2004 Prof. Chuck Stewart, RPI Dr. Luis Ibanez, Kitware Prof. Chuck Stewart, RPI.
Computer Graphics (Fall 2005) COMS 4160, Lecture 2: Review of Basic Math
CS 450: Computer Graphics 2D TRANSFORMATIONS
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.
Linear Algebra Review By Tim K. Marks UCSD Borrows heavily from: Jana Kosecka Virginia de Sa (UCSD) Cogsci 108F Linear.
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.
Graphics Graphics Korea University cgvr.korea.ac.kr 1.2 Notation and Definition 그래픽스 연구실 정병선.
Compiled By Raj G. Tiwari
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.
1 February 24 Matrices 3.2 Matrices; Row reduction Standard form of a set of linear equations: Chapter 3 Linear Algebra Matrix of coefficients: Augmented.
Patrick Nichols Thursday, September 18, Linear Algebra Review.
Recap of linear algebra: vectors, matrices, transformations, … Background knowledge for 3DM Marc van Kreveld.
Basic Operations MultiplicationDeterminants Cramer’s RuleIdentityInverses Solving Systems of equations APPENDIX.
Matrix Algebra. Quick Review Quick Review Solutions.
Mathematics for Computer Graphics. Lecture Summary Matrices  Some fundamental operations Vectors  Some fundamental operations Geometric Primitives:
CSCE 552 Spring 2011 Math By Jijun Tang. Layered.
6.837 Linear Algebra Review Patrick Nichols Thursday, September 18, 2003.
Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1 : “shiv rpi” Linear Algebra A gentle introduction Linear Algebra has become as basic and as applicable.
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.
Matrices, Transformations and the 3D Pipeline Matthew Rusch Paul Keet.
6.837 Linear Algebra Review Rob Jagnow Monday, September 20, 2004.
Linear algebra: matrix Eigen-value Problems Eng. Hassan S. Migdadi Part 1.
CS559: Computer Graphics Lecture 8: 3D Transforms Li Zhang Spring 2008 Most Slides from Stephen Chenney.
1 Graphics CSCI 343, Fall 2015 Lecture 10 Coordinate Transformations.
Introduction to Linear Algebra Mark Goldman Emily Mackevicius.
Matrices and Determinants
CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.
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.
CS 450: COMPUTER GRAPHICS TRANSFORMATIONS SPRING 2015 DR. MICHAEL J. REALE.
Week 5 - Monday.  What did we talk about last time?  Lines and planes  Trigonometry  Transforms  Affine transforms  Rotation  Scaling  Shearing.
Computer Graphics Mathematical Fundamentals Lecture 10 Taqdees A. Siddiqi
Linear Algebra Review Tuesday, September 7, 2010.
Matrices. Variety of engineering problems lead to the need to solve systems of linear equations matrixcolumn vectors.
Lecture 1 Linear algebra Vectors, matrices. Linear algebra Encyclopedia Britannica:“a branch of mathematics that is concerned with mathematical structures.
MTH108 Business Math I Lecture 20.
CSE 167 [Win 17], Lecture 2: Review of Basic Math Ravi Ramamoorthi
Math Fundamentals Maths revisit.
Transforms.
Review of Linear Algebra
Chapter 7 Matrix Mathematics
Continuum Mechanics (MTH487)
Linear Algebra Review.
Matrix Algebra.
RECORD. RECORD Gaussian Elimination: derived system back-substitution.
Chapter 3 Linear Algebra
Matrix Algebra.
12.1 Addition of Matrices.
Linear Algebra A gentle introduction
Math review - scalars, vectors, and matrices
Game Programming Algorithms and Techniques
Presentation transcript:

Week 4 - Monday CS361

Last time What did we talk about last time? Vectors

Questions?

Project 1

Geometric Interpretations

Cross product The cross product of two vectors finds a vector that is orthogonal to both For 3D vectors u and v in an orthonormal basis, the cross product w is:

Cross product rules 𝐰 = 𝐮×𝐯 = 𝐮 𝐯 sin θ 𝐮×𝐯=−𝐯×𝐮 𝑎𝐮+𝑏𝐯 ×𝐰=𝑎 𝐮×𝐰 +𝑏(𝐯×𝐰) In addition wu and wv u, v, and w form a right-handed system

Things to remember Vectors can represents points or directions The norm of a vector gives its length The dot product of two vectors gives a measure of how much they point in the same direction A scalar! The cross product of two vectors gives a third vector, orthogonal to both of the original vectors

Drawing Primitives with Lighting in MonoGame

Student Lecture: Matrices

Matrices

A matrix A matrix M is a set of p x q scalars with each element named mij, where 0 ≤ i ≤ p – 1 and 0 ≤ j ≤ q – 1 We display them as p rows and q columns

Identity matrix The identity or unit matrix I is a square matrix whose diagonal is all ones with zeroes elsewhere

Operations We will be interested in a number of operations on matrices, including: Addition Scalar multiplication Transpose Trace Matrix-matrix multiplication Determinant Inverse

Matrix-matrix addition Similar to vector addition, matrix-matrix addition gives as its result a new matrix made up of element by element additions The two matrices must be the same size

Scalar-matrix multiplication Similar to scalar-vector multiplication, scalar-matrix addition results in a matrix where each element is multiplied by the scalar Properties 0M = 0 1M = M a(bM) = (ab)M a0 = 0 (a+b)M = aM + bM a(M + N) = aM + aN

Transpose of a matrix Transposing a matrix means exchanging its rows for columns It has the effect of mirroring the matrix around its diagonal (or close to it, if not square) Properties (aM)T = aMT (M + N)T = MT + NT (MT)T = M (MN)T = NTMT

Trace of a matrix The trace of a square matrix is the sum of its diagonal elements This is useful in defining quaternion conversions

Matrix-matrix multiplication Multiplication MN is legal only if M is p x q and N is q x r Each row of M and each column of N are combined with a dot product and put in the corresponding row and column element 𝐌𝐍=𝐓= 𝑡 𝑖𝑗 = 𝑘=0 𝑞−1 𝑚 𝑖𝑘 𝑛 𝑘𝑗

Properties of matrix-matrix multiplication (LM)N = L(MN) (L + M)N = LN + MN MI = IM = M Matrix-matrix multiplication is not commutative We can treat a vector as an n x 1 matrix and do matrix-vector multiplication similarly

Determinant The determinant is a measure of the "magnitude" of a square matrix We'll focus on determinants for 2 x 2 and 3 x 3 matrices

Subdeterminant The subdeterminant or cofactor dij of matrix M is the determinant of the (n – 1) x (n – 1) matrix formed when row i and column j are removed Below is d02 for a 3 x 3 matrix M

Adjoint The adjoint of a matrix is a form useful for transforming surface normals We can also use the adjoint when finding the inverse of a matrix We need the subdeterminant dij to define the adjoint The adjoint A of an arbitrary sized matrix M is: For a 3 x 3:

Multiplicative inverse of a matrix For a square matrix M where |M| ≠ 0, there is a multiplicative inverse M-1 such that MM-1 = I For implicit inverse, we only need to find v in the equation u = Mv, done as follows: For cases up to 4 x 4, we can use the adjoint:

Notes about the inverse For cases larger than 4 x 4, other methods are necessary: Gaussian elimination LU decomposition Fortunately, we never need more than 4 x 4 in graphics Properties of the inverse: (M-1)T = (MT)-1 (MN)-1 = N-1M-1

Orthogonal matrices A square matrix is orthogonal if and only if its transpose is its inverse MMT = MTM = I Lots of special things are true about an orthogonal matrix M |M| = ± 1 M-1 = MT MT is also orthogonal ||Mu|| = ||u|| Mu  Mv iff u  v If M and N are orthogonal, so is MN An orthogonal matrix is equivalent to an orthonormal basis of vectors lined up together

Homogeneous notation Why do we often have vectors of 4 things or 4 x 4 matrices in graphics? We have points (locations) and vectors (directions) What's really confusing is that we represent them the same way (in what looks like a vector for both) We need to translate points but translation isn't meaningful for vectors A 3 x 3 matrix can rotate, scale, or shear, but it can't translate

How we do it We add an extra value to our vectors It's a 0 if it’s a direction It's a 1 if it's a point Now we can do a rotation, scale, or shear with a matrix (with an extra row and column):

Translations Then, we multiply by a translation matrix (which doesn't affect a direction vector)

Upcoming

Next time… Geometric techniques Any trigonometry that seems useful

Reminders Keep reading Appendix A Read Appendix B Keep working on Project 1, due Friday