check if point is left or right of vector

Solutions on MaxInterview for check if point is left or right of vector by the best coders in the world

showing results for - "check if point is left or right of vector"
Daniel
14 May 2018
1Check position of point M(X, Y) relative to vector AB with points A(Ax, Ay) and B(Bx, By):
2
3position = sign((Bx - Ax) * (Y - Ay) - (By - Ay) * (X - Ax))
4
5M is: 	+1 left,
6		-1 right,
7    	0 on the vector AB