Game Development Reference
Vector Differential Calculus
So far we've looked at differentiation purely in terms of a single scalar quantity.
For full three-dimensional physics we need to deal with vector positions rather than
Fortunately the simple calculus we've looked at so far works easily in three di-
mensions (although you must be careful: as a general rule, most of the equations for
one-dimensional calculus you find in mathematics reference books cannot be used in
If the position of the object is given as a vector in three dimensions, then its rate
of change is also represented by a vector. Because a change in the position on one axis
doesn't change the position on any other axes, we can treat each axis as if it were its
own scalar differential.
The velocity and the acceleration of a vector depends only on the velocity and
acceleration of its components:
As long as the formulae we meet do not involve the products of vectors, this
matches exactly with the way we defined vector addition and vector-scalar multi-
plication earlier in the chapter. The upshot of this is that for most formulae involving
the differentials of vectors, we can treat the vectors as if they were scalars. We'll see an
example of this in the next section.
As soon as we have formulae that involve multiplying vectors together, or that
involve matrices, however, things are no longer as simple. Fortunately they are rare in
Velocity, Direction, and Speed
Although in regular English we often use speed and velocity as synonyms, they have
different meanings for physics development. The velocity of an object, as we've seen,
is a vector giving the rate at which its position is changing.
The speed of an object is the magnitude of this velocity vector, and the direction
that the object is moving in is given by the normalized velocity. So