# The formula for the point position rotated around an axis of a sphere

Please let me know the formula for the point position rotated around an axis of a sphere.

In detail, I want to do as follows. Given:

1. any point $p_1$ to decide the rotation axis ax of a sphere of ( radius r and center c);
2. any point $p_2$ rotated around ax;
3. any angle $angle$ as the measure of the rotation of the sphere around ax,

then compute the new position of $p_2$ by a formula.

Yes , I want the center c is at the origin and the rotation axis goes through p1 and c .

I found a rotation matrix formula at the bottom in the wikipedia page of "Rodrigues rotation formula ". Is it only for the special case as , the rotation axis goes through the origin?

Thank you very much.

-
It seems one would need to know the center of the sphere. –  Did Jun 13 '11 at 5:49
Are you assuming the center of the sphere is at the origin, and the axis of rotatioon will go through the origin and $p_1$? –  Arturo Magidin Jun 13 '11 at 5:53
Yes , I want the center c is at the origin and the rotation axis goes through p1 and c . –  seven_swodniw Jun 13 '11 at 6:11

Use the Rodrigues rotation formula ${\rm Rot}[\vec{k},\theta,\vec{v}]$ for arbitrary axis.
$$\vec{p}_2 = {\rm Rot}[\vec{p}_1-\vec{c}, \theta,\vec{p}_2-\vec{c}] + \vec{c}$$
where $\theta$ is the angle.
Thats why I subtract $\vec{c}$ and then add it again later. –  ja72 Jun 16 '11 at 14:25