Using Transformation Matrices

Using Transformation Matrices

Understanding Transformation Matrices

  • A transformation matrix is a special square matrix used to represent linear transformations.
  • This transformation could be any operation that alters the position, orientation or size of the object, such as translations, rotations and scaling.
  • Every transformation matrix has a size of 2x2 or 3x3, depending on whether the transformation is in 2D or 3D.
  • A transformation is applied to a vector or point by multiplying the transformation matrix with the vector.

Types of Transformation Matrices

  • Identity Matrix: The identity matrix, denoted as I, leaves a vector unchanged when multiplied with it.
  • Translation Matrix: This matrix is used for translating (moving) a point in 2D or 3D space. Note: Translation cannot be represented using a 2x2 or 3x3 matrix only. An extra dimension must be added for the movement.
  • Scaling Matrix: This matrix is used to increase or decrease the size of an object. The diagonal elements of a scaling matrix define the scaling factor in each dimension.
  • Rotation Matrix: A rotation matrix rotates a vector around the origin. The angle of rotation is determined by the values of the matrix.

Using Transformation Matrices

  • To apply a transformation to a point or vector, multiply the transformation matrix by the vector. Remember that matrix multiplication is not commutative - the order of multiplication matters.
  • Combine transformations by multiplying their matrices together. The resulting matrix represents the combined transformation.
  • When multiple transformations are applied, they are performed in the reverse order of multiplication. This is due to the non-commutative property of matrix multiplication.
  • Inverse of a transformation matrix undoes the transformation. Multiplying a matrix by its inverse will yield the identity matrix.

Key Properties of Transformation Matrices

  • Transformation matrices preserve vector addition and scalar multiplication.
  • The determinant of a rotation matrix is always 1 and its inverse is its transpose.
  • The determinant of an identity matrix is always 1.
  • Transformation matrices are linear. This means the transformation of a sum of vectors is the sum of their transformations, and the transformation of a scalar multiplication of a vector is the scalar multiplication of the transformed vector.