문제

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.

도움이 되었습니까?

해결책

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(+).

다른 팁

do you know which point is which? if you do, using one of them is enough

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top