Answers for "Check if a point is on the right or left of a vector?"
http://answers.unity.com/questions/1302113/check-if-a-point-is-on-the-right-or-left-of-a-vect.html
The latest answers for the question "Check if a point is on the right or left of a vector?"Answer by The_Pied_Shadow
http://answers.unity.com/answers/1800188/view.html
To do this it's safe to assume we're thinking about these points in 2D space. If you want to determine a left or right of line you have to define what exactly left or right means. Is left positive y? positive z? Unity considers 'left' to be in the negative x direction and 'right' in the positive x direction whether in world or local space. For this answer I'll assume the same I just wanted to make note of it so if someone was operating on a different 2D plane assumption they would need to adjust the formula accordingly.
----------
Vector3 vec = A.position - B.position;
Vecotr3 dir = C.position - B.position;
Vector3 cross = Vector3.Cross(vec, dir);
----------
Here 'vec' represents a the vector you want to test the location relative to. 'Dir' is a vector from the origin position of 'vec' to the point you want to check.
----------
In this case, the y value of the variable 'cross' will be positive when on the right side of the line and negative when on the left. This is relative to the direction of the line (in this case from point B looking at point A). So in the diagram you showed, if you plugged the positions of all these points in then the cross product would have a negative value for C.Tue, 29 Dec 2020 14:00:09 GMTThe_Pied_ShadowAnswer by tanoshimi
http://answers.unity.com/answers/1302169/view.html
You could calculate this by testing the sign of the [Cross Product][1] between the vectors BA and BC. Or if you're only operating in 2D space, try this...
bool IsLeft(Vector2 A, Vector2 B)
{
return -A.x * B.y + A.y * B.x < 0);
}
[1]: https://docs.unity3d.com/ScriptReference/Vector3.Cross.htmlSat, 21 Jan 2017 14:23:33 GMTtanoshimi