Tag Archives: vector point

Determine whether a point is above or below a vector (2D)

Determine whether point P is above or below a vector through points A, B

Point above vector

z = (B_x - A_x) (P_y - A_y) - (B_y - A_y) (P_x - A_x)

Possible values for z:

0  On the vector

> 0 Above the vector

< 0 Below the vector

The function above is the ‘2D cross product’, therefore z is the surface of vector \overline{AB} and \overline{AP}. Dividing the surface by the length of vector \overline{AB} (\vert \overline{AB}\vert) gives the ‘signed distance’ of the point perpendicular to the point P.

Lastest update in January 2022, inital post in December 2015