Game Development Reference
In-Depth Information
Figure 3-3. Force and torque
We said earlier that you find the magnitude of torque by multiplying the magnitude of
the applied force times the perpendicular distance between the axis of rotation and the
line of action of the force. This calculation is easy to perform in two dimensions where
the perpendicular distance ( d in Figure 3-3 ) is readily calculable.
However, in three dimensions you'll want to be able to calculate torque by knowing only
the force vector and the coordinates of its point of application on the body relative to
the axis of rotation. You can accomplish this by using the following formula:
M = r × F
The torque, M , is the vector cross product of the position vector, r , and the force vector,
F .
In rectangular coordinates you can write the distance, force, and torque vectors as fol‐
lows:
r = x i + y j + z k
F = F x i + F y j + F z k
M = M x i + M y j + M z k
The scalar components of r ( x , y , and z ) are the coordinate distances from the axis of
rotation to the point of application of the force, F . The scalar components of the torque
vector, M , are defined by the following:
M x = y F z - z F y
M y = z F x - x F z