Mathematical Fundamentals

Similar documents
Mathematics for Graphics and Vision

Linear Algebra V = T = ( 4 3 ).

Chapter 8. Rigid transformations

CS 246 Review of Linear Algebra 01/17/19

Introduction to Matrix Algebra

Linear Algebra & Geometry why is linear algebra useful in computer vision?

1.1 Single Variable Calculus versus Multivariable Calculus Rectangular Coordinate Systems... 4

Milford Public Schools Curriculum. Department: Mathematics Course Name: Precalculus Level 1

Linear Algebra March 16, 2019

Linear Algebra & Geometry why is linear algebra useful in computer vision?

Knowledge Discovery and Data Mining 1 (VO) ( )

A matrix over a field F is a rectangular array of elements from F. The symbol

Review of Linear Algebra

APPENDIX A. Background Mathematics. A.1 Linear Algebra. Vector algebra. Let x denote the n-dimensional column vector with components x 1 x 2.

Math Bootcamp An p-dimensional vector is p numbers put together. Written as. x 1 x =. x p

Chapter 2. Matrix Arithmetic. Chapter 2

Unit #17: Spring Trig Unit. A. First Quadrant Notice how the x-values decrease by while the y-values increase by that same amount.

Vectors and matrices: matrices (Version 2) This is a very brief summary of my lecture notes.

INSTITIÚID TEICNEOLAÍOCHTA CHEATHARLACH INSTITUTE OF TECHNOLOGY CARLOW MATRICES

MAT1035 Analytic Geometry

1. Trigonometry.notebook. September 29, Trigonometry. hypotenuse opposite. Recall: adjacent

Extra Problems for Math 2050 Linear Algebra I

PreCalculus Honors Curriculum Pacing Guide First Half of Semester

Tennessee s State Mathematics Standards Precalculus

Year 11 Mathematics: Specialist Course Outline

Trigonometry.notebook. March 16, Trigonometry. hypotenuse opposite. Recall: adjacent

4.3 TRIGONOMETRY EXTENDED: THE CIRCULAR FUNCTIONS

Review of linear algebra

NOTES ON LINEAR ALGEBRA CLASS HANDOUT

Review of Coordinate Systems

Intro Vectors 2D implicit curves 2D parametric curves. Graphics 2012/2013, 4th quarter. Lecture 2: vectors, curves, and surfaces

1 Geometry of R Conic Sections Parametric Equations More Parametric Equations Polar Coordinates...

Senior Secondary Australian Curriculum

Pre-Calculus Chapter 0. Solving Equations and Inequalities 0.1 Solving Equations with Absolute Value 0.2 Solving Quadratic Equations

ELEMENTARY LINEAR ALGEBRA

Index. Excerpt from "Precalculus" 2014 AoPS Inc. Copyrighted Material INDEX

Linear Algebra Homework and Study Guide

Properties of Matrices and Operations on Matrices

CS 143 Linear Algebra Review

Fundamentals of Mathematics (MATH 1510)

CSC 470 Introduction to Computer Graphics. Mathematical Foundations Part 2

Practical Linear Algebra: A Geometry Toolbox

ELEMENTARY LINEAR ALGEBRA

Chapter 5. Linear Algebra. A linear (algebraic) equation in. unknowns, x 1, x 2,..., x n, is. an equation of the form

MATHEMATICS. IMPORTANT FORMULAE AND CONCEPTS for. Final Revision CLASS XII CHAPTER WISE CONCEPTS, FORMULAS FOR QUICK REVISION.

A matrix is a rectangular array of. objects arranged in rows and columns. The objects are called the entries. is called the size of the matrix, and

Matrices and Vectors

Chapter 2 - Vector Algebra

A matrix is a rectangular array of. objects arranged in rows and columns. The objects are called the entries. is called the size of the matrix, and

a 11 x 1 + a 12 x a 1n x n = b 1 a 21 x 1 + a 22 x a 2n x n = b 2.

Math113: Linear Algebra. Beifang Chen

Matrices. Chapter Definitions and Notations

MATH 255 Applied Honors Calculus III Winter Midterm 1 Review Solutions

Maths for Map Makers

A VERY BRIEF LINEAR ALGEBRA REVIEW for MAP 5485 Introduction to Mathematical Biophysics Fall 2010

Vectors and Matrices

Intro Vectors 2D implicit curves 2D parametric curves. Graphics 2011/2012, 4th quarter. Lecture 2: vectors, curves, and surfaces

Linear and affine transformations

Chapter 8 Vectors and Scalars

PURE MATHEMATICS AM 27

xvi xxiii xxvi Construction of the Real Line 2 Is Every Real Number Rational? 3 Problems Algebra of the Real Numbers 7

Notes for Advanced Level Further Mathematics. (iii) =1, hence are parametric

How to rotate a vector using a rotation matrix

Trigonometric Functions and Triangles

Advanced Math. ABSOLUTE VALUE - The distance of a number from zero; the positive value of a number. < 2 indexes draw 2 lines down like the symbol>

MATRICES The numbers or letters in any given matrix are called its entries or elements

DIFFERENTIATION RULES

Preview from Notesale.co.uk Page 2 of 42

BSc (Hons) in Computer Games Development. vi Calculate the components a, b and c of a non-zero vector that is orthogonal to

Lecture Notes in Linear Algebra

Essential Mathematics for Computer Graphics

KIST DP Course Descriptions

Chapter 2: Matrices and Linear Systems

Study guide for Exam 1. by William H. Meeks III October 26, 2012

REQUIRED MATHEMATICAL SKILLS FOR ENTERING CADETS

Using this definition, it is possible to define an angle of any (positive or negative) measurement by recognizing how its terminal side is obtained.

1. Vectors and Matrices

Symmetric and anti symmetric matrices

A = 3 B = A 1 1 matrix is the same as a number or scalar, 3 = [3].

Course Notes Math 275 Boise State University. Shari Ultman

Matrix Algebra for Engineers Jeffrey R. Chasnov

Notes on Radian Measure

Conceptual Questions for Review

Math 3108: Linear Algebra

Linear Algebra Review. Vectors

Fairfield Public Schools

Review of Linear Algebra

[ Here 21 is the dot product of (3, 1, 2, 5) with (2, 3, 1, 2), and 31 is the dot product of

We use the overhead arrow to denote a column vector, i.e., a number with a direction. For example, in three-space, we write

JUST THE MATHS SLIDES NUMBER 3.1. TRIGONOMETRY 1 (Angles & trigonometric functions) A.J.Hobson

ELEMENTARY LINEAR ALGEBRA

Vectors Coordinate frames 2D implicit curves 2D parametric curves. Graphics 2008/2009, period 1. Lecture 2: vectors, curves, and surfaces

MATH Topics in Applied Mathematics Lecture 12: Evaluation of determinants. Cross product.

Functions and their Graphs

Lecture 2: Vector-Vector Operations

3 Matrix Algebra. 3.1 Operations on matrices

Linear Algebra. Matrices Operations. Consider, for example, a system of equations such as x + 2y z + 4w = 0, 3x 4y + 2z 6w = 0, x 3y 2z + w = 0.

Vectors a vector is a quantity that has both a magnitude (size) and a direction

2- Scalars and Vectors

Unit 1. Revisiting Parent Functions and Graphing

Transcription:

Mathematical Fundamentals Ming-Hwa Wang, Ph.D. COEN 148/290 Computer Graphics COEN 166/366 Artificial Intelligence COEN 396 Interactive Multimedia and Game Programming Department of Computer Engineering Santa Clara University Applied Trigonometry trigonometric functions: an angle with adjacent side x, opposite side y, and hypotenuse h; h 2 = x 2 + y 2 ; 6 trigonometric functions: sin, cos, tan, cot, sec, csc; the cos is an even function (symmetric about the y-axis), the sin and tan are odd functions (symmetric about the original); C/C++ supports sin( ), cos( ), and tan( ) radian: one radian is the angle for which the circular arc subtended by in a circle of radius r has a length equal to r itself; radians = /180 degrees, and degrees = 180/ radians circumference C = 2 r quadrants I, II, III, IV trigonometric identities: relationships among the trigonometric functions sin(- ) = -sin ; cos(- ) = cos ; tan(- ) = -tan sin = 1 / csc ; cos = 1 / sec ; tan = 1 / cot ; cos = sin( + ) = -sin( ); sin = cos( ) = -cos( + ) sin = -sin( + ) = -sin( ); cos = -cos( ) = -cos( + ) sin = cos cot tan sec ; cos sin tan cot csc ; sin 2 + cos 2 = 1; tan 2 + 1 = sec 2 ; 1+ cot 2 = csc 2 inverse trigonometric functions; because the trigonometric functions are periodic, the inverse functions return the angle that is close to zero; C/C++ supports asin( ), acos( ), and atan( ) law of sines: the ratio of a side s length to the sine of the angle opposite that side is the same for all three sides of any particular triangle; a / sin = b / sin = c / sin law of cosines: c 2 = a 2 + b 2 2ab cos Matrix Arithmetic a matrix is a rectangular array of individual numerical quantities arranged as a set of rows and columns; a matrix having m rows and n columns is called an n x m matrix; if n = m, then square matrix; the individual components of a matrix are called entries; the single entry of matrix M residing in row i, and column j is denoted by M ij ; the entries M ii are the main diagonal entries; a square matrix having nonzero entries only on the main diagonal is a diagonal matrix transpose: the transpose of a matrix M, denoted by M T, is the matrix for which the entry residing at the (i, j) is equal to M ji symmetric matrix: a square matrix that is equal to its own transpose addition and subtraction: two matrices of the same size can be added or subtracted component wise scalar matrix multiplication: simply distributes the factor a to each of the entries of the matrix; am = Ma matrix multiplication: two matrices A (an n x m matrix) and B (an m x p matrix) can be multiplied together whenever the number of columns of A is equal to the number of rows of B; the result matrix X is n x p, and X ij = m k=1 A ik B kj ; matrix multiplication is not commutative identity matrix I n : MI n = M and I n M = M vectors: an n-dimensional vector V can be consider as an n x 1 matrix row vectors and column vectors matrix vector multiplication (transforms a vector from one coordinate system to another) inverse matrix M -1 : MM -1 = I n and M -1 M = I n singular: a non-invertible matrix; whether a matrix M is singular can be determined by examining the determinant of M (detm or M ) a = a a c b d = ad bc M 11 M 12 M 13 M 21 M 22 M 23 = M 31 M 32 M 33 M 22 M 23 M 21 M 23 M 21 M 22 M 11 - M 12 + M 13 M 32 M 33 M 31 M 33 M 31 M 32 a matrix is invertible iff its determinant is not zero; the 2D and 3D inverse matrices are: M 22 -M 12 M -1 = 1/detM -M 21 M 11 M 22 M 33 M 23 M 32 M 13 M 32 -M 12 M 33 M 12 M 23 -M 13 M 22 M -1 = 1/detM M 23 M 31 -M 21 M 33 M 11 M 33 -M 13 M 31 M 13 M 21 -M 11 M 23 M 21 M 32 -M 22 M 31 M 12 M 31 -M 11 M 32 M 11 M 22 -M 12 M 21 det(a T ) = det(a) and det(ab) = det(a)det(b) if A and B are square matrix Vectors a vector is an entity that possesses magnitude and direction; a 3D vector is V = (V 1, V 2, V 3 ) = V 1 i + V 2 j + V 3 k, where each component v i is a scalar and i, j, k are unit vectors along x, y, and z axes; addition of vectors: X = V + W = (V 1 + W 1, V 2 + W 2, V 3 + W 3 ), the tail of W is placed at the head of V, and X is the vector formed by joining the tail of V to the head of W vector subtraction: using vector addition but travel along the subtracted vector in the opposite direction: X = V - W = (V 1 - W 1, V 2 - W 2, V 3 - W 3 ) vector scalar multiplication: av = (av 1, av 2, av 3 )

length of vectors: V = (V1 2 + V 2 2 + V 2 3 ) 1/2, the distance from a vector's tail to its head unit vector: by normalize to produce a unit vector which has length of 1, U = V/ V ; so V = V U, i.e., any vector is given by its magnitude times its direction dot product (inner product or scalar product): X = V W = V T W = V 1 W 1 + V 2 W 2 + V 3 W 3 = V W cos, and cos = V W / V W cosine rule: V - W 2 = V 2 + W 2 + 2 V W cos if V and W are unit vectors, then V W = cos (which is used to provide measure of the angle between two vectors) orthogonal or perpendicular: V W = 0 zero vector 0 = (0, 0,, 0) is orthogonal to every vector V let X is the length of projecting vector V onto W, then X = V cos = V W / W ; the projected vector is X = (V W / W 2 )W = 2 W x W x W y W x W z V x (1 / W 2 2 ) W x W y W y W y W z V y 2 W x W z W y W z W z V z The perpendicular component of V with respect to W is Y = V X = V - (V W / W 2 )W cross product (outer product or vector product) the normal vector represents the orientation of a surface; a normal vector to a polygon is calculated by cross-product of any two vectors V and W on the polygon; the direction of N p is decided by the righthand rule; N p = V x W = (V 2 W 3 - V 3 W 2 )i + (V 3 W 1 - V 1 W 3 )j + (V 1 W 2 - V 2 W 1 )k = 0 -V z V y W x V z 0 -V x W y -V y V x 0 W z cross product is not commutative: W x V = -(V x W ) cross product is not associative: (U x V) x W U x (V x W ) (V x W ) V = 0 and (V x W ) W = 0 V x W = V W sin ; the magnitude of the cross product is equal to the area of the parallelogram whose side are formed by the vector V and W ; the area of an arbitrary triangle whose vertices are given by points P 1, P 2, P 3 is ½ (P 2 P 1 ) x (P 3 P 1 ) for bi-cubic parametric surface Q(u, v), the orientation of the normal vector varies continuously over the surface; first calculate the tangent vectors / u Q(u, v) and / v Q(u, v), then N s = Q/ u x Q/ v; any one of the tangent vectors T s should be perpendicular to the normal vector N s, i.e., N s T s = 0 transforming normal vectors: let T s = MT s and N s = GN s ; then N s.t s = (GN s ).(MT s ) = (GN s ) T (MT s ) = N T s G T MT s = 0; G T M = I n and G = (M -1 ) T ; so a normal vector is correctly transformed using the inverse transpose of the matrix used to transform points; vectors that must be transformed this way are covariant vectors, and vectors that are transformed the ordinary fashion using the M are called contra-variant vectors; if M is orthogonal, (M -1 ) T = M eigenvector and eigenvalue: let M be a square matrix, if V is a nonzero vector and for some scalar a, MV = av, then V is an eigenvector of M and a an eigenvalue of M a square matrix is symmetric if M T = M, a square matrix is orthogonal if M T M = MM T = I n or M -1 = M T, a symmetric matrix can be decomposed into M = UAU T, where U is an orthogonal matrix and A is a diagonal matrix of eigenvalues of M singular value decomposition (SVD): any matrix can be decomposed into M = UAV T, U and V are orthogonal matrices and A is a diagonal matrix Analytic Geometry 2D/3D Cartesian coordinate system Explicit function: 2D: f(x, y) = 0 or y = f(x) 3D: f(x, y, z) = 0 or x = f(u, v) and y = g(u, v) and z = h(u, v) parametric function: add time domain 2D: x = f(t), y = g(t) 3D: x = f(t), y = g(t), z = h(t) lines: P(t) = S + tv, where S is any point lying on the line and the V is the direction along which the line runs; allow t to be negative, line can travel in both directions two line S 1 + tv 1 and S 2 + tv 2 are parallel if V 1 = av 2, where a is a scalar constant; non-parallel lines may not intersect in 3D, and nonparallel lines that do not intersect are skew lines planes: the plan passing through a point P and perpendicular to the normal N is a set of points Q such that N (Q P) = 0; Ax + By + Cz + D = 0; where A, B, and C are the x-, y-, and z-components of the normal vector N, and D = -N P; the distance by which the plan is offset from a parallel plane that passes through the origin is D / N the normal vector N is often normalized to unit length, and d = N Q + D gives the signed distance from the plan to an arbitrary point Q; if d = 0, then the point Q lines in the plane; if d > 0, the point Q lies on the positive side (the same direction as N) of the plane; if d < 0, negative side represent a plane using a 4D vector (N, D) for set of points Q which satisfies N Q + D = 0 let the plane L = (N, D), if the matrix M is the 4 x 4 transformation matrix used to transform points, then L = (M -1 ) T L distance from a point P to a line: d = ((P S) 2 (((P S) V) 2 / V 2 )) 1/2 ; if V is normalized, then V 2 can be removed intersection of a line and a plane: if L V = 0, the line is parallel to the plan and no intersection; otherwise, P(t) = S ((L S)/(L V))V Coordination Systems world coordination is a right-handed system (x, y, z) local coordination - 3 reasons: object is modeled by building up the vertices with respect to some reference point in the object

the same object may appear many times in a scene it is easier to rotate with respect to a local reference point a transformation T: V W, and an inverse T -1 : W V a transformation is linear if T(aU + bv) = at(u) + bt(v) a projective transformation preserves collinearity (maps a line to a line), and an affine transformation preserves lines and parallelism all linear transformations are affine, but not all affine transformations are linear; all affine transformations are projective, but not all projective transformations are affine rigid motion, Euclidean motion, or isometrics: a affine transformation that preserves distances, the determinant of the rigid motion is either 1 (translation or rotation), or -1 (reflection) homogenous coordinates add one more dimension to obtain a linear representation for any projective transformation, the relationship between the points in the space and the homogeneous coordinates is not one-to-one; (x, y, z, w) where w = 0, a vector, and w = 1, a point: to make an affine transformation made up any combination of linear transformations (rotation or scaling) followed by translation modeling transformations: emplace an object with a local coordinate system into a position in a world coordinate system viewing transformations: transformation from the world coordinate system to the view coordinate system Complex Numbers and Quaternions complex numbers can be used to represent 2D geometric objects and transformations, let u = a + bi, and v = c + di, where i 2 = -1 addition/subtraction: u ± v = (a ± c) + (b ± d)i multiplication: u * v = (ac - bd) + (ad + bc)i complex congugate: u = a - bi absolute value: u = (a 2 + b 2 ) 0.5 and uu = u 2 division: v / u = vu / uu = vu / u 2 complex number is a field : addition and multiplication operations are associative and commutative, multiplication is distributive over the addition, identity element 0 and 1 and inverse polar form is easier to calculate multiplication, division, power and roots: u = r(cos + i sin ) = re i where r = u and = tan -1 (b/a) Euler s identity (relationship between trigonometric function and exponential function): e i = cos + i sin Quaternions system is an extension of the complex system: let u = a + bi + cj + dk and v = e + fi +gj + hk, where i2 = j2 = k2 = ijk = -1, and ij = k = -ji, jk = i = -kj, ki = j = -ik addition/subtraction: u ± v = (a ± e) + (b ± f)i + (c ± g)j + (d ± h)k multiplication (not commutative): u * v = (ae bf cg - dh) + (af + be + ch - dg)i + (ag bh + ce + df)j + (ah + bg cf + de)k quaternions is a skew or noncommutative field : a field except multiplication is not commutative quaternions congugate: u = a - bi - cj - dk absolute value: u = (a 2 + b 2 + c 2 + d 2 ) 0.5 and uu = uu = u 2 division: v / u = vu / uu = vu / u 2 associate a point (x, y, z) with a pure quaternion v = xi + yi + zk, quaternions are especially useful in representing 3D rotation, T u (v) = uvu, where u is a unit quaternion and u = cos( /2) + q sin( /2), and q = ai + bi + ck defines the axis of rotation, and is the angle of rotation the set of 3D rotations is closed under the transformation composition (i.e. the result of combining two rotations is still a rotation) Tu 1 (Tu 2 (v)) = u 1 u 2 vu 2 u 1 = Tu 1 u 2 (v) 3D Affine Transformation translation moves all points of a space by a fixed amount: V' = V + D, a vector (or a point) is a column matrix V' = T V x' 1 0 0 T x x y' = 0 1 0 T y y z' 0 0 1 T z z 1 1 T -1 is obtained by negating T x, T y, and T z. rotation: a 2D rotation is around a point, and a 3D rotation is around a line, V' = R V, it is easier to rotate parallel to one of the coordinate axes; the transformation matrices for anti-clockwise (looking along each axis toward the origin) rotation about the x, y, and z axes are: 1 0 0 0 R x = 0 cos -sin 0 0 sin cos 0 cos 0 sin 0 R y = 0 1 0 0 -sin 0 cos 0 cos -sin 0 0 Rz = sin cos 0 0 R -1 is negating the angle of rotation reflection: V' = F V a simple reflection about the xy-plane has the matrix: 1 0 0 0 F = 0 1 0 0 0 0-1 0 a reflection about a plane through the origin with the normal vector u is T(x) = x (2x u)u / u 2 a reflection is always invertible, and the inverse of a reflection is itself scaling: V' = S V

Sx 0 0 0 S = 0 S y 0 0 0 0 S z 0 S -1 is replacing S x, S y, and S z by their reciprocals uniform scaling: S x = S y = S z, uniform scaling preserves shape Shearing: a 3D shear shifts a point along a plane, and the amount of the shift depends on the distance of the point to the plane a simple shear that changes only the x-coordinate has the matrix: 1 0 sh x 0 0 1 0 0 The x-coordinate are shifted according the equation: x = x + sh x z a more general (x, y)-shear shifts both x- and y-coordinate: 1 0 sh x 0 0 1 sh y 0 Shearing is invertible. The inverse of the above shear is another shear of the same type with parameters -sh x, - sh y. any set of rotations, scaling and translations can be multiplied or concatenated together to give a net transformation matrix; note the order because although translations and scaling are commutative, but rotations are not a general transformation matrix is A 11 A 12 A 13 T x A 21 A 22 A 23 T y A 31 A 32 A 33 T z where sub-matrix A is the net rotation and scaling while T gives the net translation along the Y axis as y min = y = y max, the radius of curvature of the bend is 1/k and the center of the bend is at y = y 0, the bending angle is = k(y' - y 0 ), where y' = y min if y = y min, y if y min < y < y max, or y max if y y max ; the deforming transformation is given by: X = x, Y = -sin (z - 1/k) + y 0 if y min = y = y max, -sin (z -1/k) + y 0 + cos (y - y min ) if y < y min, or -sin (z -1/k) + y 0 + cos (y - y max ) if y > y max, Z = -cos (z - 1/k) + y 0 if y min = y = y max, -cos (z - 1/k) + y 0 + 1/k + sin (y - y min ) if y < y min, -cos (z - 1/k) + y 0 + 1/k + sin (y - y max ) if y > y max Structure-deforming Transformation global deformations (non-uniform scaling): using different values of S x, S y, and S z the object is stretched or squeezed along particular coordinate axes; X = F x (x), Y = F y (y), and Z = F z (z), where (x, y, z) is a vertex in an un-deformed solid and (X, Y, Z) is the deformed vertex; nonconstraint, non-linear deformations cannot be applied to polygon meshes in general (due to connectivity constraints between vertex problem and silhouette edge aliasing problem) tapering: choose a tapering axis, e.g., z, then X = f(z)x, Y = f(z)y, Z = z global axial twisting: e.g., twist an object about z axis, X = x cos - y sin, Y = x sin + y cos, Z = z, where = f(z) and f'(z) specifies the rate of twist per unit length along the z axis global linear bending: along an axis is a composite transformation comprising a bent region and a region outside the bent region where the deformation is a rotation and a translation; if a bend region

This document was created with Win2PDF available at http://www.win2pdf.com. The unregistered version of Win2PDF is for evaluation or non-commercial use only. This page will not be added after purchasing Win2PDF.