Presentation is loading. Please wait.

Presentation is loading. Please wait.

University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2016 Tamara Munzner Math Basics Week 1, Fri.

Similar presentations


Presentation on theme: "University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2016 Tamara Munzner Math Basics Week 1, Fri."— Presentation transcript:

1 University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2016 Tamara Munzner http://www.ugrad.cs.ubc.ca/~cs314/Vjan2016 Math Basics Week 1, Fri Jan 8

2 2 Readings For Lecture Shirley/Marschner (3 rd edition) Ch 2: Miscellaneous Math, Sec 2.1-2.4 Ch 5: Linear Algebra, Sec 5.1-5.3 Gortler Ch 2: Linear, Sec 2.1 – 2.4

3 Vectors and Matrices 3

4 4 Notation: Scalars, Vectors, Matrices scalar (lower case, italic) vector (lower case, bold) matrix (upper case, bold)

5 5 Vectors arrow: length and direction oriented segment in nD space offset / displacement location if given origin

6 6 Column vs. Row Vectors row vectors column vectors switch back and forth with transpose

7 7 Vector-Vector Addition add: vector + vector = vector parallelogram rule tail to head, complete the triangle geometricalgebraic examples:

8 8 Vector-Vector Subtraction subtract: vector - vector = vector

9 9 Vector-Vector Subtraction subtract: vector - vector = vector argument reversal

10 10 Scalar-Vector Multiplication multiply: scalar * vector = vector vector is scaled

11 11 Vector-Vector Multiplication: Dot multiply v1: vector * vector = scalar dot product, aka inner product

12 12 Vector-Vector Multiplication: Dot multiply v1: vector * vector = scalar dot product, aka inner product

13 13 Vector-Vector Multiplication: Dot multiply v1: vector * vector = scalar dot product, aka inner product geometric interpretation lengths, angles can find angle between two vectors

14 14 Dot Product Geometry can find length of projection of u onto v as lines become perpendicular,

15 15 Dot Product Example

16 16 Vector-Vector Multiplication, Cross multiply v2: vector * vector = vector cross product algebraic

17 17 Vector-Vector Multiplication, Cross multiply v2: vector * vector = vector cross product algebraic 1 2 3

18 18 Vector-Vector Multiplication, Cross multiply v2: vector * vector = vector cross product algebraic geometric parallelogram area perpendicular to parallelogram

19 19 RHS vs. LHS Coordinate Systems right-handed coordinate system left-handed coordinate system right hand rule: index finger x, second finger y; right thumb points up left hand rule: index finger x, second finger y; left thumb points down convention

20 20 Matrix-Matrix Addition add: matrix + matrix = matrix example

21 21 Scalar-Matrix Multiplication multiply: scalar * matrix = matrix example

22 22 Matrix-Matrix Multiplication can only multiply (n,k) by (k,m): number of left cols = number of right rows legal undefined

23 23 Matrix-Matrix Multiplication row by column

24 24 Matrix-Matrix Multiplication row by column

25 25 Matrix-Matrix Multiplication row by column

26 26 Matrix-Matrix Multiplication row by column

27 27 Matrix-Matrix Multiplication row by column noncommutative: AB != BA

28 28 Matrix-Vector Multiplication points as column vectors: postmultiply points as row vectors: premultiply

29 29 Matrices transpose identity inverse not all matrices are invertible

30 30 Matrices and Linear Systems linear system of n equations, n unknowns matrix form Ax=b

31 Basis Vectors and Frames 31

32 32 Basis Vectors take any two vectors that are linearly independent (nonzero and nonparallel) can use linear combination of these to define any other vector:

33 33 Orthonormal Basis Vectors if basis vectors are orthonormal: orthogonal (mutually perpendicular) and unit length we have Cartesian coordinate system familiar Pythagorean definition of distance orthonormal algebraic properties

34 34 Basis Vectors and Origins coordinate system: just basis vectors can only specify offset: vectors coordinate frame: basis vectors and origin can specify location as well as offset: points

35 35 Working with Frames F1F1F1F1 F1F1F1F1

36 36 Working with Frames F1F1F1F1 F1F1F1F1 p = (3,-1)

37 37 Working with Frames F1F1F1F1 F1F1F1F1 p = (3,-1) F1F1F1F1

38 38 Working with Frames F1F1F1F1 F1F1F1F1 p = (3,-1) F2F2F2F2 F2F2F2F2

39 39 Working with Frames F1F1F1F1 F1F1F1F1 p = (3,-1) F2F2F2F2 p = (-1.5,2) F2F2F2F2

40 40 Working with Frames F1F1F1F1 F1F1F1F1 p = (3,-1) F2F2F2F2 p = (-1.5,2) F2F2F2F2 F2F2F2F2

41 41 Working with Frames F1F1F1F1 F1F1F1F1 p = (3,-1) F2F2F2F2 p = (-1.5,2) F3F3F3F3 F2F2F2F2 F3F3F3F3

42 42 Working with Frames F1F1F1F1 F1F1F1F1 p = (3,-1) F2F2F2F2 p = (-1.5,2) F3F3F3F3 p = (1,2) F2F2F2F2 F3F3F3F3

43 43 Working with Frames F1F1F1F1 p = (3,-1) F2F2F2F2 p = (-1.5,2) F3F3F3F3 p = (1,2) F1F1F1F1 F2F2F2F2 F3F3F3F3 F3F3F3F3

44 44 Named Coordinate Frames origin and basis vectors pick canonical frame of reference then don’t have to store origin, basis vectors just convention: Cartesian orthonormal one on previous slide handy to specify others as needed airplane nose, looking over your shoulder,... really common ones given names in CG object, world, camera, screen,...


Download ppt "University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2016 Tamara Munzner Math Basics Week 1, Fri."

Similar presentations


Ads by Google