Linear Algebra

Geometry of Matrix Operators on \(R^2\)

Imron Rosyadi

4.11 Geometry of Matrix Operators on \(R^{2}\)

In applications such as computer graphics, it is important to understand not only how linear operators on \(R^{2}\) and \(R^{3}\) affect individual vectors but also how they affect two-dimensional or three-dimensional regions. This is the focus of this section.

Transformations of Regions

Matrix operators can transform entire regions, a concept crucial in computer graphics and games. The perception of motion in computer games is often created by rapidly transforming arrays of pixels using matrices.

The original image below was digitized into a rectangular array of pixels. The coordinates of these pixels were then transformed by matrix multiplication. The pixels were then assigned their original gray levels to produce the transformed picture.

Figure 4.11.1: Einstein transformed by matrix operators.

Images of Lines Under Matrix Operators

The effect of a matrix operator on \(R^{2}\) can be understood by studying its transformation of basic geometric shapes like the unit square. For invertible operators, line segments are mapped to line segments, and the edges of a shape are mapped to the edges of its image.

Figure 4.11.2: Unit square and its transformed image.

Images of Lines Under Matrix Operators

THEOREM 4.11.1 If \(T\colon R^{2}\to R^{2}\) is multiplication by an invertible matrix, then:

  1. The image of a straight line is a straight line.
  2. The image of a line through the origin is a line through the origin.
  3. The images of parallel lines are parallel lines.
  4. The image of the line segment joining points \(P\) and \(Q\) is the line segment joining the images of \(P\) and \(Q\).
  5. The images of three points lie on a line if and only if the points themselves lie on a line.

EXAMPLE 1: Image of a Line

Problem: The invertible matrix \(A = \left[ \begin{array}{ll}3 & 1 \\ 2 & 1 \end{array} \right]\) maps the line \(y = 2x + 1\) into another line. Find its equation.

Solution:

Let \((x,y)\) be a point on the line \(y = 2x + 1\), and let \((x^{\prime},y^{\prime})\) be its image under multiplication by \(A\).

\[ {\left[ \begin{array}{l}{x^{\prime}}\\ {y^{\prime}} \end{array} \right]} = {\left[ \begin{array}{l l}{3} & {1}\\ {2} & {1} \end{array} \right]}{\left[ \begin{array}{l}{x}\\ {y} \end{array} \right]} \]

To find \((x,y)\) in terms of \((x',y')\), we use \(A^{-1}\):

\[ {\left[ \begin{array}{l}{x}\\ {y} \end{array} \right]} = {\left[ \begin{array}{l l}{3} & {1}\\ {2} & {1} \end{array} \right]}^{-1}{\left[ \begin{array}{l}{x^{\prime}}\\ {y^{\prime}} \end{array} \right]} = {\left[ \begin{array}{l l}{1} & {-1}\\ {-2} & {3} \end{array} \right]}{\left[ \begin{array}{l}{x^{\prime}}\\ {y^{\prime}} \end{array} \right]} \]

So, \(x = x^{\prime} - y^{\prime}\) and \(y = -2x^{\prime} + 3y^{\prime}\).

Substituting these into \(y = 2x + 1\):

\[ -2x^{\prime} + 3y^{\prime} = 2(x^{\prime} - y^{\prime}) + 1 \]

Simplifying, we get the equation of the transformed line:

\[ y^{\prime} = \frac{4}{5} x^{\prime} + \frac{1}{5} \]

EXAMPLE 1: Image of a Line (Interactive)

Visualize the transformation of the line \(y = 2x + 1\) by matrix \(A = \left[ \begin{array}{ll}3 & 1 \\ 2 & 1 \end{array} \right]\).

Tip

Try it! Observe how the matrix \(A\) maps points from the original line to the transformed line. The linear nature of the transformation ensures the image is also a straight line.

EXAMPLE 2: Transformation of the Unit Square

Problem: Sketch the image of the unit square under multiplication by the invertible matrix \(A = \left[ \begin{array}{ll}0 & 1 \\ 2 & 1 \end{array} \right]\). Label the vertices of the image with their coordinates.

Solution:

The unit square has vertices \((0,0)\), \((1,0)\), \((0,1)\), and \((1,1)\).
We apply the matrix \(A\) to each vertex:

\[ \left[ \begin{array}{ll}0 & 1 \\ 2 & 1 \end{array} \right]\left[ \begin{array}{l}0 \\ 0 \end{array} \right] = \left[ \begin{array}{l}0 \\ 0 \end{array} \right] \]

\[ \left[ \begin{array}{ll}0 & 1 \\ 2 & 1 \end{array} \right]\left[ \begin{array}{l}1 \\ 0 \end{array} \right] = \left[ \begin{array}{l}0 \\ 2 \end{array} \right] \]

\[ \left[ \begin{array}{ll}0 & 1 \\ 2 & 1 \end{array} \right]\left[ \begin{array}{l}0 \\ 1 \end{array} \right] = \left[ \begin{array}{l}1 \\ 1 \end{array} \right] \]

\[ \left[ \begin{array}{ll}0 & 1 \\ 2 & 1 \end{array} \right]\left[ \begin{array}{l}1 \\ 1 \end{array} \right] = \left[ \begin{array}{l}1 \\ 3 \end{array} \right] \]

The image of the unit square is a parallelogram with vertices \((0,0)\), \((0,2)\), \((1,1)\), and \((1,3)\).

EXAMPLE 2: Transformation of the Unit Square

Figure 4.11.3: Transformed unit square.

EXAMPLE 2: Transformation of the Unit Square (Interactive)

Visualize the transformation of the unit square by a custom 2x2 matrix.

Composition of Matrix Operators

Linear transformations can be applied sequentially, one after another.
This is represented by matrix multiplication.
The order of operations matters! \(A_1 A_2\) is generally not the same as \(A_2 A_1\).

Important

Matrix Multiplication is Not Commutative!

Applying transformations in a different order often leads to different results.

EXAMPLE 3: Shear then Reflect vs. Reflect then Shear

Problem:

  1. Find the standard matrix for the operator that first shears by a factor of 2 in the \(x\)-direction and then reflects about the line \(y = x\).
  2. Find the standard matrix for the operator that first reflects about \(y = x\) and then shears by a factor of 2 in the \(x\)-direction.
  3. Confirm that the shear and the reflection do not commute.

Standard Matrices:

Shear (\(k=2\) in x-direction): \(A_{1} = \left[ \begin{array}{cc}1 & 2 \\ 0 & 1 \end{array} \right]\)

Reflection (about \(y=x\)): \(A_{2} = \left[ \begin{array}{cc}0 & 1 \\ 1 & 0 \end{array} \right]\)

EXAMPLE 3(a): Shear then Reflect (Theory)

Sequence: Shear by factor 2 in x-direction, then reflect about \(y=x\). This corresponds to the matrix product \(A_2 A_1\).

\[ A_{2}A_{1} = \left[ \begin{array}{cc}0 & 1 \\ 1 & 0 \end{array} \right]\left[ \begin{array}{cc}1 & 2 \\ 0 & 1 \end{array} \right] = \left[ \begin{array}{cc}0 \cdot 1 + 1 \cdot 0 & 0 \cdot 2 + 1 \cdot 1 \\ 1 \cdot 1 + 0 \cdot 0 & 1 \cdot 2 + 0 \cdot 1 \end{array} \right] = \left[ \begin{array}{cc}0 & 1 \\ 1 & 2 \end{array} \right] \]

Shear in the \(x\)-direction by \(k=2\).

Followed by Reflection about \(y=x\).

EXAMPLE 3(b): Reflect then Shear (Theory)

Sequence: Reflect about \(y=x\), then shear by factor 2 in x-direction. This corresponds to the matrix product \(A_1 A_2\).

\[ A_{1}A_{2} = \left[ \begin{array}{cc}1 & 2 \\ 0 & 1 \end{array} \right]\left[ \begin{array}{cc}0 & 1 \\ 1 & 0 \end{array} \right] = \left[ \begin{array}{cc}1 \cdot 0 + 2 \cdot 1 & 1 \cdot 1 + 2 \cdot 0 \\ 0 \cdot 0 + 1 \cdot 1 & 0 \cdot 1 + 1 \cdot 0 \end{array} \right] = \left[ \begin{array}{cc}2 & 1 \\ 1 & 0 \end{array} \right] \]

Reflection about \(y=x\).

Followed by Shear in the \(x\)-direction by \(k=2\).

EXAMPLE 3(c): Non-Commutativity (Interactive)

Observe the different outcomes when applying transformations in different orders.

Geometry of Invertible Matrix Operators

Any \(2 \times 2\) invertible matrix can be decomposed into a product of simpler transformations. This allows us to understand complex transformations as a sequence of basic geometric operations.

Table 1: Common 2D Linear Operators and Their Standard Matrices

Operator Standard Matrix
Reflection about the y-axis \(\left[ \begin{array}{rr}-1 & 0 \\ 0 & 1 \end{array} \right]\)
Reflection about the x-axis \(\left[ \begin{array}{rr}1 & 0 \\ 0 & -1 \end{array} \right]\)
Reflection about the line \(y = x\) \(\left[ \begin{array}{rr}0 & 1 \\ 1 & 0 \end{array} \right]\)
Rotation about origin (angle \(\theta\)) \(\left[ \begin{array}{rr}\cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{array} \right]\)
Compression in x-dir (factor \(k\), \(0 < k < 1\)) \(\left[ \begin{array}{rr}k & 0 \\ 0 & 1 \end{array} \right]\)
Compression in y-dir (factor \(k\), \(0 < k < 1\)) \(\left[ \begin{array}{rr}1 & 0 \\ 0 & k \end{array} \right]\)
Expansion in x-dir (factor \(k\), \(k > 1\)) \(\left[ \begin{array}{rr}k & 0 \\ 0 & 1 \end{array} \right]\)
Expansion in y-dir (factor \(k\), \(k > 1\)) \(\left[ \begin{array}{rr}1 & 0 \\ 0 & k \end{array} \right]\)
Shear in x-dir (factor \(k\)) \(\left[ \begin{array}{rr}1 & k \\ 0 & 1 \end{array} \right]\)
Shear in y-dir (factor \(k\)) \(\left[ \begin{array}{rr}1 & 0 \\ k & 1 \end{array} \right]\)

Theorem 4.11.2: Elementary Matrices

An elementary matrix represents a single elementary row operation on the identity matrix. Each \(2 \times 2\) elementary matrix corresponds to one of the following geometric transformations:

  1. A shear along a coordinate axis.
  2. A reflection about \(y = x\).
  3. A compression along a coordinate axis.
  4. An expansion along a coordinate axis.
  5. A reflection about a coordinate axis.
  6. A compression or expansion along a coordinate axis followed by a reflection about a coordinate axis.

Note

Proof Idea: The proof involves examining the forms of \(2 \times 2\) elementary matrices: \[ {\left[\begin{array}{l l}{1}&{0}\\ {k}&{1}\end{array}\right]},\quad{\left[\begin{array}{l l}{1}&{k}\\ {0}&{1}\end{array}\right]},\quad{\left[\begin{array}{l l}{0}&{1}\\ {1}&{0}\end{array}\right]},\quad{\left[\begin{array}{l l}{k}&{0}\\ {0}&{1}\end{array}\right]},\quad{\left[\begin{array}{l l}{1}&{0}\\ {0}&{k}\end{array}\right]} \] Each of these directly corresponds to one of the transformations listed. For \(k < 0\), matrices like \(\left[\begin{array}{ll}k & 0 \\ 0 & 1 \end{array}\right]\) can be factored into a scaling and a reflection, e.g., \(\left[\begin{array}{ll}-1 & 0 \\ 0 & 1 \end{array}\right] \left[\begin{array}{ll}|k| & 0 \\ 0 & 1 \end{array}\right]\).

Theorem 4.11.3: General Decomposition

Since any invertible matrix can be expressed as a product of elementary matrices (Theorem 4.10.2(d)), we can conclude:

THEOREM 4.11.3 If \(T_{A}\colon R^{2}\to R^{2}\) is multiplication by an invertible matrix \(A\), then the geometric effect of \(T_{A}\) is the same as an appropriate succession of shears, compressions, expansions, and reflections.

Important

This theorem is fundamental! It means that even the most complex 2D linear transformations can be broken down into a sequence of very simple, understandable geometric operations. This is incredibly useful for analysis and design in ECE fields like computer graphics and control systems.

EXAMPLE 4: Decomposing a Matrix Operator

Problem: Express \(A={\left[\begin{array}{l l}{0}&{1}\\ {2}&{1}\end{array}\right]}\) as a product of elementary matrices, and then describe its geometric effect.

Solution: We reduce \(A\) to the identity matrix using row operations:

\[ {\left[\begin{array}{l l}{0}&{1}\\ {2}&{1}\end{array}\right]} \xrightarrow{\text{Interchange R1, R2}} {\left[\begin{array}{l l}{2}&{1}\\ {0}&{1}\end{array}\right]} \xrightarrow{\text{R1} \to \frac{1}{2}\text{R1}} {\left[\begin{array}{l l}{1}&{{\frac{1}{2}}}\\ {0}&{1}\end{array}\right]} \xrightarrow{\text{R1} \to \text{R1} - \frac{1}{2}\text{R2}} {\left[\begin{array}{l l}{1}&{0}\\ {0}&{1}\end{array}\right]} \]

These operations correspond to left-multiplication by elementary matrices: 1. Interchange R1, R2: \(E_{1}={\left[\begin{array}{l l}{0}&{1}\\ {1}&{0}\end{array}\right]}\) 2. R1 \(\to \frac{1}{2}\)R1: \(E_{2}={\left[\begin{array}{l l}{\frac{1}{2}}&{0}\\ {0}&{1}\end{array}\right]}\) 3. R1 \(\to\) R1 - \(\frac{1}{2}\)R2: \(E_{3}={\left[\begin{array}{l l}{1}&{-\frac{1}{2}}\\ {0}&{1}\end{array}\right]}\)

EXAMPLE 4: Decomposing a Matrix Operator

So, \(E_3 E_2 E_1 A = I\). This means \(A = E_1^{-1} E_2^{-1} E_3^{-1}\). The inverse elementary matrices are: \(E_{1}^{-1}={\left[\begin{array}{l l}{0}&{1}\\ {1}&{0}\end{array}\right]}\) (Interchange R1, R2) \(E_{2}^{-1}={\left[\begin{array}{l l}{2}&{0}\\ {0}&{1}\end{array}\right]}\) (Multiply R1 by 2) \(E_{3}^{-1}={\left[\begin{array}{l l}{1}&{\frac{1}{2}}\\ {0}&{1}\end{array}\right]}\) (Add \(\frac{1}{2}\)R2 to R1)

Thus, \(A = {\left[\begin{array}{l l}{0}&{1}\\ {1}&{0}\end{array}\right]}{\left[\begin{array}{l l}{2}&{0}\\ {0}&{1}\end{array}\right]}{\left[\begin{array}{l l}{1}&{\frac{1}{2}}\\ {0}&{1}\end{array}\right]}\).

EXAMPLE 4: Decomposing a Matrix Operator (Geometric Interpretation)

Reading the product \(A = E_{1}^{-1} E_{2}^{-1} E_{3}^{-1}\) from right to left, the geometric effect of multiplying by \(A\) is equivalent to successively:

  1. Shearing by a factor of \(\frac{1}{2}\) in the \(x\)-direction (from \(E_3^{-1}\)). Standard matrix for shear in x-direction: \(\left[ \begin{array}{cc}1 & k \\ 0 & 1 \end{array} \right]\). Here \(k = 1/2\).
  2. Expanding by a factor of 2 in the \(x\)-direction (from \(E_2^{-1}\)). Standard matrix for expansion in x-direction: \(\left[ \begin{array}{cc}k & 0 \\ 0 & 1 \end{array} \right]\). Here \(k=2\).
  3. Reflecting about the line \(y = x\) (from \(E_1^{-1}\)). Standard matrix for reflection about \(y=x\): \(\left[ \begin{array}{cc}0 & 1 \\ 1 & 0 \end{array} \right]\).

This sequence of transformations results in the same final image as direct multiplication by \(A\).

Figure 4.11.6: Sequential transformations of the unit square.

EXAMPLE 4: Interactive Decomposition

Input a 2x2 invertible matrix and see its decomposition into elementary geometric transformations.

EXAMPLE 5: Transformations with Diagonal Matrices

Problem: Discuss the geometric effect on the unit square of multiplication by a diagonal matrix \(A = \left[ \begin{array}{cc}k_{1} & 0 \\ 0 & k_{2} \end{array} \right]\) where \(k_1, k_2 > 0\) and \(k_1, k_2 \neq 1\).

Solution: The matrix \(A\) can be expressed as a product of two simpler diagonal matrices:

\[ A = \left[ \begin{array}{cc}k_{1} & 0 \\ 0 & k_{2} \end{array} \right] = \left[ \begin{array}{cc}1 & 0 \\ 0 & k_{2} \end{array} \right]\left[ \begin{array}{cc}k_{1} & 0 \\ 0 & 1 \end{array} \right] \]

Reading from right to left:

  1. Compression or Expansion in the \(x\)-direction by a factor of \(k_1\). (The matrix \(\left[ \begin{array}{cc}k_{1} & 0 \\ 0 & 1 \end{array} \right]\)).
  2. Compression or Expansion in the \(y\)-direction by a factor of \(k_2\). (The matrix \(\left[ \begin{array}{cc}1 & 0 \\ 0 & k_{2} \end{array} \right]\)).

This means a diagonal matrix scales the object independently along the x and y axes.

EXAMPLE 5: Transformations with Diagonal Matrices (Interactive)

Adjust the scaling factors \(k_1\) and \(k_2\) to observe their effect on the unit square.

EXAMPLE 6: Reflection About the Origin

Problem: Discuss the geometric effect of multiplication by \(A = \left[ \begin{array}{rr} - 1 & 0 \\ 0 & -1 \end{array} \right]\).

Solution:

This matrix reflects the unit square about the origin, sending \((x,y)\) to \((-x,-y)\).

Alternatively, it can be decomposed:

\[ A = \left[ \begin{array}{rr} - 1 & 0 \\ 0 & -1 \end{array} \right] = \left[ \begin{array}{rr} - 1 & 0 \\ 0 & 1 \end{array} \right]\left[ \begin{array}{rr}1 & 0 \\ 0 & -1 \end{array} \right] \]

Reading from right to left:

  1. Reflection about the \(x\)-axis (from \(\left[ \begin{array}{rr}1 & 0 \\ 0 & -1 \end{array} \right]\)).
  2. Reflection about the \(y\)-axis (from \(\left[ \begin{array}{rr}-1 & 0 \\ 0 & 1 \end{array} \right]\)).

So, a reflection about the origin is equivalent to successive reflections about the x-axis and y-axis.

EXAMPLE 6: Reflection About the Origin

Figure 4.11.7: Reflection about the origin.

EXAMPLE 6: Reflection About the Origin (Interactive)

Observe the direct reflection about the origin and its decomposition.

EXAMPLE 7: Reflection About the Line \(y = -x\)

Problem: Verify that multiplication by \(A = \left[ \begin{array}{rr}0 & -1 \\ -1 & 0 \end{array} \right]\) reflects the unit square about the line \(y = -x\).

Solution: Let \((x,y)\) be a point. The transformation maps it to \((x', y')\):

\[ \left[ \begin{array}{l}{x^{\prime}}\\ {y^{\prime}} \end{array} \right] = \left[ \begin{array}{rr}0 & -1 \\ -1 & 0 \end{array} \right]\left[ \begin{array}{l}{x}\\ {y} \end{array} \right] = \left[ \begin{array}{l}{-y}\\ {-x} \end{array} \right] \]

So \((x,y)\) is mapped to \((-y, -x)\). If a point \((x,y)\) is on the line \(y=-x\), then \(y=-x \implies x=-y\). The transformed point is \((-(-x), -x) = (x, -x)\). Since \(-x = y\), the transformed point is \((x, y)\). This means points on the line \(y=-x\) are fixed, which is characteristic of a reflection.

EXAMPLE 7: Reflection About the Line \(y = -x\)

Figure 4.11.8: Reflection about the line \(y=-x\).

EXAMPLE 7: Reflection About the Line \(y = -x\) (Interactive)

Visualize the reflection of the unit square about the line \(y = -x\).

Summary & ECE Applications

Key Takeaways:

  • Matrix operators transform geometric regions in \(R^2\).
  • Invertible matrices preserve properties of lines and line segments.
  • Complex transformations can be decomposed into a sequence of elementary operations (shears, compressions, expansions, reflections).
  • The order of matrix operations matters (non-commutative).

ECE Applications:

  • Computer Graphics: 2D/3D transformations (scaling, rotation, translation, projection).
  • Image Processing: Image resizing, rotation, warping, feature extraction.
  • Robotics: Kinematics (describing robot arm movements) and inverse kinematics.
  • Control Systems: State-space representation, system stability analysis.
  • Signal Processing: Filtering and transformation of signals.

Tip

Understanding the geometric interpretation of matrix operations provides intuition for how linear systems behave in various engineering contexts.