Week 2 - Linear and Affine Transformations, Homogeneous and 3D Coordinates Flashcards
What are linear transformations?
Transformations effected by a matrix product.
Give 4 examples of linear transformations.
Rotation, scaling, shear, mirroring.
What is the matrix transformation for rotation?
cosθ -sin θ
sin θ cos θ
Where θ is the angle of rotation around the origin.
What is the matrix transformation for scaling?
λ1 0
0 λ2
Where λ1 and λ2 are the scaling factors.
What is isotropic scaling?
Both x and y scaled by the same factor (equal entries on diagonal - λ1 = λ2).
What is anisotropic scaling?
x and y scaled by the different factors (unequal entries on diagonal - λ1 =! λ2).
What is the matrix transformation for shear?
Either:
1 λ
0 1
Or:
1 0
µ 1
(One coordinate left unchanged!)
What is the formula for the general transformation?
x’ = Mx + t
What are 3 properties of affine transformations?
Map straight lines into straight lines.
Map parallel lines into parallel lines.
Comprise all combinations of scaling, rotations, shears and translations.
What is an affine transformation?
Linear transformation + translation.
Why are homogeneous coordinates used?
To combine affine transformations without it getting too complicated.
Give the homogeneous rotation matrix for 2D coordinates.
cosθ -sin θ 0
sin θ cos θ 0
0 0 1
Give the homogeneous scaling matrix for 2D coordinates.
λx 0 0
0 λy 0
0 0 1
Give the homogeneous shear matrix for 2D coordinates.
1 λ 0
0 1 0
0 0 1
or
1 0 0
µ 1 0
0 0 1
Give the homogeneous translatation matrix for 2D coordinates.
1 0 tx
0 1 ty
0 0 1
What are the 4 exceptions to “matrix multiplication is not commutative” in terms of translations?
Rotations in 2D commute with eachother (but not in 3D).
Translations commute with each other.
Scalings commute with each other.
Shears commute with each other.
How do you rotate an object about a point?
Translate object back to the origin, T.
Rotate around the origin, R.
Translate back to original location, T^-1.
How do you display the coordinates of a line segment?
Transform end points from local and world coordinates to display coordinates.
Draw line segment from joining these end points in display coordinates.
How do you display the coordinates of a rectangle?
Transform corners from local and world coordinates to display coordinates.
Draw rectangle in display coordinates.
How do you rotate by θ around the z-axis of a coordinate system (3D)?
cosθ -sin θ 0
sin θ cos θ 0
0 0 1
How do you rotate by θ around the y-axis of a coordinate system (3D)?
cosθ 0 sin θ
0 1 0
-sin θ 0 cos θ
How do you rotate by θ around the x-axis of a coordinate system (3D)?
1 0 0
0 cosθ -sin θ
0 sin θ cos θ
What is the matrix for the inverse of the rotation matrix R?
R^T (the transpose).
How do you rotate around an arbitrary axis?
Perform a first rotation to align v to one of the coordinate system’s axes (x, y or z).
Perform rotation around this axis.
Perform the inverse of step 1.