-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|58|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
SoCoder -> Snippet Home -> Collisions and Physics


 
Pakz
Created : 24 November 2019
 
Language : Monkey2

Orientation of point vs line

Is a point left or center or right of a line



Latest Update

This is a example of a function I think is rather useful. The function in here called orientation returns the side of which a point is vs a line.

I have not really started testing and using it yet but I think it can be used for instance for rotating a turret or a homing missile towards a target. There are probably a bunch of other use cases.

The function returns -1 if the point is left side of a line. 0 if on the center and 1 if on the right. The line direction goes from point1 to point2.

 

Comments