TIEA311 Tietokonegrafiikan perusteet kevät 2018

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

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

Bézier Curves and Splines

Exercises * on Linear Algebra

Final Review Sheet. B = (1, 1 + 3x, 1 + x 2 ) then 2 + 3x + 6x 2

Vectors Summary. can slide along the line of action. not restricted, defined by magnitude & direction but can be anywhere.

Mathematics for Graphics and Vision

MAT2342 : Introduction to Applied Linear Algebra Mike Newman, fall Projections. introduction

Dot Products, Transposes, and Orthogonal Projections

LINEAR ALGEBRA KNOWLEDGE SURVEY

Chapter 8. Rigid transformations

we must pay attention to the role of the coordinate system w.r.t. which we perform a tform

Linear Algebra. Min Yan

Modern Algebra Prof. Manindra Agrawal Department of Computer Science and Engineering Indian Institute of Technology, Kanpur

k is a product of elementary matrices.

Appendix A. Vector addition: - The sum of two vectors is another vector that also lie in the space:

NOTES ON LINEAR ALGEBRA CLASS HANDOUT

Span and Linear Independence

Complex Numbers CK-12. Say Thanks to the Authors Click (No sign in required)

Functions Unpacked Content For the new Common Core standards that will be effective in all North Carolina schools in the school year.

Notes on multivariable calculus

Math Linear Algebra II. 1. Inner Products and Norms

1 Euclidean geometry. 1.1 The metric on R n

Review of linear algebra

9/29/2014. Chapter 3 Kinematics in Two Dimensions; Vectors. 3-1 Vectors and Scalars. Contents of Chapter Addition of Vectors Graphical Methods

Analytic Trigonometry. Copyright Cengage Learning. All rights reserved.

is Use at most six elementary row operations. (Partial

Usually, when we first formulate a problem in mathematics, we use the most familiar

Lecture 02: 2D Geometry. August 24, 2017

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

Topic 14 Notes Jeremy Orloff

Math 24 Spring 2012 Questions (mostly) from the Textbook

Summer Packet A Math Refresher For Students Entering IB Mathematics SL

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

Vectors and their uses

Solutions to the Exercises * on Linear Algebra

Vectors Part 1: Two Dimensions

LINEAR ALGEBRA: THEORY. Version: August 12,

12x + 18y = 30? ax + by = m

Math 416, Spring 2010 More on Algebraic and Geometric Properties January 21, 2010 MORE ON ALGEBRAIC AND GEOMETRIC PROPERTIES

MTH Linear Algebra. Study Guide. Dr. Tony Yee Department of Mathematics and Information Technology The Hong Kong Institute of Education

LINEAR ALGEBRA REVIEW

An overview of key ideas

5.) For each of the given sets of vectors, determine whether or not the set spans R 3. Give reasons for your answers.

we must pay attention to the role of the coordinate system w.r.t. which we perform a tform

Mathematical Foundations: Intro

Dot Products. K. Behrend. April 3, Abstract A short review of some basic facts on the dot product. Projections. The spectral theorem.

Section 1.8/1.9. Linear Transformations

Linear Algebra II. 7 Inner product spaces. Notes 7 16th December Inner products and orthonormal bases

we have the following equation:

3.3 It All Adds Up. A Develop Understanding Task

Linear Models Review

03 - Basic Linear Algebra and 2D Transformations

Practice Exam. 2x 1 + 4x 2 + 2x 3 = 4 x 1 + 2x 2 + 3x 3 = 1 2x 1 + 3x 2 + 4x 3 = 5

Roberto s Notes on Linear Algebra Chapter 9: Orthogonality Section 2. Orthogonal matrices

Outline schemes of work A-level Mathematics 6360

Linear Algebra. Preliminary Lecture Notes

MATH 323 Linear Algebra Lecture 12: Basis of a vector space (continued). Rank and nullity of a matrix.

MATH 23a, FALL 2002 THEORETICAL LINEAR ALGEBRA AND MULTIVARIABLE CALCULUS Solutions to Final Exam (in-class portion) January 22, 2003

VECTORS. 3-1 What is Physics? 3-2 Vectors and Scalars CHAPTER

NUMB3RS Activity: What Are You Implying? Episode: Backscatter

AM 106/206: Applied Algebra Madhu Sudan 1. Lecture Notes 12

MTH 464: Computational Linear Algebra

There are two things that are particularly nice about the first basis

MATH 167: APPLIED LINEAR ALGEBRA Chapter 2

Linear Algebra Review. Vectors

Math 396. An application of Gram-Schmidt to prove connectedness

Eigenvalues and Eigenvectors

Section 13.4 The Cross Product

REFLECTIONS IN A EUCLIDEAN SPACE

Physics 110. Electricity and Magnetism. Professor Dine. Spring, Handout: Vectors and Tensors: Everything You Need to Know

DS-GA 1002 Lecture notes 0 Fall Linear Algebra. These notes provide a review of basic concepts in linear algebra.

Linear Algebra March 16, 2019

Practical Algebra. A Step-by-step Approach. Brought to you by Softmath, producers of Algebrator Software

Note: Please use the actual date you accessed this material in your citation.

Chapter 2 Notes, Linear Algebra 5e Lay

Worksheet for Lecture 15 (due October 23) Section 4.3 Linearly Independent Sets; Bases

Algebra Workshops 10 and 11

The word Matrices is the plural of the word Matrix. A matrix is a rectangular arrangement (or array) of numbers called elements.

Inner product spaces. Layers of structure:

Calculus II. Calculus II tends to be a very difficult course for many students. There are many reasons for this.

LINEAR ALGEBRA W W L CHEN

Winter 2017 Ma 1b Analytical Problem Set 2 Solutions

MITOCW ocw f99-lec16_300k

Elementary maths for GMT

CHAPTER 5. Higher Order Linear ODE'S

Vector, Matrix, and Tensor Derivatives

Spring, 2012 CIS 515. Fundamentals of Linear Algebra and Optimization Jean Gallier

3 Vectors. 18 October 2018 PHY101 Physics I Dr.Cem Özdoğan

Properties of Transformations

j=1 u 1jv 1j. 1/ 2 Lemma 1. An orthogonal set of vectors must be linearly independent.

Linear Algebra. and

Fact: Every matrix transformation is a linear transformation, and vice versa.

a (b + c) = a b + a c

Region 16 Board of Education. Precalculus Curriculum

ENGINEERING MATH 1 Fall 2009 VECTOR SPACES

Algebra I Fall 2007

2. Review of Linear Algebra

A Primer on Three Vectors

Math Precalculus Blueprint Assessed Quarter 1

Transcription:

TIEA311 Tietokonegrafiikan perusteet kevät 2018 ( Principles of Computer Graphics Spring 2018) Copyright and Fair Use Notice: The lecture videos of this course are made available for registered students only. Please, do not redistribute them for other purposes. Use of auxiliary copyrighted material (academic papers, industrial standards, web pages, videos, and other materials) as a part of this lecture is intended to happen under academic fair use to illustrate key points of the subject matter. The lecturer may be contacted for take-down requests or other copyright concerns (email: paavo.j.nieminen@jyu.fi).

TIEA311 Tietokonegrafiikan perusteet kevät 2018 ( Principles of Computer Graphics Spring 2018) Adapted from: Wojciech Matusik, and Frédo Durand: 6.837 Computer Graphics. Fall 2012. Massachusetts Institute of Technology: MIT OpenCourseWare, https://ocw.mit.edu/. License: Creative Commons BY-NC-SA Original license terms apply. Re-arrangement and new content copyright 2017-2018 by Paavo Nieminen and Jarno Kansanaho Frontpage of the local course version, held during Spring 2018 at the Faculty of Information technology, University of Jyväskylä: http://users.jyu.fi/ nieminen/tgp18/

12 Vectors (linear space) Formally, a set of elements equipped with addition and scalar multiplication plus other nice properties There is a special element, the zero vector no displacement, no force

13 Vectors (linear space) We can use a basis to produce all the vectors in the space: Given n basis vectors any vector can be written as here:

Usual Vector Spaces 35 In 3D, each vector has three components x, y, z But geometrically, each vector is actually the sum i, j, k are basis vectors j k i Vector addition: just add components Scalar multiplication: just multiply components

Polynomials as a Vector Space 36 Polynomials Can be added: just add the coefficients Can be multiplied by a scalar: multiply the coefficients

Polynomials as a Vector Space Polynomials In the polynomial vector space, {1, t,..., tn} are the basis vectors, a0, a1,..., an are the components 37

Subset of Polynomials: Cubic 39 Closed under addition & scalar multiplication Means the result is still a cubic polynomial (verify!) Cubic polynomials also compose a vector space A 4D subspace of the full space of polynomials The x and y coordinates of cubic Bézier curves belong to this subspace as functions of t.

Basis for Cubic Polynomials More precisely: What s a basis? j In 3D k A set of atomic vectors Called basis vectors Linear combinations of basis vectors span the space i.e. any cubic polynomial is a sum of those basis cubics Linearly independent Means that no basis vector can be obtained from the others by linear combination Example: i, j, i+j is not a basis (missing k direction!) i 40

Canonical Basis for Cubics They are linearly independent Means you cannot write any of the four monomials as a linear combination of the others. (You can try.) 41 1 t t2 t3 Any cubic polynomial is a linear combination of these: a0+a1t+a2t2+a3t3 = a0*1+a1*t+a2*t2+a3*t3

Linear algebra notation can be written as Nice because it makes the basis (coordinate system) explicit Shorthand: where bold means triplet, t is transpose 14

Linear transformation 17 Transformation Courtesy of Prof. Fredo Durand. Used with permission. of the vector space so that Note that it implies Notation for transformations

Matrix notation 19 Linearity implies i.e. we only need to know the basis transformation or in algebra notation

Algebra notation 21 The are also vectors of the space They can be expressed in the basis for example: which gives us

Recap, matrix notation 22 Given the coordinates c in basis the transformed vector has coordinates Mc in

Example 1 Just one example of a linear transformation matrix useful in graphics Counter-clockwise rotation of θ radians around the z-axis (pointing towards the viewer when right-handed coordinates are used): cos(θ) sin(θ) 0 R z (θ) = sin(θ) cos(θ) 0 0 0 1 How to remember / understand this? Take a pen, draw a unit circle on the xy-plane, and recall basic trigonometry from school times (or Wikipedia... )! The canonical basis vectors [1, 0, 0] t and [0, 1, 0] t must rotate along the unit circle to the expected new positions. Really, do it, if you haven t already!

Example 2 Another example of a linear transformation matrix useful in graphics Scaling of axes: s x 0 0 S(s x, s y, s z ) = 0 s y 0 0 0 s z How to remember / understand this? Take a pen, draw a unit box or some other simple shape, and see how different values of s x,s y, and s z make isotropic and anisotropic scalings. Really, do it, if you haven t already!

Further Examples Look at the implementation of the Matrix3f class in our example codes, found in the files Matrix3f.cpp and Matrix3f.h Make sure you understand the implementation of rotation and scaling matrices, and the overloaded operators for matrix-vector multiplication and matrix-matrix multiplication. Really, do it, if you haven t already! Also, see what else the class provides and how it all looks in C++. How is the code split in the header (.h) and implementation (.cpp). Learn to use your IDE to navigate the files easily!

Example: Inverse transforms Matrix3f.cpp implements determining (by computing the determinant ) if an inverse matrix exists, and a formula for inverting an invertible matrix. It is important to understand the concept of the inverse transform (M 1 M = MM 1 = I). For most of our graphics transforms, we know the inverses explicitly (understand and verify): R 1 z (θ) = R z ( θ) = cos( θ) sin( θ) 0 cos(θ) sin(θ) 0 sin( θ) cos( θ) 0 = sin(θ) cos(θ) 0 0 0 1 0 0 1 BTW: The last identity means that the inverse in this case is the transpose of the original. How do we get that? (1) By symmetry properties of the trigonometric functions (draw it to believe) but also (2) they teach us in linear algebra courses that this is true for any real-valued matrix that is orthonormal, i.e., keeps orthogonality and distances the same. This makes some inverses in graphics and other computation tasks trivial, maximally accurate, and blazingly fast!

Another inverse The inverse of scaling is easy to figure out: S 1 (s x, s y, s z ) = S(1/s x, 1/s y, 1/s z ) = 1/s x 0 0 0 1/s y 0 0 0 1/s z This one is not the same as S T because scaling is not orthonormal (orthogonal yes, but not normal, i.e., it does not preserve lengths).

Remember the supertools Your Super Tools: the Brain, the Pen and the Paper. Teacher s own example from last year:

Why do we care 23 We like linear algebra It s always good to get back to an abstraction that we know and for which smarter people have developed a lot of tools But we also need to keep track of what basis/coordinate system we use

Linear Transformations 30 L(p + q) = L(p) + L(q) L(ap) = a L(p) Translation Similitudes is not linear: Linear Rigid / Euclidean f(p) = p+t Scaling Identity Translation Isotropic Scaling Reflection f(ap) = ap+t a(p+t) = a f(p) Rotation Shear f(p+q) = p+q+t (p+t)+(q+t) = f(p) + f(q)

Affine space 33 Points are elements of an affine space We denote them with a tilde Affine spaces are an extension of vector spaces

Point-vector operations 34 Subtracting points gives a vector Adding a vector to a point gives a point

Frames 35 A frame is an origin plus a basis We can obtain any point in the space by adding a vector to the origin using the coordinates c of the vector in

Algebra notation 36 We like matrix-vector expressions We want to keep track of the frame We re going to cheat a little for elegance and decide that 1 times a point is the point is represented in by 4 coordinate, where the extra dummy coordinate is always 1 (for now)

Further Examples (Affine transforms) Look at the implementation of the Matrix4f class in our example codes, found in the files Matrix4f.cpp and Matrix4f.h These are using the fourth coordinate to implement 3D frames and affine transforms of points. A straightforward way to do many things is to build a proper 4x4 matrix and then multiply. Not much code, actually! In Assignment 1 you will avoid a lot of tears by figuring out how (and when and why) to use the provided constructors and the operator * to transform points and frames suitably.