# Calculate centre of rotation

1. Jul 2, 2012

### yasith

Dear all,

I have a problem that I need to solve. (I have made posts previously about this as well). Quite simply now I have an object that rotates in 3D space (No translation). I have coordinates of 3 points before and after rotation. Using this data how can I calculate its centre of rotation?

Thank you very much for your input.

Regards
Yasith

2. Jul 2, 2012

### chiro

Hey yasith and welcome to the forums.

The simple answer is to to get the rotation axis and the rotation angle.

Short version is to take the cross product of the two vectors (i.e. vectors represented by the two points) and normalize this vector to get the rotation axis.

To get the angle you need to use the dot product of the two points, divide by the product of the lengths and then take the inverse cosine of the result (which will always be between -1 and +1 inclusive).

In the cross product, the first point should be the original and the second point should be the final point (i.e. in axis = A X B, A is original, B is final point).

That's the simple answer, and it's based on principles of 3D geometry.