# Transformation of coordinates

Given a point P with spherical coordinates $(r_p, \phi_p, \theta_p)$ on the sphere: $$(x-a)^2 +(y-b)^2 +(z-c)^2 = R^2$$ and a line through the center of the sphere with equation : $x=a+\alpha$ , $y=b+ \beta$, $z=c+\gamma$, where $(\alpha, \beta, \gamma)\neq(0,0,0)$ is a vector collinear to the line. How do I obtain the new spherical coordinates of the point P after rotation about the line on angle $\psi$ such that the point stays on the sphere?

-
Standard question: what all have you tried, or what is your current line of reasoning in the problem? –  Muphrid Nov 15 '12 at 15:02
I tried to find the matrix transformation but when I made a simulation the results were wrong. –  Adam Nov 15 '12 at 16:51

A matrix representation of a rotation can't be used to rotate about a line offset from the origin unless you add an extra dimension to account for that.

Instead, I would suggest converting to cartesian coordinates, translating the sphere to the origin, rotating, and then translating back and converting back to spherical.

-
For more information on 'adding extra dimensions', see homogeneous coordinates (en.wikipedia.org/wiki/Homogeneous_coordinates). –  Doubt Feb 27 '13 at 17:47