1 / 40

CS32310

CS32310. MATRICES. Vector vs Matrix transformation formulae. Geometric reasoning allowed us to derive vector expressions for the various transformation formulae For efficiency reasons, the transformation formulae are usually executed in matrix form. Example comparison.

dewitt
Download Presentation

CS32310

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. CS32310 MATRICES

  2. Vector vs Matrix transformation formulae • Geometric reasoning allowed us to derive vector expressions for the various transformation formulae • For efficiency reasons, the transformation formulae are usually executed in matrix form

  3. Example comparison • Consider the scaling formula, for scaling the component of vector r in the ŝdirection: • What is the operation count for executing this formula?

  4. The operation count (mults,adds) = (7,6) is for the transformation of one vector. • 3 sequential scalings (in directions ŝ1, ŝ2, ŝ3 for factors α1, α2, α3) for 1000 points Cost: 3000(7,6) = 39000 operations. • Slightly reduced cost by evaluating (α-1)ŝ once for each scaling operations (cost: 3(3,1)), and reusing these results of every point. Resulting cost: 3(3,1) + 3000(6,5) = 33012 operations

  5. Derivation of Matrix form • Take x, y, zcomponents of the vector scaling formula This leads to (with )

  6. Derivation of Matrix form • Regrouping the component formulae for leads to (with )

  7. Derivation of Matrix form • Recognise the equivalent matrix formulation of (with )

  8. Derivation of Matrix form

  9. Op count of Matrix form • Cost of setting up the matrix • (10,3) for the scaling matrix • Cost of doing one matrix multiplication A r • 3(3,2) = (9,6) • 3 elements of a 3 x 1 matrix to be computed • Same operations as for the written out form

  10. Op count of Matrix form • Consider carrying out 3 successive scaling operations in tandem

  11. Op count of Matrix form No gain over vector approach – not this way!

  12. Op count of Matrix form • Consider carrying out 3 successive scaling operations by successive substitution and concatenation:

  13. Op count of Matrix form

  14. Op count of Matrix form Back to 35

  15. Op count of Matrix form • Each of the formulae is linear and homogeneous in the vector r • Each follows the pattern • can be expressed in matrix form

  16. Op count of Matrix form • or • Details of the operation (in A) are separated from the details of the point being transformed (operand r) • Abstraction! • Concatenation possible

  17. Matrix Product • Motivation for product formula • Let Then

  18. Matrix Product Thus where

  19. Matrix Product Thus we can write C = BA where Inner product of row i and column j. Op count: (3,2) in this case.

  20. Matrix Product In general, if C = BA B and A must satisfy a compatibility constraint: No of columns in first factor (row length) = No of rows in second factor (col length)

  21. Matrix Algebra • Vectors and Matrices are branches of Linear Algebra

  22. Matrix Transposition See http://en.wikipedia.org/wiki/Transpose

  23. Matrix Transposition Examples

  24. Matrix block multiplication

  25. Matrix block multiplication

  26. Linear Mapping property Table 5

  27. Derivation of Matrix form II

  28. Summary

More Related