Processing math: 100%

Lecture 8: Coordinate Transformations

Basics

Multiplying a matrix by a vector allows us to produce a new, changed vectors.

Av=[a1,1a1,2a2,1a2,2][xy]
=[a1,1x+a1,2ya2,1x+a2,2y]

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=rcosα
ya=rsinα

And:

xb=rcos(α+θ)
yb=rsin(α+θ)

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=rcos(α)cos(θ)rsin(α)sin(θ)
yb=rsin(α)cos(θ)+rcos(α)sin(θ)

Substituting the equations for xa and ya:

xb=xacos(θ)yasin(θ)
yb=yacos(θ)+xasin(θ)

And the transformation matrix is revealed.