1 / 30

COMP 4290

Week 4 - Monday. COMP 4290. Last time. What did we talk about last time? Vectors. Questions?. Project 1. Geometric Interpretations. Interpretations. A vector can either be a point in space or an arrow (direction and distance)

marcelr
Download Presentation

COMP 4290

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Week 4 - Monday COMP 4290

  2. Last time • What did we talk about last time? • Vectors

  3. Questions?

  4. Project 1

  5. Geometric Interpretations

  6. Interpretations • A vector can either be a point in space or an arrow (direction and distance) • The norm of a vector is its distance from the origin (or the length of the arrow) • In R2 and R3, the dot product is: where  is the smallest angle between u and v

  7. Projections • We can find the orthogonal projection w of vector u onto vector v • Essentially, this means the part of u that's in v

  8. 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:

  9. Cross product rules • In addition • wu and wv • u, v,and w form a right-handed system

  10. 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

  11. Student Lecture: Matrices

  12. Matrices

  13. 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

  14. Identity matrix • The identity or unit matrixI is a square matrix whose diagonal is all ones with zeroes elsewhere

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

  16. 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

  17. 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

  18. 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

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

  20. 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

  21. Properties of matrix-matrix multiplication • Properties: • (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

  22. 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

  23. 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

  24. 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 subdeterminantdij to define the adjoint • The adjointA of an arbitrary sized matrix M is: • For a 3 x 3:

  25. 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:

  26. 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

  27. 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 Mviffu  v • If M and N are orthogonal, so is MN • An orthogonal matrix is equivalent to an orthonormal basis of vectors lined up together

  28. Upcoming

  29. Next time… • Geometric techniques • Any trigonometry that seems useful

  30. Reminders • CS Club tonight! • 4-6 p.m. in The Point 113 • Keep reading Appendix A • Read Appendix B • Keep working on Project 1, due next Friday

More Related