https://scriptographer.org/tutorials/geometry/vector-geometry
Instead of using these two separate values, it is much easier to use a vector as a container for the them. To calculate this vector, we can simply subtract point1 from point2 instead of the two separate subtractions in the previous step:
Please note:
Read more about mathematical operations in the Point, Size and Rectangle tutorial.
The result of this subtraction (vector) is still a Point object. Technically, there is no distinction between points and vectors. It is just their meaning that changes: A point is absolute, a vector is relative.