CSCE 441 Lecture 8
« previous | Friday, January 31, 2014 | next »
2D Transformations
Coordinates
Depends on choice of origin (0,0) and axes.
Analogous to assembly language:
- Assembly is a necessary evil for computation
- But we'd like to think at a higher level
Vector operations
- dot product
- Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle v \cdot w = \left| v \right| \, \left| w \right| \, \cos{\theta} = v_x \, w_x + v_y \, w_y}
- commutative
- 2D cross product
- Rotates by
Types of Transformations
- Conformal
- Preserves angles
- Translation, rotation, uniform scaling
- Affine
- Represented by matrix multiplication
- Translation, rotation, general scaling, shear
Translation
Add vector to point :
Uniform Scaling
origin about which to scale
Given point to scale and scaling factor ,
- find vector from to :
- scale that vector by alpha:
- add the vector back to to get final position:
Rearranging the terms gives
Non-Uniform Scaling
Point and vector:
- origin point for center of scaling
- direction of scale (assumed unit length)
Given point to scale and a scaling factor ,
- find vector from to :
- take vector projection of onto :
- use projection to find residual vector:
- scale the -parallel component of :
- add residual vector back in and add to origin point to get final point:
Substituting definitions and rearranging the formula gives
Rotation
Need center of rotation and angle
Given point to rotate about point ,
- find vector from to :
- set up a "coordinate system" by taking the 2D cross product
- using and as new axes, observe that the rotated point is at position
- hence the vector from to is given by Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \cos{\theta} \, \vec{q} + \sin{\theta} \, \vec{q}^\perp}
- Add the origin point to get the final position.
Shearing
Point Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle O} and unit vector Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \vec{v}} .
Given point Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle P} to shear by amount Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \alpha} ,
- compute Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \vec{q} = P - O}
- set up a coordinate system by finding the 2D cross product of Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \vec{v}} : Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \vec{v}^\perp = \left\langle -v_y, v_x \right\rangle}
- project Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \vec{q}} onto Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \vec{v}} and Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \vec{v}^\perp} to get Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \vec{q}^\parallel = (\vec{v} \cdot \vec{q}) \vec{v}} and Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \vec{q}^\perp = (\vec{v}^\perp \cdot \vec{q}) \, \vec{v}^\perp} , respectively.
- the shearing vector scales Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \vec{q}^\parallel} (in the direction of Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \vec{v}} depending on the magnitude of Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \vec{q}^\perp} and Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \alpha} : Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \vec{q}^\perp + \alpha \, \left| \vec{q}^\perp \right| \, \vec{v}}
- Add Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \vec{q}^\parallel} to get the final position
Plugging in definitions and rearranging gives
Transformations as Matrices
- Compact representation of all affine transformations
- allows multiple transformatinos to be represented as a single matrix
- requires coordinates

Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \hat{p} = M \, p + t}