Joshua Barczak CMSC 435 UMBC

Slides:



Advertisements
Similar presentations
Vectors, Points, Lines and Planes Jim Van Verth Lars M. Bishop
Advertisements

CS 450: COMPUTER GRAPHICS LINEAR ALGEBRA REVIEW SPRING 2015 DR. MICHAEL J. REALE.
UBI 516 Advanced Computer Graphics
General Physics (PHYS101)
Math Review Guest Lecturer: Michiel van de Panne Week 1, Wed Jan 9
6 6.1 © 2012 Pearson Education, Inc. Orthogonality and Least Squares INNER PRODUCT, LENGTH, AND ORTHOGONALITY.
Chapter 4.1 Mathematical Concepts
Chapter 4.1 Mathematical Concepts. 2 Applied Trigonometry Trigonometric functions Defined using right triangle  x y h.
CSCE 590E Spring 2007 Basic Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.
Computer Graphics CSC 630 Lecture 2- Linear Algebra.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2007 Tamara Munzner Math Review Week 1, Wed.
Chapter 2: Vectors Ian Parberry University of North Texas Fletcher Dunn Valve Software 3D Math Primer for Graphics and Game Development.
Linear Algebra Review CSE169: Computer Animation Instructor: Steve Rotenberg UCSD, Winter 2005.
Vectors and Scalars Vector and scalar quantities Adding vectors geometrically Components Unit Vectors Dot Products Cross Products pps by C Gliniewicz.
Scalar and Vector Fields
Linear Algebra Review By Tim K. Marks UCSD Borrows heavily from: Jana Kosecka Virginia de Sa (UCSD) Cogsci 108F Linear.
2IV60 Computer Graphics Basic Math for CG
Foundations of Computer Graphics (Fall 2012) CS 184, Lecture 2: Review of Basic Math
Geometric Intuition Randy Gaul. Vectors, Points and Basis Matrices Rotation Matrices Dot product and how it’s useful Cross product and how it’s useful.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
CS 450: Computer Graphics REVIEW: OVERVIEW OF POLYGONS
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.
Chapter 4.1 Mathematical Concepts
7.1 Scalars and vectors Scalar: a quantity specified by its magnitude, for example: temperature, time, mass, and density Chapter 7 Vector algebra Vector:
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.
CPSC 491 Xin Liu Nov 17, Introduction Xin Liu PhD student of Dr. Rokne Contact Slides downloadable at pages.cpsc.ucalgary.ca/~liuxin.
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.
Vector Addition. What is a Vector A vector is a value that has a magnitude and direction Examples Force Velocity Displacement A scalar is a value that.
Mathematics for Graphics. 1 Objectives Introduce the elements of geometry  Scalars  Vectors  Points Develop mathematical operations among them in a.
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.
Introduction to Matrices and Vectors Sebastian van Delden USC Upstate
Background Mathematics Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006.
Presented by: S. K. Pandey PGT Physics K. V. Khandwa Kinematics Vectors.
CS 551 / 645: Introductory Computer Graphics Mathematical Foundations.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2016 Tamara Munzner Math Basics Week 1, Fri.
Computer Graphics Matrices
CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.
CSE 681 Brief Review: Vectors. CSE 681 Vectors Basics Normalizing a vector => unit vector Dot product Cross product Reflection vector Parametric form.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Math Review Week 1, Fri.
Linear Algebra Review Tuesday, September 7, 2010.
Chapter 4.1 Mathematical Concepts. 2 Applied Trigonometry "Old Henry And His Old Aunt" Defined using right triangle  x y h.
1 MAC 2103 Module 4 Vectors in 2-Space and 3-Space I.
David Luebke6/12/2016 CS 551 / 645: Introductory Computer Graphics David Luebke
Graphics Graphics Korea University kucg.korea.ac.kr Mathematics for Computer Graphics 고려대학교 컴퓨터 그래픽스 연구실.
Introduction; Mathematical Foundations CS 445/645 Introduction to Computer Graphics David Luebke, Spring 2003.
Lecture 1 Linear algebra Vectors, matrices. Linear algebra Encyclopedia Britannica:“a branch of mathematics that is concerned with mathematical structures.
CSE 681 Brief Review: Vectors. CSE 681 Vectors Direction in space Normalizing a vector => unit vector Dot product Cross product Parametric form of a line.
CA 302 Computer Graphics and Visual Programming
CSE 167 [Win 17], Lecture 2: Review of Basic Math Ravi Ramamoorthi
Core mathematical underpinnings
Math Fundamentals Maths revisit.
Chapter 1 Linear Equations and Vectors
Outline Addition and subtraction of vectors Vector decomposition
Review: Transformations
Lecture 03: Linear Algebra
Chapter II Mathematics: Basics
Chapter 3 Linear Algebra
CSE 411 Computer Graphics Lecture #2 Mathematical Foundations
CSCE441: Computer Graphics 2D/3D Transformations
Math review - scalars, vectors, and matrices
Game Programming Algorithms and Techniques
CHAPTER 3 VECTORS NHAA/IMK/UNIMAP.
Presentation transcript:

Joshua Barczak CMSC 435 UMBC Miscellaneous Math Joshua Barczak CMSC 435 UMBC

You had better know… Basic Algebra The Quadratic Formula Geometry and Trigonometry SOHCAHTOA or however you learned it Pathagorean theorem Angles and lines What “the matrix” is…

Today Barrage of math facts useful to graphics Vectors Matrices Lines/Planes Triangles Implicits

Vectors N-vector Tuple of N of scalars Arbitrary dimension 2, 3, 4 are ubiquitous in graphics

Vectors Vectors are arrows protruding from a point… Direction Magnitude z x y

Points … and points are vectors from the origin Direction from origin Magnitude=Distance z x y

Spherical Coordinates 2 angles + Distance Wikipedia

Vectors Some definitions: Normalization Orthogonal  Perpendicular Magnitude (Length): Normalized  Length=1 Normalization Divide by length

Surface Normals Surface normal = Normalized vector perendicular to some surface Perpendicular to polygon plane Perpendicular to curve tangent at some point N N

Arithmetic Commutative Distributive Associative

Vector Addition u v u+v u v u+v = v+u u v Put them end to end, then connect the dots… Order doesn’t matter….

Vector Subtraction Subtracting vectors gives a vector between the two “tips” xb-xa V yb-ya A B

Point Subtraction Subtracting points gives a vector from last to first, with first as its “origin”… P1 V P0 y1-y0 x1-x0

Vector Scaling au axu ayu u xu yu Scales vector length by a

Dot Product q u,v are orthogonal  u,v are perpendicular cos(theta) = 0  u.v=0

Dot Product Implications: Same direction Opposite direction u.v = |u||v| Length is sqrt(x.x) Opposite direction u.v = -|u||v| Normalized vectors Cosine of angle Same sign, same side… N

Dot Product u v’ v Dot products can be used to project onto other vectors

Dot Product More useful facts (a,b,c vectors. x,y scalars) Just like multiplication… If you’re queasy about dot products, go home and prove all these….

Basis Vectors All vectors can be written as linear combinations of other vectors

Basis Vectors Basis: Orthogonal basis Orthonormal basis “Linearly independent set of vectors that span a space” One is not a weighted sum of the others Orthogonal basis Basis S.T. all vectors are perpendicular Orthonormal basis Orthogonal basis with unit-length vectors

Basis Vectors Vectors are always relative to some basis The “Default” basis vectors are the coordinate axes… B A X+ Y+ D C

Basis Vectors ….and a point is relative to an origin AND some basis vectors B A X+ Y+ D C

Coordinate System Basis Vectors + Origin Cartesian Coordinates Basis is a “span” Sometimes basis is orthonormal Cartesian Coordinates Origin is 0,0,0 Basis Vectors X+,Y+,Z+ X Y Z Wikipedia

Change of Basis To write a vector v in terms of new basis vectors Bx and By we…. xv v By yv Bx This will become very important later…

Change of Basis …project it onto each basis vector. Bx, By are the new coordinate axes… x’ v’ By y’ Bx This will become very important later…

Change of Coordinate System To switch coordinate systems we… By P O Bx This will become very important later…

Change of Coordinate System …write P in terms of new origin, then…. By P’ O Bx This will become very important later…

Change of Coordinate System …project onto new basis vectors By Q O Bx This will become very important later…

Change of Coordinate System To go back out, add scaled basis vectors to origin… By Q P O Bx This will become very important later…

Handedness X Y Z Y X Y Z Z X X Y Z Y X Y Z Z X Wikipedia Wikipedia, Reflected X Y Z Y X Y Z Z X

Cross Product Wikipedia

Cross Product Perpendicular to inputs Length Length is area of parallelogram q a b a x b

Cross Product If a,b are orthonormal, axb is normalized If a,b have same or opposite direction, axb is zero Also: Anticommutative Distributive NOT associative q a b a x b

Cross Product More potentially useful facts…

Building an Orthogonal Basis (AxB)xA B B (AxB)xA A A A A AxB AxB AxB

2D “Cross Product” r1 r0 Signed area of Parallelogram. Negative Vectors are clockwise Positive Vectors are counterclockwise

2D “Cross Product” Application: Given two points, which side of their line is a third point on? B C A

2D “Sidedness” Use 2D Cross product: Positive Left Negative  Right Zero  Co-linear B C A

Matrices N row vectors M column vectors NxM scalars… If you have not taken your red pill, do so NOW…

Matrix Determinant(2x2) Didn’t we see this already…? c1 c0 Signed area of Parallelogram. Negative Vectors are clockwise Positive Vectors are counterclockwise Positive  Identity matrix

Matrix Determinant (3x3) Signed volume of that thing PositiveRight handed basis NegativeLeft handed basis Wikipedia

Matrix Multiplication

Matrix Multiplication …is just a bunch of dot products

Matrix/Vector Multiplication

Matrix/Vector Multiplication …. is also a bunch of dot products This IS change of basis Projection onto row/column vectors

Matrix Inverse If rows form an orthonormal basis, Inverse equals transpose Square matrix is invertible if it has non-zero determinant Zero determinant  Zero area/volume Vectors do not span the full space… If det(M)=0, it goes flat…

Linear Interpolation In-betweening… s A A B t B C D t=0.25 t=0 t=0.75

Implicit 2D Lines You should know slope-intercept Lines also have an implicit form (x2,y2) (x1,y1) (A,B)

Implicit 2D Lines Point-Line Distance Plug point into line equation Result is scaled by length of [A,B] To “normalize” line, divide A,B,C by normal length (x2,y2) (x1,y1) (A,B) Negative Here Positive Here

3D Planes Planes are analogous to 2D Lines Plug in points for signed distance Positive  “in front” Negative  “behind” 0  On plane The rain in Spain…

3D Planes Plane from point and normal N P P1

3D Planes Plane from 3 Points Cross Product N P3 P2 P1

Triangle Area This again… Sign indicates vertex order… Positive: A,B,C counter-clockwise In 3D: Use magnitude of cross product… C B A

Point-In-Triangle Test Method 1: Three determinant tests. Check signs… Y P (blue) Z (red) X (green)

Point-In-Triangle Test Method 2: Extract line equations See earlier slides Test signed distances Same sign Inside B P C A

Barycentric Coordinates g=0 Ratios of areas a=0 B (0,1,0) a P g b C b=0 (0,0,1) A (1,0,0) Inside Triangle

Barycentric Coordinates Edge equations normalized to opposite vertex… g=0 a=0 b=1 g=1 a=1 b=0

Barycentric Interpolation Interpolation across triangle surface Weight per-vertex values by barycentric coordinates

Implicit Surfaces Surface Surface normal Set of all zeros of implicit function “Inside”Negative “Outside”Positive Surface normal Vector of partials “Gradient” Points in direction of greatest change in f

Implicit Surfaces …mmmmmm…. Formulii……