开发者

Calculating direction of rotation

开发者 https://www.devze.com 2023-01-25 00: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.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消