Module 2: Matrices Lesson 3 of 3

Determinants & Inverses

The determinant is a scalar value computed from a square matrix that reveals crucial properties: whether the matrix is invertible, how it scales area/volume, and whether it reverses orientation.

In robotics, determinants help identify singular configurations where a robot loses degrees of freedom.

What is a Determinant?

The determinant of a square matrix A is denoted det(A) or |A|.

2×2 Determinant

det[abcd]=adbc\det\begin{bmatrix} a & b \\ c & d \end{bmatrix} = ad - bc

Example:

det[3124]=(3)(4)(1)(2)=122=10\det\begin{bmatrix} 3 & 1 \\ 2 & 4 \end{bmatrix} = (3)(4) - (1)(2) = 12 - 2 = 10

3×3 Determinant

Use cofactor expansion (more complex):

det[abcdefghi]=adet[efhi]bdet[dfgi]+cdet[degh]\det\begin{bmatrix} a & b & c \\ d & e & f \\ g & h & i \end{bmatrix} = a\det\begin{bmatrix} e & f \\ h & i \end{bmatrix} - b\det\begin{bmatrix} d & f \\ g & i \end{bmatrix} + c\det\begin{bmatrix} d & e \\ g & h \end{bmatrix}

Larger Matrices

For n×n matrices, determinants can be computed using:

  • Cofactor expansion (recursive, slow for large n)
  • Row reduction to triangular form (more efficient)
  • Library functions (what we actually use in practice)

In this course, we’ll focus on understanding what determinants mean rather than hand-calculating large ones.

Geometric Interpretation

The determinant represents how much the transformation scales area (2D) or volume (3D).

Area Scaling in 2D

Consider the unit square with corners at (0,0), (1,0), (1,1), (0,1). It has area = 1.

When transformed by matrix A, it becomes a parallelogram with area = |det(A)|.

Scaling Example

A=[2003],det(A)=6A = \begin{bmatrix} 2 & 0 \\ 0 & 3 \end{bmatrix}, \quad \det(A) = 6

This matrix scales x by 2 and y by 3. The unit square (area 1) becomes a rectangle with area 2 × 3 = 6. ✓

Sign of the Determinant

A useful property: det(AB) = det(A) · det(B). Composing two transformations multiplies their area-scaling factors. This also explains why det(A-1) = 1/det(A) — the inverse must undo the scaling.

Singular Matrices

A matrix is singular if det(A) = 0. This means:

  1. The matrix collapses space into a lower dimension
    • 2D → 1D (squashes to a line)
    • 3D → 2D (squashes to a plane) or 3D → 1D (squashes to a line)
  2. The matrix is not invertible (no inverse exists)
  3. The columns/rows are linearly dependent

Why Singular Matrices Matter in Robotics

When a robot’s Jacobian matrix has determinant ≈ 0, the robot is in a singular configuration:

  • Loses control in certain directions
  • Cannot generate forces/velocities in some directions
  • Infinite joint velocities may be needed for certain end-effector motions
  • Numerical instability in inverse kinematics

Avoiding singularities is critical for robot control!

Singular Configuration Robotics Application

A 2-link planar robot arm is singular when the links are collinear:

  1. Fully extended (elbow angle θ₂ = 0°)

    • Links point in the same direction, arm is stretched out
    • Cannot move perpendicular to the arm direction
    • Jacobian determinant = 0
  2. Fully folded (elbow angle θ₂ = ±180°)

    • Links point in opposite directions, arm folds back on itself
    • Workspace shrinks to a point
    • Jacobian determinant = 0

Try these configurations in the interactive demo below!

Matrix Inverse

If det(A) ≠ 0, the matrix is invertible and has an inverse A-1 such that:

AA1=A1A=IA \cdot A^{-1} = A^{-1} \cdot A = I

where I is the identity matrix.

2×2 Inverse Formula

[abcd]1=1adbc[dbca]\begin{bmatrix} a & b \\ c & d \end{bmatrix}^{-1} = \frac{1}{ad - bc} \begin{bmatrix} d & -b \\ -c & a \end{bmatrix}

Note: The inverse only exists if det(A) = ad - bc ≠ 0.

Example:

A=[3124],det(A)=10A = \begin{bmatrix} 3 & 1 \\ 2 & 4 \end{bmatrix}, \quad \det(A) = 10 A1=110[4123]=[0.40.10.20.3]A^{-1} = \frac{1}{10} \begin{bmatrix} 4 & -1 \\ -2 & 3 \end{bmatrix} = \begin{bmatrix} 0.4 & -0.1 \\ -0.2 & 0.3 \end{bmatrix}

Properties of Inverses

  1. (A-1)-1 = A
  2. (AB)-1 = B-1A-1 (order reverses!)
  3. (AT)-1 = (A-1)T
  4. det(A-1) = 1 / det(A)

Solving Linear Systems

The most important application of matrix inverses is solving equations of the form:

Ax=bA\mathbf{x} = \mathbf{b}

where A is a known matrix, b is a known vector, and x is the unknown we want to find.

Solution via Inverse

If A is invertible (det(A) ≠ 0), multiply both sides by A-1:

x=A1b\mathbf{x} = A^{-1}\mathbf{b}

Example: Solve for x:

[2113]x=[510]\begin{bmatrix} 2 & 1 \\ 1 & 3 \end{bmatrix} \mathbf{x} = \begin{bmatrix} 5 \\ 10 \end{bmatrix}

det(A) = 6 − 1 = 5 ≠ 0, so the inverse exists:

x=15[3112][510]=15[515]=[13]\mathbf{x} = \frac{1}{5}\begin{bmatrix} 3 & -1 \\ -1 & 2 \end{bmatrix} \begin{bmatrix} 5 \\ 10 \end{bmatrix} = \frac{1}{5}\begin{bmatrix} 5 \\ 15 \end{bmatrix} = \begin{bmatrix} 1 \\ 3 \end{bmatrix}

When It Fails

If det(A) = 0, the system has no unique solution:

This connects directly to singular matrices — when the columns of A are linearly dependent, the transformation collapses a dimension, and you cannot uniquely recover x from b.

Static Force Analysis Robotics Application

A robot’s Jacobian J relates joint torques τ\boldsymbol{\tau} to end-effector forces F:

τ=JTF\boldsymbol{\tau} = J^T \mathbf{F}

To find what end-effector force results from given joint torques, solve:

F=(JT)1τ\mathbf{F} = (J^T)^{-1} \boldsymbol{\tau}

This only works when J is invertible. At a singularity (det(J) = 0), certain end-effector forces become impossible to generate — no combination of joint torques can produce them.

In Practice

For large systems, computing A-1 explicitly is inefficient. Libraries use methods like LU decomposition to solve Ax = b directly without forming the inverse. But the fundamental question remains the same: is det(A) ≠ 0? If yes, a unique solution exists.

Inverse Kinematics Robotics Application

In robotics, we often need to solve for joint angles given a desired end-effector position:

pdesired=T(q)p0\mathbf{p}_{\text{desired}} = T(\mathbf{q}) \cdot \mathbf{p}_0

Important: T(q)T(\mathbf{q}) is a nonlinear function of the joint angles q\mathbf{q} — it involves sines and cosines. This means inverse kinematics is not a simple matrix inversion like solving Ax=bA\mathbf{x} = \mathbf{b}. You cannot just compute T1T^{-1} to find q\mathbf{q}.

Instead, IK typically uses iterative numerical methods: linearize the problem using the Jacobian J(q)J(\mathbf{q}), solve Δq=J1Δp\Delta\mathbf{q} = J^{-1} \Delta\mathbf{p} for a small step, and repeat. This is where matrix inverses become essential — but only for the linearized (local) problem.

Problem: When the Jacobian is singular (det(J)=0\det(J) = 0), even the linearized step cannot be inverted. Advanced techniques (pseudoinverse, damped least squares, numerical optimization) are needed.

Interactive Exploration

Part 1: Determinant and Area Scaling

Adjust the transformation matrix and observe how the unit square transforms. The area of the transformed shape equals |det(A)|.

Part 2: Robot Singularities

Toggle to “Show robot arm” to see a 2-link planar arm. Adjust the joint angles to find singular configurations where det(J) ≈ 0.

Controls

Transformation Matrix

Determinant Analysis

det(A) = 3.000
Geometric Meaning:
The determinant represents the area scaling factor. A unit square (area = 1) becomes a parallelogram with area = |det(A)|.
✓ Non-singular: Matrix is invertible

Determinant Intuition: The determinant tells you how much a transformation stretches or shrinks space. When det = 0, the matrix squashes space into a lower dimension (singular). In robotics, a singular Jacobian means the robot loses control in some direction.

Key Takeaways

  1. Determinant measures area/volume scaling factor
  2. det(A) = 0 means the matrix is singular (not invertible, collapses space)
  3. Negative determinant means the transformation reverses orientation
  4. Matrix inverse undoes the transformation: A A-1 = I
  5. Robot singularities occur when the Jacobian determinant ≈ 0, causing loss of control

Identifying Singularities

Common robot singularities:

  1. Alignment singularities: Multiple joints aligned (e.g., fully extended arm)
  2. Wrist singularities: Wrist axes align (certain orientations)
  3. Workspace boundary: At the edge of reachable space

Strategy: Monitor det(J) during motion planning and avoid regions where |det(J)| < ε (small threshold).

Practice Problems

  1. Calculate det(A) for:

    A=[2314]A = \begin{bmatrix} 2 & 3 \\ 1 & 4 \end{bmatrix}
  2. Is this matrix singular?

    B=[2412]B = \begin{bmatrix} 2 & 4 \\ 1 & 2 \end{bmatrix}
  3. Find the inverse of matrix A from problem 1.

Answers
  1. det(A) = (2)(4) - (3)(1) = 8 - 3 = 5

  2. det(B) = (2)(2) - (4)(1) = 4 - 4 = 0. Yes, singular! (Second row is 0.5 × first row)

A1=15[4312]=[0.80.60.20.4]A^{-1} = \frac{1}{5} \begin{bmatrix} 4 & -3 \\ -1 & 2 \end{bmatrix} = \begin{bmatrix} 0.8 & -0.6 \\ -0.2 & 0.4 \end{bmatrix}

Next Steps

Now that you understand matrices, their properties, and when they’re invertible, we’re ready to explore linear transformations — how matrices represent rotations, translations, and scaling in 2D and 3D space.