Chapter 4 1 Mathematical Concepts Applied Trigonometry n

  • Slides: 62
Download presentation
Chapter 4. 1 Mathematical Concepts

Chapter 4. 1 Mathematical Concepts

Applied Trigonometry n Trigonometric functions n Defined using right triangle h y a x

Applied Trigonometry n Trigonometric functions n Defined using right triangle h y a x 2

Applied Trigonometry n Angles measured in radians n Full circle contains 2 p radians

Applied Trigonometry n Angles measured in radians n Full circle contains 2 p radians 3

Applied Trigonometry n Sine and cosine used to decompose a point into horizontal and

Applied Trigonometry n Sine and cosine used to decompose a point into horizontal and vertical components y r r sin a a r cos a x 4

Applied Trigonometry n Trigonometric identities 5

Applied Trigonometry n Trigonometric identities 5

Applied Trigonometry n Inverse trigonometric functions n Return angle for which sin, cos, or

Applied Trigonometry n Inverse trigonometric functions n Return angle for which sin, cos, or tan function produces a particular value a = z, then a = sin-1 z n If cos a = z, then a = cos -1 z n If tan a = z, then a = tan n If sin 6

Applied Trigonometry n Law of sines a c n Law of cosines b b

Applied Trigonometry n Law of sines a c n Law of cosines b b g a n Reduces to Pythagorean theorem when g = 90 degrees 7

Vectors and Matrices n Scalars represent quantities that can be described fully using one

Vectors and Matrices n Scalars represent quantities that can be described fully using one value n n Mass Time Distance Vectors describe a magnitude and direction together using multiple values 8

Vectors and Matrices n Examples of vectors n Difference between two points n n

Vectors and Matrices n Examples of vectors n Difference between two points n n n Velocity of a projectile n n n Magnitude is the distance between the points Direction points from one point to the other Magnitude is the speed of the projectile Direction is the direction in which it’s traveling A force is applied along a direction 9

Vectors and Matrices n Vectors can be visualized by an arrow n n n

Vectors and Matrices n Vectors can be visualized by an arrow n n n The length represents the magnitude The arrowhead indicates the direction Multiplying a vector by a scalar changes the arrow’s length 2 V V –V 10

Vectors and Matrices n n Two vectors V and W are added by placing

Vectors and Matrices n n Two vectors V and W are added by placing the beginning of W at the end of V Subtraction reverses the second vector W V V+W W V V–W –W V 11

Vectors and Matrices n n n An n-dimensional vector V is represented by n

Vectors and Matrices n n n An n-dimensional vector V is represented by n components In three dimensions, the components are named x, y, and z Individual components are expressed using the name as a subscript: 12

Vectors and Matrices n Vectors add and subtract componentwise 13

Vectors and Matrices n Vectors add and subtract componentwise 13

Vectors and Matrices n n The magnitude of an n-dimensional vector V is given

Vectors and Matrices n n The magnitude of an n-dimensional vector V is given by In three dimensions, this is 14

Vectors and Matrices n n n A vector having a magnitude of 1 is

Vectors and Matrices n n n A vector having a magnitude of 1 is called a unit vector Any vector V can be resized to unit length by dividing it by its magnitude: This process is called normalization 15

Vectors and Matrices n A matrix is a rectangular array of numbers arranged as

Vectors and Matrices n A matrix is a rectangular array of numbers arranged as rows and columns n n n A matrix having n rows and m columns is an n m matrix At the right, M is a 2 3 matrix If n = m, the matrix is a square matrix 16

Vectors and Matrices n n The entry of a matrix M in the i-th

Vectors and Matrices n n The entry of a matrix M in the i-th row and j-th column is denoted Mij For example, 17

Vectors and Matrices n The transpose of a matrix M is denoted MT and

Vectors and Matrices n The transpose of a matrix M is denoted MT and has its rows and columns exchanged: 18

Vectors and Matrices n n An n-dimensional vector V can be thought of as

Vectors and Matrices n n An n-dimensional vector V can be thought of as an n 1 column matrix: Or a 1 n row matrix: 19

Vectors and Matrices n Product of two matrices A and B n n n

Vectors and Matrices n Product of two matrices A and B n n n Number of columns of A must equal number of rows of B Entries of the product are given by If A is a n m matrix, and B is an m p matrix, then AB is an n p matrix 20

Vectors and Matrices n Example matrix product 21

Vectors and Matrices n Example matrix product 21

Vectors and Matrices n n Matrices are used to transform vectors from one coordinate

Vectors and Matrices n n Matrices are used to transform vectors from one coordinate system to another In three dimensions, the product of a matrix and a column vector looks like: 22

Vectors and Matrices n The n n identity matrix is denoted In n For

Vectors and Matrices n The n n identity matrix is denoted In n For any n n matrix M, the product with the identity matrix is M itself n n In. M = M MIn = M The identity matrix is the matrix analog of the number one In has entries of 1 along the main diagonal and 0 everywhere else 23

Vectors and Matrices n n An n n matrix M is invertible if there

Vectors and Matrices n n An n n matrix M is invertible if there exists another matrix G such that The inverse of M is denoted M-1 24

Vectors and Matrices n n n Not every matrix has an inverse A noninvertible

Vectors and Matrices n n n Not every matrix has an inverse A noninvertible matrix is called singular Whether a matrix is invertible can be determined by calculating a scalar quantity called the determinant 25

Vectors and Matrices n n n The determinant of a square matrix M is

Vectors and Matrices n n n The determinant of a square matrix M is denoted det M or |M| A matrix is invertible if its determinant is not zero For a 2 2 matrix, 26

Vectors and Matrices n The determinant of a 3 3 matrix is 27

Vectors and Matrices n The determinant of a 3 3 matrix is 27

Vectors and Matrices n Explicit formulas exist for matrix inverses n n These are

Vectors and Matrices n Explicit formulas exist for matrix inverses n n These are good for small matrices, but other methods are generally used for larger matrices In computer graphics, we are usually dealing with 2 2, 3 3, and a special form of 4 4 matrices 28

Vectors and Matrices n The inverse of a 2 2 matrix M is n

Vectors and Matrices n The inverse of a 2 2 matrix M is n The inverse of a 3 3 matrix M is 29

Vectors and Matrices n A special type of 4 4 matrix used in computer

Vectors and Matrices n A special type of 4 4 matrix used in computer graphics looks like n R is a 3 3 rotation matrix, and T is a translation vector 30

Vectors and Matrices n The inverse of this 4 4 matrix is 31

Vectors and Matrices n The inverse of this 4 4 matrix is 31

The Dot Product n The dot product is a product between two vectors that

The Dot Product n The dot product is a product between two vectors that produces a scalar n n The dot product between two n-dimensional vectors V and W is given by In three dimensions, 32

The Dot Product n The dot product satisfies the formula n n n a

The Dot Product n The dot product satisfies the formula n n n a is the angle between the two vectors Dot product is always 0 between perpendicular vectors If V and W are unit vectors, the dot product is 1 for parallel vectors pointing in the same direction, -1 for opposite 33

The Dot Product n n The dot product of a vector with itself produces

The Dot Product n n The dot product of a vector with itself produces the squared magnitude Often, the notation V 2 is used as shorthand for V V 34

The Dot Product n The dot product can be used to project one vector

The Dot Product n The dot product can be used to project one vector onto another V a W 35

The Cross Product n The cross product is a product between two vectors the

The Cross Product n The cross product is a product between two vectors the produces a vector n n n The cross product only applies in three dimensions The cross product is perpendicular to both vectors being multiplied together The cross product between two parallel vectors is the zero vector (0, 0, 0) 36

The Cross Product n n The cross product between V and W is A

The Cross Product n n The cross product between V and W is A helpful tool for remembering this formula is the pseudodeterminant 37

The Cross Product n n The cross product can also be expressed as the

The Cross Product n n The cross product can also be expressed as the matrix-vector product The perpendicularity property means 38

The Cross Product n n The cross product satisfies the trigonometric relationship This is

The Cross Product n n The cross product satisfies the trigonometric relationship This is the area of the parallelogram formed by V V and W ||V|| sin a a W 39

The Cross Product n The area A of a triangle with vertices P 1,

The Cross Product n The area A of a triangle with vertices P 1, P 2, and P 3 is thus given by 40

The Cross Product n Cross products obey the right hand rule n n n

The Cross Product n Cross products obey the right hand rule n n n If first vector points along right thumb, and second vector points along right fingers, Then cross product points out of right palm Reversing order of vectors negates the cross product: n Cross product is anticommutative 41

Transformations n n n Calculations are often carried out in many different coordinate systems

Transformations n n n Calculations are often carried out in many different coordinate systems We must be able to transform information from one coordinate system to another easily Matrix multiplication allows us to do this 42

Transformations n n Suppose that the coordinate axes in one coordinate system correspond to

Transformations n n Suppose that the coordinate axes in one coordinate system correspond to the directions R, S, and T in another Then we transform a vector V to the RST system as follows 43

Transformations n n We transform back to the original system by inverting the matrix:

Transformations n n We transform back to the original system by inverting the matrix: Often, the matrix’s inverse is equal to its transpose—such a matrix is called orthogonal 44

Transformations n n A 3 3 matrix can reorient the coordinate axes in any

Transformations n n A 3 3 matrix can reorient the coordinate axes in any way, but it leaves the origin fixed We must at a translation component D to move the origin: 45

Transformations n Homogeneous coordinates n n Four-dimensional space Combines 3 3 matrix and translation

Transformations n Homogeneous coordinates n n Four-dimensional space Combines 3 3 matrix and translation into one 4 4 matrix 46

Transformations n V is now a four-dimensional vector n n The w-coordinate of V

Transformations n V is now a four-dimensional vector n n The w-coordinate of V determines whether V is a point or a direction vector If w = 0, then V is a direction vector and the fourth column of the transformation matrix has no effect If w 0, then V is a point and the fourth column of the matrix translates the origin Normally, w = 1 for points 47

Transformations n n The three-dimensional counterpart of a four-dimensional homogeneous vector V is given

Transformations n n The three-dimensional counterpart of a four-dimensional homogeneous vector V is given by Scaling a homogeneous vector thus has no effect on its actual 3 D value 48

Transformations n Transformation matrices are often the result of combining several simple transformations n

Transformations n Transformation matrices are often the result of combining several simple transformations n n Translations Scales Rotations Transformations are combined by multiplying their matrices together 49

Transformations n Translation matrix n Translates the origin by the vector T 50

Transformations n Translation matrix n Translates the origin by the vector T 50

Transformations n n n Scale matrix Scales coordinate axes by a, b, and c

Transformations n n n Scale matrix Scales coordinate axes by a, b, and c If a = b = c, the scale is uniform 51

Transformations n n Rotation matrix Rotates points about the z-axis through the angle q

Transformations n n Rotation matrix Rotates points about the z-axis through the angle q 52

Transformations n Similar matrices for rotations about x, y 53

Transformations n Similar matrices for rotations about x, y 53

Transformations n Normal vectors transform differently than do ordinary points and directions n n

Transformations n Normal vectors transform differently than do ordinary points and directions n n n A normal vector represents the direction pointing out of a surface A normal vector is perpendicular to the tangent plane If a matrix M transforms points from one coordinate system to another, then normal vectors must be transformed by (M-1)T 54

Geometry n A line in 3 D space is represented by n n n

Geometry n A line in 3 D space is represented by n n n S is a point on the line, and V is the direction along which the line runs Any point P on the line corresponds to a value of the parameter t Two lines are parallel if their direction vectors are parallel 55

Geometry n n A plane in 3 D space can be defined by a

Geometry n n A plane in 3 D space can be defined by a normal direction N and a point P Other points in the plane satisfy N Q P 56

Geometry n n A plane equation is commonly written A, B, and C are

Geometry n n A plane equation is commonly written A, B, and C are the components of the normal direction N, and D is given by for any point P in the plane 57

Geometry n n n A plane is often represented by the 4 D vector

Geometry n n n A plane is often represented by the 4 D vector (A, B, C, D) If a 4 D homogeneous point P lies in the plane, then (A, B, C, D) P = 0 If a point does not lie in the plane, then the dot product tells us which side of the plane the point lies on 58

Geometry n Distance d from a point P to a line S+t. V P

Geometry n Distance d from a point P to a line S+t. V P d S V 59

Geometry n Use Pythagorean theorem: n Taking square root, n If V is unit

Geometry n Use Pythagorean theorem: n Taking square root, n If V is unit length, then V 2 = 1 60

Geometry n Intersection of a line and a plane n n Let P(t) =

Geometry n Intersection of a line and a plane n n Let P(t) = S + t V be the line Let L = (N, D) be the plane We want to find t such that L P(t) = 0 Careful, S has w-coordinate of 1, and V has w-coordinate of 0 61

Geometry n n If L V = 0, the line is parallel to the

Geometry n n If L V = 0, the line is parallel to the plane and no intersection occurs Otherwise, the point of intersection is 62