This page will describe how to calculate the directional vector between two points, in a 2-D plane.


Before you start you will need the X and Y coordinates of both points. Then follow these steps:

  1. Apply the distance formula.
  2. distance = sqrt(((x2 - x1)^2) + (y2 - y1)^2))
  3. The X coordinate of the directional vector is calculated as follows:
  4. X = (x2 - x1)/distance
  5. The Y coordinate is about the same:
  6. Y = (y2 - y1)/distance
  7. The result is the directional vector:
  8. Vector[X, Y]