Game math is the layer of linear algebra that sits underneath every Transform, Vector3, and rotation call in a game engine, turning gameplay code (movement, aiming, camera follow, animation blending) into the numbers the GPU actually draws. It matters because engines like Unity and Unreal hide the vector and matrix work behind friendly APIs, but debugging a flipped camera, a jittery rotation, or a character that won't turn correctly almost always means reasoning about the math directly. The recurring theme across this whole topic is representation: the same rotation, position, or curve can be encoded several different ways (Euler angles vs. quaternions, row-major vs. column-major matrices, uniform vs. centripetal splines), and most "weird" bugs trace back to picking the wrong representation or mixing two conventions without converting between them.
What This Cheat Sheet Covers
This topic spans 10 focused tables and 94 indexed concepts. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
A jump-to index of every table row in this cheat sheet.
An interactive map of every table and concept in this topic.
Table 1: Vector Fundamentals
Vectors are the atomic unit of game math, standing in for positions, directions, velocities, and forces; the dot and cross products are the two operations that turn raw vectors into answers about angles, facing, and orientation.
| Operation | Example | Description |
|---|---|---|
c = a + b d = target.position - origin.position | Combines or finds the offset between vectors component-wise; subtraction gives the vector from the first point to the second. | |
velocity = direction * speed | Scales a vector's magnitude without changing direction (unless the scalar is negative, which flips it). | |
$\lVert v \rVert = \sqrt{x^2+y^2+z^2}$ | Computed via the Pythagorean theorem; expensive due to the square root, so squared-length is preferred for comparisons. | |
dir = v.normalized() | Rescales a vector to length 1 (a unit vector) while preserving direction; undefined for a zero-length vector. | |
$a \cdot b = \lVert a \rVert \lVert b \rVert \cos\theta$ | Returns a scalar; for unit vectors it directly gives cos(angle) between them, so it's the standard way to test facing direction. | |
$c = a \times b$ | Returns a vector perpendicular to both inputs (right-hand rule), with magnitude proportional to sin(angle); only defined in 3D. |