On transforms and planes.

If we want to transform a line or plane using an affine transformation…

Given a transformation matrix in let’s say, two dimensions:

We notice that the origin:

always transforms to itself. That is to say that a standard transformation matrix cannot encode a translation without help. We can add a translation term to make this happen:

Which is essentially equivalent to:

Which we will write from now on as:

This is the basis of the affine transform. Adding that extra 1 to the end of our coordinates makes them homogeneous coordinates. For most intents and purposes, we can ignore it.

The general equation of a line in two dimensions is given by a set of points x and y satisfying the equation ax+by+c=0. This is usually better than it’s simpler cousin y=mx+c, because that structure has trouble representing vertical lines. This formula can be written as:

or simply

where [a b] happens to be a vector perpendicular to the line. In order to transform a line using an affine transform matrix so that nv=0 and n′v′=0 where v′=Tv, the transformed points must satisfy the following equation:

Which implies that

If we consider that n is a normal for a line in 2d space, or plane in 3d space, we can use it to transform a plane using an affine transform and back again. by converting it into a row vector and pre-multiplying it by the inverse of the transformation matrix. This is useful when trying to render scenes using raytracing and constructive solid geometry.



The stories I write are a part of a learning journey through life, logic and programming. Share this journey with me.

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store