Spherical to Cylindrical coordinate conversion with different radius It is easy to find spherical to cylindrical coordinate conversion formula.
My question is what if the point at the sphere extends, what is the point of contact at the cylinder?
Example:


*

*I have a sphere with radius $3$ and a cylinder with radius $10$.

*Let $\theta$ be azimuthal angle in the $(x, y)$ plane and $\phi$ be polar/zenith angle. I have a point $p_1$ on the sphere at $(3, \theta, \phi)$

*If there is a straight line from the origin to $p_1$ and it extends to the cylinder with radius $10$, what is the intersection of the line and the cylinder?


How would you get the point of contact? I am doing this for some kind of simulation for something, and my simulation is not coming out as my experiment. Don't know if my equation is wrong or my assumptions are wrong for the simulation =(
p.s. Extra questions. If there is a circle on a sphere with constant $\phi$, if you look from one angle, it will just look like a circle, but from another angle, it will look like a horizontal line. If the circle extends to the cylinder, will it still look like a circle on the cylinder?
 A: For a sphere of radius $\rho$ centered at the origin and a cylinder of radius $r$ about the $z$-axis, your point on the sphere has Cartesian coordinates
$$
p_1 = (x, y, z)
  = (\rho \cos\theta \cos\phi, \rho \sin\theta \cos\phi, \rho \sin\phi).
$$
The ray from the origin through $p_1$ consists of all points of the form
$$
tp_1 = (tx, ty, tz)
  = (t\rho \cos\theta \cos\phi, t\rho \sin\theta \cos\phi, t\rho \sin\phi),\quad t > 0.
$$
Your goal is to find $t > 0$ so that $tp_1$ lies on the cylinder, i.e., so that $t^2(x^2 + y^2) = r^2$. Since $\sqrt{x^2 + y^2} = \sqrt{\rho^2\cos^2\phi} = \rho \cos\phi$, you have
$$
t = \frac{\sqrt{r^2}}{\sqrt{x^2 + y^2}} = \frac{r}{\rho \cos\phi}.
$$
The desired point on the cylinder consequently has Cartesian coordinates $r(\cos\theta, \sin\theta, \tan\phi)$. (Naturally, this formula assumes $|\phi| < \pi/2$; otherwise, $p_1$ is on the axis of the cylinder.)
"Latitude" circles on the sphere (with $\phi$ constant) do indeed map to "latitude" circles on the cylinder, as the preceding calculation shows.
