Matrix Multiplication
Matrix multiplication is more complex than addition — and more powerful. It represents composing transformations, which is essential for robot kinematics where multiple joints create a chain of transformations.
The Row-Column Rule
To multiply matrices A (size m×n) and B (size n×p), compute each element of the result C (size m×p):
In words: Take row i from A, column j from B, multiply corresponding elements, and sum them.
Step-by-Step Example
Element [1,1]: Row 1 of A × Column 1 of B
Element [1,2]: Row 1 of A × Column 2 of B
Element [2,1]: Row 2 of A × Column 1 of B
Element [2,2]: Row 2 of A × Column 2 of B
Result:
Dimension Requirements
For AB to be defined:
- Number of columns in A must equal number of rows in B
- If A is m×n and B is n×p, then AB is m×p
Example: (2×3) × (3×4) = (2×4) ✓
Example: (2×3) × (2×4) = undefined ✗
Properties of Matrix Multiplication
Non-Commutative
Generally, AB ≠ BA. Order matters!
Different results!
Associative
(AB)C = A(BC) — you can group multiplications.
Distributive
A(B + C) = AB + AC
Identity Property
AI = IA = A (when dimensions match)
Geometric Interpretation: Transformation Composition
Matrix multiplication represents applying transformations in sequence.
If matrix B represents a transformation (e.g., rotation) and matrix A represents another transformation (e.g., scaling), then AB represents:
- First apply B to the input
- Then apply A to the result
Reading Order
For AB: Read right to left for transformation order.
- AB means “do B first, then A”
- This is the opposite of function notation: f(g(x)) does g first
Robot Kinematic Chain Robotics Application
A 3-joint robot arm has transformations at each joint:
where:
- T₁ transforms from base to joint 1
- T₂ transforms from joint 1 to joint 2
- T₃ transforms from joint 2 to end-effector
To find where the end-effector is relative to the base, multiply the matrices in order:
This is forward kinematics — computing end-effector position from joint angles.
Matrix-Vector Multiplication
A special case: multiplying a matrix by a column vector.
This transforms the vector (1, 2) into (2, 6).
Velocity Mapping Robotics Application
The Jacobian matrix J maps joint velocities to end-effector velocities:
where:
- is the vector of joint velocities (angular velocities)
- vend is the Cartesian velocity of the end-effector (linear + angular)
Matrix-vector multiplication transforms joint-space velocities into task-space velocities.
Interactive Visualization
Explore matrix multiplication below. Adjust the matrices and see how transformations compose. The visualization shows how the standard basis vectors (unit square) transform under B, then under A.
Matrix A
Matrix B
Highlight Element
Matrix Product (AB)
Transformation Composition: Matrix multiplication represents composing transformations. Gray vectors show the original basis. Green shows after applying B, blue shows after applying A to those results. The result AB represents doing B first, then A.
Key Takeaways
- Matrix multiplication uses the row-column rule (dot products)
- Order matters: AB ≠ BA (non-commutative)
- Dimensions must match: (m×n) × (n×p) = (m×p)
- Geometric meaning: Composing transformations (do right matrix first)
- Robot kinematics: Chain of joint transformations multiplies to give end-effector pose
Practice Problems
Try these mentally or with the interactive tool:
- What are the dimensions of (3×5) × (5×2)?
- Can you multiply (2×3) × (2×3)? Why or why not?
- If A is a 90° rotation and B is a scaling by 2, what does AB do? What about BA?
Answers
- (3×2) — 3 rows from first matrix, 2 columns from second
- No — 3 columns ≠ 2 rows (inner dimensions don’t match)
- AB: scale first, then rotate. BA: rotate first, then scale. Different results! (Scaling changes direction, rotation preserves lengths)
Next Steps
Matrix multiplication is powerful, but not all matrices have inverses. Next, we’ll explore determinants — a number that tells you if a matrix is invertible and reveals geometric properties like area scaling.