2.2 Day 2 Reflections and Rotations combined with Scaling The concept of transformations inspired art by M.C. Escher Reflections Consider a line L through the origin. We saw yesterday that and vector in R2 can be written as the sum of components perpendicular and parallel that line If we consider the parallel component minus two times the perpendicular component, The result if a resultant vector that is the a reflection of the original vector over line L You will need this formula in your notes Problem 7 Solution to problem 7 Formula Reflections over a vector (line) The matrix of transformation is given by the formula: Note u1 and u2 are components of a unit vector pointing in the direction of line of reflection. (will prove as next problem) Please note that this matrix has the following form: Where Note: this only works for vectors in R2 while other formula works for in Rn Problem 13 Solution to Problem 13 Reflections Find the matrix of projection through Use the matrix Find the matrix of reflection over For reflections in 3 D space Reflecting a Vector over a plane Formula for reflection over a plane: Add this formula to your notes Note: u is a unit vector perpendicular (normal) to the plane Example 3 Note: we are reflecting the vector x about a plane Formula: Solution to example 3 Recall: Rotations Note: We proved this in 2.1 The matrix of counterclockwise rotation in real 2 dimensional space through angle theta is Note this is a matrix of the form The matrix below represents a rotation. Find the angle of rotation (in radians) The matrix below represents a rotation. Find the angle of rotation (in radians) Use the formula: Answer: invcos(3/5) Or invsin (4/5) Rotations combined with Scaling This is the same as the proof we did in 2.1 but now we don’t require a2 + b 2 = 1 Why does removing this requirement result in a rotation plus a scaling? What matrices should we have in our library of basic matrices? Identity Matrix Projection Matrices Projection onto x-axis Projection onto y-axis Rotation Matrix Reflection Matrix Rotation with Scaling One directional Scaling Mixed Scaling Horizontal Shear Vertical Shear How do you identify an unknown matrix? 1) Check your library of basic matrices. 2) Use your knowledge of matrix multiplication. 3) Plug in values. To be efficient use the elementary matrices. Identify the following matrices 1 0 2 1 5 0 25/169 60/169 0 2 60/169 144/169 2 0 3/5 4/5 1 -2 0 0 4/5 -3/5 2 1 5/13 -12/13 12/13 5/13 Identify the following matrices 1 0 2 1 5 0 25/169 60/169 0 2 60/169 144/169 Vertical shear Combined scaling 0 3/5 4/5 1 -2 0 0 4/5 -3/5 2 1 reflection 12/13 5/13 rotation projection 2 Projection Onto x-axis with scaling 5/13 -12/13 An non-symmetrical Projection onto y=x Rotation with scaling Homework P. 65 7,11, 25,26 (d, e only) 27,28,32,34,37,38,39, Rotations in R3 For more information on rotations visit: http://www.songho.ca/opengl/gl_projectionmatrix.html