Lecture 8: Coordinate Transformations
Basics
Multiplying a matrix by a vector allows us to produce a new, changed vectors.
A∗v=[a1,1a1,2a2,1a2,2]∗[xy]
=[a1,1∗x+a1,2∗ya2,1∗x+a2,2∗y]
Such a transformation can be used to scale, shear, and rotate a vector or Cartesian coordinates.
Scale
Matrix formulation:
A=[sx0sy0]Shear
Matrix formulation:
A=[1tanθ01]Rotation
Matrix formulation:
A=[cosθ−sinθsinθcosθ]Matrix derivation:
There is a requisite diagram for understanding this which is coming soon…
→a=(xa,ya)
→b=(xb,yb)
→b is →a rotated by θ
→a makes angle α with the x-axis and its length is r=x2a+y2a
Therefore:
xa=r∗cosα
ya=r∗sinα
And:
xb=r∗cos(α+θ)
yb=r∗sin(α+θ)
Using trigonometric relationships:
sin(A+B)=sin(A)∗cos(B)+sin(B)∗cos(A)
cos(A+B)=cos(A)∗cos(B)−sin(B)∗sin(A)
Thus:
xb=r∗cos(α)∗cos(θ)−r∗sin(α)∗sin(θ)
yb=r∗sin(α)∗cos(θ)+r∗cos(α)∗sin(θ)
Substituting the equations for xa and ya:
xb=xa∗cos(θ)−ya∗sin(θ)
yb=ya∗cos(θ)+xa∗sin(θ)
And the transformation matrix is revealed.