18.5 Rigid-Body Dynamics 469
which involves the calculation of sin and c os of the angular veloc ity for each update.
This is a worse situation than our equivalent quaternion update, because trigonomet-
ric calculations are less efficient than addition, subtraction, or multiplication.
18.4.2 Matrices
To support our 2D vectors, we’ll need two kinds of matrices. Th e f irst, not s urprisingly,
will be a 2 ×2 matrix. This can represent rotations, but not translations. The second
is the equivalent of the 2 × 3 matrix from Chapter 9, and, as there, it uses the extra
column to allo w it to represent translation.
The 2 ×3 matrix transforms a vector by assuming that the vector has a third entry,
whichisalways1:
abc
ef g
⎡
⎢
⎣
x
y
1
⎤
⎥
⎦
=
ax + by +c
ex +fy +g
[18.2] ...