rotation of spherical surface in spherical coordinates

503 Views Asked by At

I need to plot a spherical surface in computer (like the surface of a lens). I know the normal vector (as an example, say $\ n=(1,2,3) $) of this surface and it originates from the centre of the surface. Since this surface is oriented along an arbitary direction defined by $\ n $, I don't know how to plot it, but I do know how to plot such a surface if its surface normal at the centre points along the z-axis, as shown in the attached diagram (as the polar and azimuthal angle that define the surface become much easier to calculate and implement in a program).

Now my actual problem is that given the cartesian coordinates of all the points on the surface (that is oriented along the z-axis), what is the rotation matrix (or other mathematical object) that can transform this surface to the actual surface I want (defined by $\ n $)?

enter image description here