Game Development Reference
In-Depth Information
magnitude = |V|
Normalizing Vectors : When a vector is normalized, it retains its direction but its
magnitude is recalculated so that it is of unit length (a length of 1). To do this you
divide each component of the vector by the magnitude of the vector. Mathem-
aticians write the formula as follows:
N = V/|V|
Therefore, to normalize the vector (4, 5), you would do the following:
new X = 4 /6.403 = 0.62
new Y = 5 /6.403 = 0.78
Resolving Vectors : It's possible to use trigonometry to resolve a vector into two
separate vectors, one parallel to the x axis and one to the y axis. Take a look at the
vector, V, representing the thrust of a jet fighter at point V, as shown in the fol-
lowing figure:
To resolve V into its x/y components, we need to find Oa and Ob . This will give us the
component of the aircraft's thrust that is acting along the y axis, and the component along
the x axis. Another way of putting it is that Oa is the amount of thrust acting along the x
axis, and Ob is the amount along the y axis.
First, let's calculate the amount of thrust along the y axis: Oa . From trigonometry, we
know that:
cos(θ) = adjacent / hypotenuse = Oa / |V|
Rearranged, this gives:
Oa = |V| Cos(θ) = y component
Search WWH ::




Custom Search