简体   繁体   中英

how to find the center of rotation of a point in 2d space

I have a 2d point that rotates around some center of rotation other than the origin.

how can calculate the center of rotation given only the different positions of the point?

To get wanted result, you need three points.

Having them as points at circumference, you can calculate center of circle.

Look here or get formulas from wiki

D = |x1  y1  1|
    |x2  y2  1|
    |x3  y3  1|

Dx = |x1^2 + y1^2  y1  1|
     |x2^2 + y2^2  y2  1|
     |x3^2 + y3^2  y3  1|

Dy = |x1^2 + y1^2  x1  1|
     |x2^2 + y2^2  x2  1|
     |x3^2 + y3^2  x3  1|


D = x1 * (y2 - y3) + x2 * (y3 - y1) + x3 * (y1 - y2)
Dx = (x1^2 + y1^2) * (y2 - y3) + (x2^2 + y2^2) * (y3 - y1) + (x3^2 + y3^2) * (y1 - y2)
Dy = (x1^2 + y1^2) * (x2 - x3) + (x2^2 + y2^2) * (x3 - x1) + (x3^2 + y3^2) * (x1 - x2)

Center coordinates

Cx =  Dx / (2*D)
Cy =  - Dy / (2*D)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM