Chapter 2. Matrices

In this chapter, we will cover the basic math needed to multiply and invert matrices:

  • Definition
  • Transpose
  • Multiplication
  • Identity matrix
  • Determinant of a 2x2 matrix
  • Matrix of minors
  • Matrix of cofactors
  • Determinant of a 3x3 matrix
  • Operations of a 4x4 matrix
  • Adjugate matrix
  • Matrix inverse

Introduction

Matrices in games are used extensively. In the context of physics, matrices are used to represent different coordinate spaces. In games, we often combine coordinate spaces; this is done through matrix multiplication. In game physics, it's useful to move one object into the coordinate space of another object; this requires matrices to be inverted. In order to invert a matrix, we have to find its minor, determinant, cofactor, and adjugate. This ...

Get Game Physics Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.