Geometric transformations are an example of a mapping used to manipulate vectors in space. They are typically used to do things like rotate, scale, and translate vectors across the space they occupy. Geometric transformations come up frequently in computer graphics, as well as physics and other branches of math.
We will first take a look at rotations to see how we can derive a function that rotates a vector by an angle . To start, let’s take a look at what a rotation does in space.
In the x-direction, we can represent our rotated coordinate as: . Similarly, in the y-direction, we can represent our rotated coordinate as: . If we combine the two components, we will get a matrix that will rotate any vector. This means that our rotation function can be written as:
Example: Rotate the vector with
To do this, we apply the same idea as our matrix mappings. We substitute theta into our rotation matrix, and multiply it by the vector we want to rotate. Doing so gives us the following:
We can further extend the idea of rotations into space by slightly modifying the rotational matrix to account for the extra dimension. In , the rotational matrix is defined as follows:
Our matrix is designed to rotate on the x and y coordinates, which is why the third column is set as the identity, . Aside from this, our matrix looks much the same as the matrix.
Similar to rotation, we can also stretch, contract, and dilate vectors. A stretch will modify the first component, but leave the second component unchanged. To do this, we can use the following matrix: . If t < 1, we typically refer to this as a shrink, and if t > 1, we refer to this as a stretch.
Contractions and dilations are similar to stretches and shrinks, but they affect both components of the target vector. Due to this, the matrix ends up looking similar to the stretch, however both components are t. This gives us . If 0 < t < 1, the transformation is called a contraction. Otherwise, it is called a dilation.
A shear is a type of linear transformation that deforms a shape, in a similar way to translating a rectangle into a parallelogram. The matrix for this deformation looks like .
Finally, vectors can be reflected over the x and y axis using matrix transformations. If we are mirroring on the x axis, we use . If we are mirroring on the y axis, we use
In general, geometric translations are an important application of matrix mappings. If you continue in computer programming, you will often see these types of translations used for graphics, especially in game engines. Aside from programming, Physics often uses these types of translations for vectors that appear in problems.