VectorSub


Subtracts the second vector from the first and returns the difference. Syntax:

subvec=VectorSub(vector1, vector2);


The Math
subvec=(x1-x2, y1-y2, z1-z2)
Geometrical Application
Vector1 is the destination for the subvec and vector2 is the source. Subvec will have the length and direction to travel from the displacement of vector2 to the displacement of vector1.

The math for this operation is:
'-2 2 0' - '1 3 0' = '-3 -1 0'

A good use of VectorSub() is to find a lookvector (unnormalized) from one position to another.