Math review - scalars, vectors, and matrices

Slides:



Advertisements
Similar presentations
CS 450: COMPUTER GRAPHICS LINEAR ALGEBRA REVIEW SPRING 2015 DR. MICHAEL J. REALE.
Advertisements

Math Review Guest Lecturer: Michiel van de Panne Week 1, Wed Jan 9
Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1 : “shiv rpi” Linear Algebra A gentle introduction Linear Algebra has become as basic and as applicable.
Ch 7.2: Review of Matrices For theoretical and computation reasons, we review results of matrix theory in this section and the next. A matrix A is an m.
Vectors.
Linear Algebra Review CSE169: Computer Animation Instructor: Steve Rotenberg UCSD, Winter 2005.
Linear Algebra Review By Tim K. Marks UCSD Borrows heavily from: Jana Kosecka Virginia de Sa (UCSD) Cogsci 108F Linear.
Row 1 Row 2 Row 3 Row m Column 1Column 2Column 3 Column 4.
2IV60 Computer Graphics Basic Math for CG
Basics of Linear Algebra A review?. Matrix  Mathematical term essentially corresponding to an array  An arrangement of numbers into rows and columns.
Foundations of Computer Graphics (Fall 2012) CS 184, Lecture 2: Review of Basic Math
Compiled By Raj G. Tiwari
Graphics CSE 581 – Interactive Computer Graphics Mathematics for Computer Graphics CSE 581 – Roger Crawfis (slides developed from Korea University slides)
6.837 Linear Algebra Review Patrick Nichols Thursday, September 18, 2003.
1 February 24 Matrices 3.2 Matrices; Row reduction Standard form of a set of linear equations: Chapter 3 Linear Algebra Matrix of coefficients: Augmented.
ECON 1150 Matrix Operations Special Matrices
Patrick Nichols Thursday, September 18, Linear Algebra Review.
Systems of Linear Equation and Matrices
Matrix Algebra. Quick Review Quick Review Solutions.
Slide Chapter 7 Systems and Matrices 7.1 Solving Systems of Two Equations.
6.837 Linear Algebra Review Patrick Nichols Thursday, September 18, 2003.
H.Melikyan/12001 Vectors Dr.Hayk Melikyan Departmen of Mathematics and CS
Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1 : “shiv rpi” Linear Algebra A gentle introduction Linear Algebra has become as basic and as applicable.
2 2.1 © 2016 Pearson Education, Inc. Matrix Algebra MATRIX OPERATIONS.
Statistics and Linear Algebra (the real thing). Vector A vector is a rectangular arrangement of number in several rows and one column. A vector is denoted.
6.837 Linear Algebra Review Rob Jagnow Monday, September 20, 2004.
Linear algebra: matrix Eigen-value Problems Eng. Hassan S. Migdadi Part 1.
Matthew Christian. About Me Introduction to Linear Algebra Vectors Matrices Quaternions Links.
Chun-Yuan Lin Mathematics for Computer Graphics 2015/12/15 1 CG.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2016 Tamara Munzner Math Basics Week 1, Fri.
Computer Graphics Mathematical Fundamentals Lecture 10 Taqdees A. Siddiqi
Linear Algebra Review Tuesday, September 7, 2010.
Unsupervised Learning II Feature Extraction
Graphics Graphics Korea University kucg.korea.ac.kr Mathematics for Computer Graphics 고려대학교 컴퓨터 그래픽스 연구실.
Lecture 1 Linear algebra Vectors, matrices. Linear algebra Encyclopedia Britannica:“a branch of mathematics that is concerned with mathematical structures.
Vectors and the Geometry
Matrices Introduction.
MTH108 Business Math I Lecture 20.
CA 302 Computer Graphics and Visual Programming
Spaces.
CSE 167 [Win 17], Lecture 2: Review of Basic Math Ravi Ramamoorthi
Linear Algebra Review.
Boyce/DiPrima 10th ed, Ch 7.2: Review of Matrices Elementary Differential Equations and Boundary Value Problems, 10th edition, by William E. Boyce and.
Linear Algebra review (optional)
Mathematics for Computer Graphics
Review of Matrix Operations
Chapter 7 Matrix Mathematics
Outline Addition and subtraction of vectors Vector decomposition
Vectors.
Matrix Operations SpringSemester 2017.
Systems of First Order Linear Equations
Lecture 03: Linear Algebra
Joshua Barczak CMSC 435 UMBC
3D Transformation CS380: Computer Graphics Sung-Eui Yoon (윤성의)
Dr Huw Owens Room B44 Sackville Street Building Telephone Number 65891
CSE 541 – Numerical Methods
Chapter 3 Linear Algebra
CSE 411 Computer Graphics Lecture #2 Mathematical Foundations
Matrix Algebra.
Basics of Linear Algebra
Rendering – Matrix Transformations and the Graphics Pipeline
Linear Algebra A gentle introduction
Laboratory in Oceanography: Data and Methods
Matrix Operations Ms. Olifer.
Matrix Operations SpringSemester 2017.
Game Programming Algorithms and Techniques
3.5 Perform Basic Matrix Operations Algebra II.
Presentation transcript:

Math review - scalars, vectors, and matrices Matt Boggus CSE 3541/5541

Outline Coordinate Spaces Primitives Operations Matrices Scalars Vectors Points Operations Matrices

Boardwork examples: 1D, 2D, 3D coordinate systems Instances of primitives are defined within the context of a coordinate system, so refresh with examples of these first.

Coordinate system in Unity 3D, left-handed coordinate system

Scalars Scalar value – a number (integer or real) ; one unit of data Ex: the scale, weight, or magnitude of something Examples elsewhere in CS&E (Software I) 2 scalars -> low and high for random number range (Systems I) Representing fractional values using binary numbers Au’16 deleted slides on qualities and properties of scalar addition and multiplication

Vectors Vector – a quantity possessing both magnitude and direction Usually visualized as a directed line segment, beginning at the origin, but technically have no start position Mathematically described as n-tuples of scalars Examples: (0,0,0) (x,y) (r,g,b,a)

Vector operations – mathematically Vectors = n-tuples Vector-vector addition Scalar-vector multiplication Vector decomposition Numeric examples of vector operations

Vector operations – intuitively Vector-Vector Addition Visualize using head-to-tail axiom Scalar-vector multiplication Resize (scale) the directed line segment α > 1 length increases 0 > α > 1 length decreases α < 0 reverse direction Head-to-tail axiom Scalar-vector multi.

Points Point – a location or position Visualized as a dot relative to an origin Mathematically described as n-tuples of scalars Examples: (0,0,0) (x,y) (r,g,b,a) Note: points and vectors have the same representation!

Coordinate system or frame Origin – a point Indicates the “center” of the coordinate systems Other points are defined relative to the origin Basis vectors A set of linearly independent vectors None of them can be written as a linear combination of the others Basis vectors located at the origin Arbitrary placement of basis vectors

Vectors and points in a coordinate system Coordinate frame defined by point P0 and set of vectors A vector v is A point P is Note: α and β indicate scalar values

Practice problem Given a point P = (2,-5,1) in a right handed coordinate system, what is the point is a left handed coordinate system?

Point-Vector operations P and Q are points, v is a vector Point-point subtraction operation Vector-point addition operation

Working toward a distance metric The previous operations do not include a way to estimate distance between points Create a new operation: Inner (dot) Product Input: two vectors Output: scalar Properties we want: For orthogonal vectors

Dot product logic If we can multiply two n-tuples, this implies Magnitude (length) of a vector Distance between two points Note: some reference materials use || instead of |

Dot product computation Dot product of two vectors, u and v Ex: (5,4,2) ∙ (1,0,1) = 5 * 1 + 4 * 0 + 2 * 1 = 7 With some algebra we find that the dot product is equivalent to where θ is the angle between the two vectors cosθ = 0  orthogonal cosθ = 1  parallel

Projections We can determine if two points are “close” to each other, what about vectors? How much of w is in the same direction as v? Given vectors v and w, decompose w into two parts, one parallel to v and one orthogonal to v Step 1: decompose w into two parts, one with some unknown amount (alpha) in the same direction as v (hence the scaling of v by alpha) plus some vector u whose direction we define as orthogonal to v but has an unknown magnitude. Step 2: Dot product w and v, but substitute the decomposition of w and distribute. Step 3 (same line as step 2): by definition u dot v is zero and drops out Step 4: solve for alpha Step 5: solve for u Projection of one vector onto another

Cross product Input: two vectors Output: vector, orthogonal to input vectors General formula Two 3D vectors http://en.wikipedia.org/wiki/Cross_product Note: sin and cos (also sin-1 and cos-1)can be expensive to compute – involves computing a series until sufficient precision is reached See After computers: power series on page http://www2.clarku.edu/~djoyce/trig/compute.html Modified Figure 1.1.6 from Essential Mathematics for Games and Interactive Applications

Matrices Definitions Matrix Operations Row and Column Matrices Change of Representation Relating matrices and vectors

What is a Matrix? A matrix is a set of elements, organized into rows and columns rows columns

Definitions n x m Array of Scalars (n Rows and m Columns) n: row dimension of a matrix, m: column dimension m = n  square matrix of dimension n Element Transpose: interchanging the rows and columns of a matrix Column Matrices and Row Matrices Column matrix (n x 1 matrix): Row matrix (1 x n matrix):

Matrix Operations Scalar-Matrix Multiplication Matrix-Matrix Addition Multiply every element by the scalar Matrix-Matrix Addition Add elements with same index Matrix-Matrix Multiplication A: n x l matrix, B: l x m  C: n x m matrix Easy to overlook that cij is a single element, so computing C requires iterating over rows and columns. cij = the sum of multiplying elements in row i of matrix a times elements in column j of matrix b

Matrix Operation Examples

Matrix Operations Properties of Scalar-Matrix Multiplication Properties of Matrix-Matrix Addition Commutative: Associative: Properties of Matrix-Matrix Multiplication Identity Matrix I (Square Matrix)

Matrix Multiplication Order Is AB = BA? Try it! Matrix multiplication is NOT commutative! The order of series of matrix multiplications is important! Generalize where possible, but don’t forget about special cases

Inverse of a Matrix Identity matrix: AI = A Some matrices have an inverse, such that: AA-1 = I

Inverse of a Matrix Do all matrices have a multiplicative inverse? Consider this example, try to solve for A-1: AA-100 = Given A, try to solve for the 9 variables in its inverse A-1 by setting the result of the multiplication AA-1 equal to I. If no solution exists, the matrix has no inverse. 0 * a + 0 * d + 0 * g = 0 ≠ 1 Note: 1 is the element at 00 in the identity matrix

Inverse of Matrix Concatenation Inversion of concatenations (ABC)-1 = ? A * B * C * X = I A * B * C * C-1 = A * B A * B * B-1 = A A * A-1 = I Order is important, so X = C-1B-1A-1 Given A, B, and C assuming each has an inverse, we can construct the inverse of a series of multiplications ABC by constructing a matrix such that each individual “cancels” with its inverse.

Row and Column Matrices + points By convention we will use column matrices for points Column Matrix Row matrix Concatenations Associative By Row Matrix

Summary Primitives: scalars, vectors, points Operations: addition and multiplication Matrix representation and operations