I have 3 Points (x,y) that represent mouse movement (from Point 1 over Point 2 to Point 3).
The angle between the two lines (line between p1
and p2
& line between p2
and p3
) can be caluculated with
where a = [(p1.x - p2.x), (p1.y - p2.y)]
and b = [(p3.x - p2.x), (p3.y - p2.y)]
But the angle is just the inner angle and doesn't tell me if the line rotates / moves left, straight or right.
Here my problem in a example:
I want to calculate that the movement from p1
to p3
over p2
has a right rotation and the movement from p1
to p4
over p2
has a left rotation.
Both have the same angle.
In other words: If you follow the vector a
longer than point p2
is p3
/p4
on the line, left of the line or right of the line.
How can i calculate that?