Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1 : “shiv rpi” Linear Algebra A gentle introduction Linear Algebra has become as basic and as applicable.

Slides:



Advertisements
Similar presentations
3D Geometry for Computer Graphics
Advertisements

Geometry (Many slides adapted from Octavia Camps and Amitabh Varshney)
Chapter 4.1 Mathematical Concepts
Computer Graphics Recitation 5.
Linear Algebra and SVD (Some slides adapted from Octavia Camps)
Chapter 4.1 Mathematical Concepts. 2 Applied Trigonometry Trigonometric functions Defined using right triangle  x y h.
CS5500 Computer Graphics March 22, Angel: Interactive Computer Graphics 3E © Addison-Wesley 2002 Coordinate-Free Geometry When we learned simple.
CSCE 590E Spring 2007 Basic Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.
3-D Geometry.
Computer Graphics CSC 630 Lecture 2- Linear Algebra.
Vectors.
Boot Camp in Linear Algebra Joel Barajas Karla L Caballero University of California Silicon Valley Center October 8th, 2008.
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
Mathematical Fundamentals
Rotations and Translations
COS 397 Computer Graphics Svetla Boytcheva AUBG, Spring 2013.
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.
Patrick Nichols Thursday, September 18, Linear Algebra Review.
Recap of linear algebra: vectors, matrices, transformations, … Background knowledge for 3DM Marc van Kreveld.
Chapter 4.1 Mathematical Concepts
Modern Navigation Thomas Herring
Mathematical Foundations Sections A-1 to A-5 Some of the material in these slides may have been adapted from university of Virginia, MIT and Åbo Akademi.
6.837 Linear Algebra Review Patrick Nichols Thursday, September 18, 2003.
CSE 681 Review: Transformations. CSE 681 Transformations Modeling transformations build complex models by positioning (transforming) simple components.
Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1 : “shiv rpi” Linear Algebra A gentle introduction Linear Algebra has become as basic and as applicable.
Mathematics for Graphics. 1 Objectives Introduce the elements of geometry  Scalars  Vectors  Points Develop mathematical operations among them in a.
CS 376 Introduction to Computer Graphics 02 / 16 / 2007 Instructor: Michael Eckmann.
Overview Definitions Basic matrix operations (+, -, x) Determinants and inverses.
6.837 Linear Algebra Review Rob Jagnow Monday, September 20, 2004.
Introduction to Matrices and Vectors Sebastian van Delden USC Upstate
16/5/ :47 UML Computer Graphics Conceptual Model Application Model Application Program Graphics System Output Devices Input Devices API Function.
Background Mathematics Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006.
1 Graphics CSCI 343, Fall 2015 Lecture 10 Coordinate Transformations.
Chun-Yuan Lin Mathematics for Computer Graphics 2015/12/15 1 CG.
3D Transformation A 3D point (x,y,z) – x,y, and z coordinates
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2016 Tamara Munzner Math Basics Week 1, Fri.
CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.
Composite 3D Transformations. Example of Composite 3D Transformations Try to transform the line segments P 1 P 2 and P 1 P 3 from their start position.
 An image is the new figure, and the preimage is the original figure  Transformations-move or change a figure in some way to produce an image.
Computer Graphics Mathematical Fundamentals Lecture 10 Taqdees A. Siddiqi
Linear Algebra Review Tuesday, September 7, 2010.
Computer Graphics Lecture 11 2D Transformations I Taqdees A. Siddiqi
Unsupervised Learning II Feature Extraction
Boot Camp in Linear Algebra TIM 209 Prof. Ram Akella.
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.
College Algebra Chapter 6 Matrices and Determinants and Applications
CSE 167 [Win 17], Lecture 2: Review of Basic Math Ravi Ramamoorthi
Math Fundamentals Maths revisit.
Linear Algebra Lecture 2.
Linear Algebra Review.
Lecture 03: Linear Algebra
CSE 541 – Numerical Methods
Chapter 3 Linear Algebra
Matrix Algebra.
Basics of Linear Algebra
Linear Algebra A gentle introduction
Math review - scalars, vectors, and matrices
Game Programming Algorithms and Techniques
Presentation transcript:

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1 : “shiv rpi” Linear Algebra A gentle introduction Linear Algebra has become as basic and as applicable as calculus, and fortunately it is easier. --Gilbert Strang, MIT

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 2 : “shiv rpi” What is a Vector ? q Think of a vector as a directed line segment in N-dimensions! (has “length” and “direction”) q Basic idea: convert geometry in higher dimensions into algebra! q Once you define a “nice” basis along each dimension: x-, y-, z-axis … q Vector becomes a 1 x N matrix! q v = [a b c] T q Geometry starts to become linear algebra on vectors like v! x y v

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 3 : “shiv rpi” Vector Addition: A+B A B A B C A+B = C (use the head-to-tail method to combine vectors) A+B

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 4 : “shiv rpi” Scalar Product: av v av Change only the length (“scaling”), but keep direction fixed. Sneak peek: matrix operation (Av) can change length, direction and also dimensionality!

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 5 : “shiv rpi” Vectors: Dot Product Think of the dot product as a matrix multiplication The magnitude is the dot product of a vector with itself The dot product is also related to the angle between the two vectors

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 6 : “shiv rpi” Inner (dot) Product: v.w or w T v v w  The inner product is a SCALAR! If vectors v, w are “columns”, then dot product is w T v

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 7 : “shiv rpi” Bases & Orthonormal Bases q Basis (or axes): frame of reference vs Basis: a space is totally defined by a set of vectors – any point is a linear combination of the basis Ortho-Normal: orthogonal + normal [Sneak peek: Orthogonal: dot product is zero Normal: magnitude is one ]

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 8 : “shiv rpi” What is a Matrix? q A matrix is a set of elements, organized into rows and columns rows columns

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 9 : “shiv rpi” Basic Matrix Operations q Addition, Subtraction, Multiplication: creating new matrices (or functions) Just add elements Just subtract elements Multiply each row by each column

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 10 : “shiv rpi” Matrix Times Matrix

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 11 : “shiv rpi” Multiplication q Is AB = BA? Maybe, but maybe not! q Matrix multiplication AB: apply transformation B first, and then again transform using A! q Heads up: multiplication is NOT commutative! q Note: If A and B both represent either pure “rotation” or “scaling” they can be interchanged (i.e. AB = BA)

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 12 : “shiv rpi” Matrix operating on vectors q Matrix is like a function that transforms the vectors on a plane q Matrix operating on a general point => transforms x- and y-components q System of linear equations: matrix is just the bunch of coeffs ! q x’ = ax + by q y’ = cx + dy              ' ' y x dc ba       y x

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 13 : “shiv rpi” Direction Vector Dot Matrix

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 14 : “shiv rpi” Matrices: Scaling, Rotation, Identity q Pure scaling, no rotation => “diagonal matrix” (note: x-, y-axes could be scaled differently!) q Pure rotation, no stretching => “orthogonal matrix” O q Identity (“do nothing”) matrix = unit scaling, no rotation! [cos , sin  ] T [1,0] T [0,1] T  [-sin , cos  ] T cos  -sin  sin  cos  [1,0] T [0,1] T r r 2 [r 1,0] T [0,r 2 ] T scaling rotation

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 15 : “shiv rpi” Scaling P P’ r 0 0 r a.k.a: dilation (r >1), contraction (r <1)

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 16 : “shiv rpi” Rotation P P’ cos  -sin  sin  cos 

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 17 : “shiv rpi” 2D Translation t P P’ P x y tx ty P’ t

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 18 : “shiv rpi” Inverse of a Matrix q Identity matrix: AI = A q Inverse exists only for square matrices that are non-singular q Maps N-d space to another N-d space bijectively q Some matrices have an inverse, such that: AA -1 = I q Inversion is tricky: (ABC) -1 = C -1 B -1 A -1 Derived from non- commutativity property

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 19 : “shiv rpi” Determinant of a Matrix q Used for inversion q If det(A) = 0, then A has no inverse ns/inverse/threeD/index.htm

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 20 : “shiv rpi” Projection: Using Inner Products (I) p = a (a T x) ||a|| = a T a = 1

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 21 : “shiv rpi” Homogeneous Coordinates q Represent coordinates as (x,y,h) q Actual coordinates drawn will be (x/h,y/h)

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 22 : “shiv rpi” Homogeneous Coordinates q The transformation matrices become 3x3 matrices, and we have a translation matrix! 1 0 t x 0 1 t y = x’ y’ 1 xy1xy1 New point Transformation Original point Exercise: Try composite translation.

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 23 : “shiv rpi” Homogeneous Transformations

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 24 : “shiv rpi”24 Order of Transformations q Note that matrix on the right is the first applied q Mathematically, the following are equivalent p’ = ABCp = A(B(Cp)) q Note many references use column matrices to represent points. In terms of column matrices p ’T = p T C T B T A T TRM

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 25 : “shiv rpi”25 Rotation About a Fixed Point other than the Origin Move fixed point to origin Rotate Move fixed point back M = T(p f ) R(  ) T(-p f )

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 26 : “shiv rpi” Vectors: Cross Product q The cross product of vectors A and B is a vector C which is perpendicular to A and B q The magnitude of C is proportional to the sin of the angle between A and B q The direction of C follows the right hand rule if we are working in a right-handed coordinate system B A A×BA×B

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 27 : “shiv rpi” MAGNITUDE OF THE CROSS PRODUCT

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 28 : “shiv rpi” DIRECTION OF THE CROSS PRODUCT q The right hand rule determines the direction of the cross product

Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 29 : “shiv rpi” For more details q Prof. Gilbert Strang’s course videos: q /VideoLectures/index.htm /VideoLectures/index.htm q Esp. the lectures on eigenvalues/eigenvectors, singular value decomposition & applications of both. (second half of course) q Online Linear Algebra Tutorials: q