Game Development Reference
In-Depth Information
Figure 2.12
Interpreting a vector as a sequence of
displacements
2.7.3 Displacement Vector from One Point to Another
It is very common that we will need to compute the displacement from
one point to another. In this case, we can use the triangle rule and vector
subtraction. Figure 2.13 shows how the displacement vector from a to b
can be computed by subtracting a from b .
Figure 2.13
Using 2D vector subtraction to compute the
vector from point a to point b
As Figure 2.13 shows, to compute the vector from a to b , we interpret
the points a and b as vectors from the origin, and then use the triangle
rule. In fact, this is how vectors are defined in some texts: the subtraction
of two points.
Notice that the vector subtraction b a yields a vector from a to b .
It doesn't make any sense to simply find the vector “between two points,”
since the language in this sentence does not specify a direction. We must
always form a vector that goes from one point to another point.
 
Search WWH ::




Custom Search