Reputation: 45
If I have four points in 2D space, which are then rotated m degrees, what is the best/ most efficient way to determine the direction(clockwise/counter clockwise) of the rotation.
I know which point is which before and after rotation.
I have tried taking into account the lowest point and the highest point (based on y value) and comparing the x difference e.g. (+ve or -ve) but this does not seem to be very reliable and I doubt it is an efficient solution.
Upvotes: 4
Views: 2837
Reputation: 1979
do you know which point is which? if you do, using one of them is enough
Upvotes: 0
Reputation: 308763
Any point will do if you have both the before and after coordinates. Take the cross product of the before into the after. The sign of the resultant vector will tell you clockwise (-) or counterclockwise(+).
Upvotes: 5