Linear Algebra

1.8 Matrix Transformations

Imron Rosyadi

Linear Algebra in ECE

1.8 Matrix Transformations

Imron Rosyadi



Understanding how matrices elegantly represent geometric and algebraic transformations, crucial for engineering applications.

Introduction: Vectors in \(R^n\)

  • An ordered \(n\)-tuple of real numbers can be seen as a vector.
    • Example: \((s_1, s_2, \ldots, s_n)\)
  • The set of all ordered \(n\)-tuples forms the space \(R^n\).
  • We primarily use column vector form: \[ \mathbf{x} = \left[ \begin{array}{c}s_{1} \\ s_{2} \\ \vdots \\ s_{n} \end{array} \right] \]

Introduction: Vectors in \(R^n\)

  • Standard Basis Vectors for \(R^n\): \(\mathbf{e}_1, \mathbf{e}_2, \ldots, \mathbf{e}_n\).
    • \(\mathbf{e}_i\) has a 1 in the \(i\)-th position and zeros elsewhere.
    • Any vector \(\mathbf{x}\) in \(R^n\) can be uniquely written as: \[ \mathbf{x} = x_{1} \mathbf{e}_{1} + x_{2} \mathbf{e}_{2} + \dots + x_{n} \mathbf{e}_{n} \] For example, in \(R^3\): \(\mathbf{e}_1 = \left[ \begin{smallmatrix} 1 \\ 0 \\ 0 \end{smallmatrix} \right]\), \(\mathbf{e}_2 = \left[ \begin{smallmatrix} 0 \\ 1 \\ 0 \end{smallmatrix} \right]\), \(\mathbf{e}_3 = \left[ \begin{smallmatrix} 0 \\ 0 \\ 1 \end{smallmatrix} \right]\).

Functions and Transformations

Recall that a function is a rule that associates each element of a set A (the domain) with exactly one element in a set B (the codomain). The set of all possible output elements is called the range.

Domain A

If a function \(f\) maps from \(R^n\) to \(R^m\), we call \(f\) a transformation from \(R^n\) to \(R^m\), denoted \(f: R^n \to R^m\). If \(m=n\), it’s sometimes called an operator on \(R^n\).

Matrix Transformations: The Core Idea

A matrix transformation is a transformation from \(R^n\) to \(R^m\) that arises from matrix multiplication.

Consider a system of linear equations: \[ \begin{array}{l}w_{1} = a_{11}x_{1} + a_{12}x_{2} + \dots + a_{1n}x_{n} \\ w_{2} = a_{21}x_{1} + a_{22}x_{2} + \dots + a_{2n}x_{n} \\ \vdots \qquad \vdots \qquad \vdots \qquad \vdots \\ w_{m} = a_{m1}x_{1} + a_{m2}x_{2} + \dots + a_{mn}x_{n} \end{array} \] This can be written in matrix notation as \(\mathbf{w} = A\mathbf{x}\), where: \[ \left[ \begin{array}{c}w_{1} \\ w_{2} \\ \vdots \\ w_{m} \end{array} \right] = \left[ \begin{array}{cccc}a_{11} & a_{12} & \dots & a_{1n} \\ a_{21} & a_{22} & \dots & a_{2n} \\ \vdots & \vdots & & \vdots \\ a_{m1} & a_{m2} & \dots & a_{mn} \end{array} \right]\left[ \begin{array}{c}x_{1} \\ x_{2} \\ \vdots \\ x_{n} \end{array} \right] \]

Matrix Transformations: The Core Idea

We view this as a transformation \(T_A: R^n \to R^m\) such that \(T_A(\mathbf{x}) = A\mathbf{x}\).

TA: Rn to Rm

Example 1: A Matrix Transformation from \(R^4\) to \(R^3\)

Consider the transformation defined by: \[ \begin{array}{l}w_{1} = 2x_{1} - 3x_{2} + x_{3} - 5x_{4} \\ w_{2} = 4x_{1} + x_{2} - 2x_{3} + x_{4} \\ w_{3} = 5x_{1} - x_{2} + 4x_{3} \end{array} \]

Example 1: A Matrix Transformation from \(R^4\) to \(R^3\)

This transformation maps vectors from \(R^4\) to \(R^3\). Its matrix form is \(\mathbf{w} = A\mathbf{x}\): \[ \left[ \begin{array}{c}w_{1} \\ w_{2} \\ w_{3} \end{array} \right] = \left[ \begin{array}{cccc}2 & -3 & 1 & -5 \\ 4 & 1 & -2 & 1 \\ 5 & -1 & 4 & 0 \end{array} \right]\left[ \begin{array}{c}x_{1} \\ x_{2} \\ x_{3} \\ x_{4} \end{array} \right] \] So, the transformation matrix is \(A = \left[ \begin{array}{cccc}2 & -3 & 1 & -5 \\ 4 & 1 & -2 & 1 \\ 5 & -1 & 4 & 0 \end{array} \right]\).

Let’s find the image of \(\mathbf{x} = \left[ \begin{smallmatrix} 1 \\ -3 \\ 0 \\ 2 \end{smallmatrix} \right]\) under \(T_A\).

Example 1: Python Calculation

Compute \(T_A(\mathbf{x}) = A\mathbf{x}\) for the given \(A\) and \(\mathbf{x}\).

The image of \(\mathbf{x}\) is \(\mathbf{w} = \left[ \begin{smallmatrix} 1 \\ 3 \\ 8 \end{smallmatrix} \right]\).

Special Matrix Transformations

  • Zero Transformation (\(T_0: R^n \to R^m\)): If \(0\) is the \(m \times n\) zero matrix, then \(T_0(\mathbf{x}) = 0\mathbf{x} = \mathbf{0}\). (Maps every vector in \(R^n\) to the zero vector in \(R^m\).)
  • Identity Operator (\(T_I: R^n \to R^n\)): If \(I\) is the \(n \times n\) identity matrix, then \(T_I(\mathbf{x}) = I\mathbf{x} = \mathbf{x}\). (Maps every vector in \(R^n\) to itself.)

Properties of Matrix Transformations (Theorem 1.8.1)

For every matrix \(A\), the matrix transformation \(T_A: R^n \to R^m\) has the following properties:

  1. \(T_A(\mathbf{0}) = \mathbf{0}\)
  2. \(T_A(k\mathbf{u}) = kT_A(\mathbf{u})\) (Homogeneity property)
  3. \(T_A(\mathbf{u} + \mathbf{v}) = T_A(\mathbf{u}) + T_A(\mathbf{v})\) (Additivity property)
  4. \(T_A(\mathbf{u} - \mathbf{v}) = T_A(\mathbf{u}) - T_A(\mathbf{v})\)

These properties are direct consequences of matrix arithmetic axioms. Collectively, properties (b) and (c) are known as linearity conditions. They imply that matrix transformations preserve linear combinations: \[ T_A(k_1\mathbf{u}_1 + \dots + k_r\mathbf{u}_r) = k_1T_A(\mathbf{u}_1) + \dots + k_rT_A(\mathbf{u}_r) \]

Linear Transformations Defined

Not all transformations are matrix transformations. For example, \(w_1 = x_1^2 + x_2^2\) is not. This leads to two crucial questions:

  1. How do we know if a transformation \(T: R^n \to R^m\) is a matrix transformation?
  2. If it is, how do we find its unique matrix?

THEOREM 1.8.2: A transformation \(T: R^n \to R^m\) is a matrix transformation if and only if it satisfies the following linearity conditions:
(i) \(T(\mathbf{u} + \mathbf{v}) = T(\mathbf{u}) + T(\mathbf{v})\) (Additivity)
(ii) \(T(k\mathbf{u}) = k T(\mathbf{u})\) (Homogeneity)

THEOREM 1.8.3:
Every linear transformation from \(R^n\) to \(R^m\) is a matrix transformation, and conversely, every matrix transformation from \(R^n\) to \(R^m\) is a linear transformation.

Geometric Interpretation (Mapping Points)

Mapping Points Rn to Rm

A matrix transformation \(T_A: R^n \to R^m\) maps each vector (point) in \(R^n\) into a vector (point) in \(R^m\). This is the basis of transformations in computer graphics and robotics.

Uniqueness of the Standard Matrix (Theorem 1.8.4)

If \(T_A: R^n \to R^m\) and \(T_B: R^n \to R^m\) are matrix transformations, and if \(T_A(\mathbf{x}) = T_B(\mathbf{x})\) for every vector \(\mathbf{x}\) in \(R^n\), then \(A = B\).

Significance: There is a one-to-one correspondence between linear transformations from \(R^n\) to \(R^m\) and \(m \times n\) matrices. Every such linear transformation arises from exactly one \(m \times n\) matrix. This matrix is known as the standard matrix for the transformation.

Procedure for Finding Standard Matrices

To find the standard matrix \(A\) for a linear transformation \(T: R^n \to R^m\):

Step 1: Find the images of the standard basis vectors for \(R^n\): \(T(\mathbf{e}_1), T(\mathbf{e}_2), \ldots, T(\mathbf{e}_n)\).

Recall $\mathbf{e}_1 = \left[\begin{smallmatrix} 1 \\ 0 \\ \vdots \\ 0 \end{smallmatrix}\right], \ldots, \mathbf{e}_n = \left[\begin{smallmatrix} 0 \\ \vdots \\ 0 \\ 1 \end{smallmatrix}\right]$. These vectors are from $R^n$. The images $T(\mathbf{e}_i)$ will be vectors in $R^m$.

Step 2: Construct the matrix \(A\) that has these images as its successive columns: \[ A = [T(\mathbf{e}_1) \mid T(\mathbf{e}_2) \mid \dots \mid T(\mathbf{e}_n)] \] This matrix \(A\) is the standard matrix for \(T\).

Example 4: Finding a Standard Matrix

Find the standard matrix \(A\) for the linear transformation \(T: R^2 \to R^3\) defined by: \[ T\left(\left[ \begin{array}{c}{x_{1}}\\ {x_{2}} \end{array} \right]\right) = \left[ \begin{array}{c}{2x_{1} + x_{2}}\\ {x_{1} - 3x_{2}}\\ {-x_{1} + x_{2}} \end{array} \right] \]

Example 4: Finding a Standard Matrix

Step 1: Find images of standard basis vectors for \(R^2\). \(\mathbf{e}_1 = \left[ \begin{smallmatrix} 1 \\ 0 \end{smallmatrix} \right]\) and \(\mathbf{e}_2 = \left[ \begin{smallmatrix} 0 \\ 1 \end{smallmatrix} \right]\).

\(T(\mathbf{e}_1) = T\left(\left[ \begin{smallmatrix} 1 \\ 0 \end{smallmatrix} \right]\right) = \left[ \begin{array}{c}{2(1) + 0}\\ {1 - 3(0)}\\ {-1 + 0} \end{array} \right] = \left[ \begin{array}{r}{2}\\ {1}\\ {-1} \end{array} \right]\) \(T(\mathbf{e}_2) = T\left(\left[ \begin{smallmatrix} 0 \\ 1 \end{smallmatrix} \right]\right) = \left[ \begin{array}{c}{2(0) + 1}\\ {0 - 3(1)}\\ {-0 + 1} \end{array} \right] = \left[ \begin{array}{r}{1}\\ {-3}\\ {1} \end{array} \right]\)

Step 2: Construct the standard matrix A. \(A = [T(\mathbf{e}_1) \mid T(\mathbf{e}_2)]\) \[ A = \left[ \begin{array}{rr}{2} & {1}\\ {1} & {-3}\\ {-1} & {1} \end{array} \right] \]

Example 5: Computing with Standard Matrices

For the linear transformation in Example 4, use the standard matrix \(A\) to find \(T\left(\left[ \begin{smallmatrix} 1 \\ 4 \end{smallmatrix} \right]\right)\).

The standard matrix is \(A = \left[ \begin{array}{rr}{2} & {1}\\ {1} & {-3}\\ {-1} & {1} \end{array} \right]\). Let \(\mathbf{x} = \left[ \begin{smallmatrix} 1 \\ 4 \end{smallmatrix} \right]\).

The transformation is multiplication by \(A\), so \(T(\mathbf{x}) = A\mathbf{x}\).

The image is \(T\left(\left[ \begin{smallmatrix} 1 \\ 4 \end{smallmatrix} \right]\right) = \left[ \begin{smallmatrix} 6 \\ -11 \\ 3 \end{smallmatrix} \right]\).

Example 6: Finding a Standard Matrix (Comma-Delimited Form)

Rewrite the transformation \(T(x_1, x_2) = (3x_1 + x_2, 2x_1 - 4x_2)\) in column-vector form and find its standard matrix.

Step 1: Rewrite in column-vector form. \[ T\left(\left[ \begin{array}{c}{x_{1}}\\ {x_{2}} \end{array} \right]\right) = \left[ \begin{array}{c}{3x_{1} + x_{2}}\\ {2x_{1} - 4x_{2}} \end{array} \right] \]

Example 6: Finding a Standard Matrix (Comma-Delimited Form)

Step 2: Identify the coefficients to form the matrix directly. We observe that the output vector is a linear combination of \(x_1\) and \(x_2\) with coefficients forming columns: \[ \left[ \begin{array}{c}{3x_{1} + x_{2}}\\ {2x_{1} - 4x_{2}} \end{array} \right] = x_1\left[ \begin{array}{c}{3}\\ {2} \end{array} \right] + x_2\left[ \begin{array}{r}{1}\\ {-4} \end{array} \right] = \left[ \begin{array}{rr}{3} & {1}\\ {2} & {-4} \end{array} \right]\left[ \begin{array}{c}{x_{1}}\\ {x_{2}} \end{array} \right] \] Thus, the standard matrix is: \[ A = \left[ \begin{array}{rr}{3} & {1}\\ {2} & {-4} \end{array} \right] \]

Alternatively, explicitly apply the procedure:
\(T(\mathbf{e}_1) = T(1,0) = (3(1)+0, 2(1)-4(0)) = (3,2)\), so \(\left[ \begin{smallmatrix} 3 \\ 2 \end{smallmatrix} \right]\).
\(T(\mathbf{e}_2) = T(0,1) = (3(0)+1, 2(0)-4(1)) = (1,-4)\), so \(\left[ \begin{smallmatrix} 1 \\ -4 \end{smallmatrix} \right]\).
The standard matrix is then \(\left[ \begin{array}{rr}{3} & {1}\\ {2} & {-4} \end{array} \right]\).

ECE Applications & Summary

Key Concepts for ECE:

  • Computer Graphics & Image Processing: Rotations, scaling, translations (affine transformations, built on linear transformations) of 2D/3D objects and images.
  • Robotics: Kinematics (mapping joint angles to end-effector positions), robot path planning, sensor data transformation.
  • Control Systems: State-space representation, system linearization, transformations between different coordinate frames (e.g., in aerospace engineering).
  • Signal Processing: Filtering operations (e.g., convolution), Fourier transforms, wavelet transforms can often be represented as linear transformations.
  • Circuit Analysis: Impedance transformations, network analysis can involve linear mappings.
  • Data Science/Machine Learning: Feature transformations, dimensionality reduction (e.g., PCA), neural network layers often perform linear transformations.

ECE Applications & Summary

Today We Covered:

  • Vectors in \(R^n\) and transformations from \(R^n\) to \(R^m\).
  • The definition of a matrix transformation as \(T_A(\mathbf{x}) = A\mathbf{x}\).
  • The essential linearity conditions (additivity & homogeneity) that uniquely define linear transformations.
  • The one-to-one correspondence between linear transformations and their standard matrices.
  • A practical procedure for finding the standard matrix by transforming standard basis vectors.