CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions Defined using...

53
CSCE 552 Fall 2012 Math By Jijun Tang

description

Applied Trigonometry Angles measured in radians Full circle contains 2  radians

Transcript of CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions Defined using...

Page 1: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

CSCE 552 Fall 2012

Math

By Jijun Tang

Page 2: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

Applied Trigonometry

Trigonometric functions Defined using right triangle

x

yh

Page 3: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

Applied Trigonometry

Angles measured in radians

Full circle contains 2 radians

Page 4: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

arcs

Page 5: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

Vectors and Scalars

Scalars represent quantities that can be described fully using one value Mass Time Distance

Vectors describe a magnitude and direction together using multiple values

Page 6: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

Examples of vectors

Difference between two points Magnitude is the distance between the points Direction points from one point to the other

Velocity of a projectile Magnitude is the speed of the projectile Direction is the direction in which it’s traveling

A force is applied along a direction

Page 7: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

Vectors Add and Subtraction

Two vectors V and W are added by placing the beginning of W at the end of V

Subtraction reverses the second vector

V

WV + W

V

W

V

V – W–W

Page 8: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

Matrix Representation

The entry of a matrix M in the i-th row and j-th column is denoted Mij

For example,

Page 9: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

Vectors and Matrices

Example matrix product

Page 10: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

Identity Matrix In

For any n n matrix M,the product with theidentity matrix is M itself

InM = M MIn = M

Page 11: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

Invertible

An n n matrix M is invertible if there exists another matrix G such that

The inverse of M is denoted M-1

1 0 0

0 1 0

0 0 1

n

MG GM I

Page 12: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

Inverse of 2x2 and 3x3

The inverse of a 2 2 matrix M is

The inverse of a 3 3 matrix M is

Page 13: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

Inverse of 4x4

1 1 1 111 12 13

1 1 1 1 1 121 22 23

11 1 1 131 32 33

1 0 0 0 1

x

y

z

R R R

R R R

R R R

R T

R R T R TM

R T

0

Page 14: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

Gauss-Jordan Elimination

Gaussian Elimination

Page 15: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

The Dot Product

The dot product is a product between two vectors that produces a scalar

The dot product between twon-dimensional vectors V and W is given by

In three dimensions,

Page 16: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

Dot Product Usage

The dot product can be used to project one vector onto another

V

W

Page 17: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

Dot Product Properties

The dot product satisfies the formula

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

Page 18: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

Self Dot Product

The dot product of a vector with itself produces the squared magnitude

Often, the notation V 2 is used as shorthand for V V

Page 19: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

The Cross Product

The cross product is a product between two vectors the produces a vector

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)

Page 20: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

Illustration

The cross product satisfies the trigonometric relationship

This is the area ofthe parallelogramformed byV and W

V

W

||V|| sin

Page 21: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

Area and Cross Product

The area A of a triangle with vertices P1, P2, and P3 is thus given by

Page 22: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

Rules

Cross products obey the right hand rule 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:

Cross product is anticommutative

Page 23: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

Rules in Figure

Page 24: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

Formular

The cross product between V and W is

A helpful tool for remembering this formula is the pseudodeterminant (x, y, z) are unit vectors

Page 25: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

Alternative

The cross product can also be expressed as the matrix-vector product

The perpendicularity property means

Page 26: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

Transformations

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

Page 27: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

Illustration

Page 28: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

R S T

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

Page 29: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

2D Example

θ

Page 30: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

2D Rotations

Page 31: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

Rotation Around Arbitrary VectorRotation about an arbitrary vector Counterclockwise rotation about an arbitrary vector (lx,ly,lz) normalised so that                    by an angle α is given by a matrix

                                                                           

where

Page 32: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

Transformation matrix

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

Page 33: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

Translation

A 3 3 matrix can reorient the coordinate axes in any way, but it leaves the origin fixed

We must add a translation component D to move the origin:

Page 34: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

Homogeneous coordinates

Four-dimensional space Combines 3 3 matrix and translation

into one 4 4 matrix

Page 35: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

Direction Vector and Point

V is now a four-dimensional vector 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

Page 36: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

Transformations

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 3D value

Page 37: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

Transformations

Transformation matrices are often the result of combining several simple transformations Translations Scales Rotations

Transformations are combined by multiplying their matrices together

Page 38: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

Transformation Steps

Page 39: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

Translation

Translation matrix

Translates the origin by the vector T

translate

1 0 0

0 1 0

0 0 1

0 0 0 1

x

y

z

T

T

T

M

Page 40: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

Scale

Scale matrix

Scales coordinate axes by a, b, and c If a = b = c, the scale is uniform

scale

0 0 0

0 0 0

0 0 0

0 0 0 1

a

b

c

M

Page 41: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

Rotation (Z)

Rotation matrix

Rotates points about the z-axis through the angle

-rotate

cos sin 0 0

sin cos 0 0

0 0 1 0

0 0 0 1

z

M

Page 42: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

Rotations (X, Y)

Similar matrices for rotations about x, y

-rotate

1 0 0 0

0 cos sin 0

0 sin cos 0

0 0 0 1

x

M

-rotate

cos 0 sin 0

0 1 0 0

sin 0 cos 0

0 0 0 1

y

M

Page 43: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

Transforming Normal Vectors

Normal vectors are transformed differently than do ordinary points and directions

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

Page 44: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

Orderings

Page 45: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

Orderings

Orderings of different type is important A rotation followed by a translation is different from a translation followed by a rotation

Orderings of the same type does not matter

Page 46: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

Geometry -- Lines

A line in 3D space is represented by

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

t t P S V

Page 47: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

Plane

A plane in 3D space can be defined by a normal direction N and a point P

Other points in the plane satisfy

PQ

N

Page 48: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

Plane Equation

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

Page 49: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

Properties of Plane

A plane is often represented by the 4D vector (A, B, C, D)

If a 4D 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

Page 50: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

Distance from Point to a Line

Distance d from a point P to a lineS + t V

P

VS

d

Page 51: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

Distance from Point to a Line

Use Pythagorean theorem:

Taking square root,

If V is unit length, then V 2 = 1

Page 52: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

Line and Plane Intersection

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

x x y y z z w

x x y y z z

L S L S L S Lt

L V L V L V

L SL V

Page 53: CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.

Formular

If L V = 0, the line is parallel to the plane and no intersection occurs

Otherwise, the point of intersection is

t

L SP S VL V