Math Review l Coordinate systems l l l

  • Slides: 23
Download presentation
Math Review l Coordinate systems l l l 2 -D, 3 -D Vectors Matrices

Math Review l Coordinate systems l l l 2 -D, 3 -D Vectors Matrices l Matrix operations 1

Math Review l l l Cornerstone of graphics Basis for most algorithms Systematic notation

Math Review l l l Cornerstone of graphics Basis for most algorithms Systematic notation l l l Simplifying communication Organizing ideas Compact representation CS-321 Dr. Mark L. Hornick 2

2 -D Coordinate Systems y P 0 Rectangular or Cartesian 0 x y CS-321

2 -D Coordinate Systems y P 0 Rectangular or Cartesian 0 x y CS-321 Dr. Mark L. Hornick x P 3

Points and Vectors y A point at (x, y) can be represented by vector

Points and Vectors y A point at (x, y) can be represented by vector P from the origin (0, 0). P 0 y In general, a vector represents the difference (directed distance) between two points. x V P 2 P 1 0 x CS-321 Dr. Mark L. Hornick 4

2 -D Vector Representations V Vy Cartesian components Vx Magnitude and direction angle |V|

2 -D Vector Representations V Vy Cartesian components Vx Magnitude and direction angle |V| a CS-321 Dr. Mark L. Hornick 5

2 -D Vector Operations Addition V 2 V 1+V 2 Subtraction -V 2 V

2 -D Vector Operations Addition V 2 V 1+V 2 Subtraction -V 2 V 1 -V 2 CS-321 Dr. Mark L. Hornick V 1 V 2 6

2 -D Vector Operations Scalar multiply V Vy Vx a. Vy a. Vx CS-321

2 -D Vector Operations Scalar multiply V Vy Vx a. Vy a. Vx CS-321 Dr. Mark L. Hornick 7

2 -D Unit Vector For any vector V, V can also be written as

2 -D Unit Vector For any vector V, V can also be written as av V Vy Vx CS-321 Dr. Mark L. Hornick 8

Direction cosines Vy β V α Vx CS-321 Dr. Mark L. Hornick 9

Direction cosines Vy β V α Vx CS-321 Dr. Mark L. Hornick 9

3 -D Coordinate Systems In a Right-handed coordinate system, the z axis defined by

3 -D Coordinate Systems In a Right-handed coordinate system, the z axis defined by the vector cross product of the x and y axes. y P z CS-321 Dr. Mark L. Hornick x 10

3 -D Vector Operations Addition Scalar multiply CS-321 Dr. Mark L. Hornick 11

3 -D Vector Operations Addition Scalar multiply CS-321 Dr. Mark L. Hornick 11

3 -D Vector Representations Cartesian components Magnitude and direction cosines z V γ β

3 -D Vector Representations Cartesian components Magnitude and direction cosines z V γ β x α y CS-321 Dr. Mark L. Hornick 12

3 -D Vector Operations Inner (dot) product V 1 θ V 2 Portion of

3 -D Vector Operations Inner (dot) product V 1 θ V 2 Portion of in direction Projections CS-321 Dr. Mark L. Hornick 13

3 -D Vector Cross Product “Right-hand rule” V 1 x V 2 θ V

3 -D Vector Cross Product “Right-hand rule” V 1 x V 2 θ V 1 CS-321 Dr. Mark L. Hornick 14

Matrices Rectangular matrix (m x n) (rows x cols) Row vector Column vector CS-321

Matrices Rectangular matrix (m x n) (rows x cols) Row vector Column vector CS-321 Dr. Mark L. Hornick 15

Scalar Matrix Multiplication CS-321 Dr. Mark L. Hornick 16

Scalar Matrix Multiplication CS-321 Dr. Mark L. Hornick 16

Matrix Addition Matrices must have same dimensions CS-321 Dr. Mark L. Hornick 17

Matrix Addition Matrices must have same dimensions CS-321 Dr. Mark L. Hornick 17

Matrix Transpose CS-321 Dr. Mark L. Hornick 18

Matrix Transpose CS-321 Dr. Mark L. Hornick 18

Matrix Multiplication Matrices must be conformable (n=p) CS-321 Dr. Mark L. Hornick 19

Matrix Multiplication Matrices must be conformable (n=p) CS-321 Dr. Mark L. Hornick 19

Matrix Multiplication Example A 1 4 2 5 B 3 6 C 2 1

Matrix Multiplication Example A 1 4 2 5 B 3 6 C 2 1 3 4 5 7 CS-321 Dr. Mark L. Hornick = 23 30 53 66 C row = A row, C column = B column 20

Identity Matrix and Inverse computed by Gaussian elimination, determinants, or other methods; used directly

Identity Matrix and Inverse computed by Gaussian elimination, determinants, or other methods; used directly or indirectly to solve sets of linear. CS-321 equations 21 Dr. Mark L. Hornick

Determinants 1 A-1 = adj(A) det(A) CS-321 Dr. Mark L. Hornick 22

Determinants 1 A-1 = adj(A) det(A) CS-321 Dr. Mark L. Hornick 22

Determinants n Only on square matrices n For an upper triangular matrix n n

Determinants n Only on square matrices n For an upper triangular matrix n n Gaussian elimination is the best method n n n Swapping two rows changes the sign of Multiplying a row by s, multiplies by s Adding row multiples has no effect CS-321 Dr. Mark L. Hornick 23