The Amount of One Vector's Magnitude That Lies in Another Vector's Direction
The Amount of One Vector's Magnitude That Lies in Another Vector's Direction
Naturally, the direction can be anything you like but the direction vector
must always be normalized for this calculation. Not only is the result
more correct than the magnitude of the velocity, it also avoids the slow
square root operation involved in finding the magnitude.