Condition for when finite cylinder and sphere intersect I feel like the answer to the following question is well known but I have not been able to find a reference to it with exception to a very similar question here and an article on Wikipedia.
Given $h, r, R > 0$ and $(x_0, y_0, z_0) \in \mathbb{R}^3$, define
$$
C = \lbrace (x,y,z) \in \mathbb{R}^3 \ |\ x^2 + y^2 = R^2 \text{ and } |z| \leq h \rbrace,
$$
$$
S = \lbrace (x,y,z) \in \mathbb{R}^3 \ |\ (x - x_0)^2 + (y - y_0)^2 + (z - z_0)^2 = r^2 \rbrace.
$$
What are the conditions on $h, r, R, x_0, y_0, z_0$ so that $C \cap S \neq \emptyset$?
My approach has been to substitute $x^2 + y^2 = R^2$ into $(x - x_0)^2 + (y - y_0)^2 + (z - z_0)^2 = r^2$ and consider slices of constant $z \in [-h, h]$. The desired intersection is empty if the intersection of the resulting circles is empty for every $z$.
I appreciate the help. Thanks!
Edit:
Some additional details to my approach.
Note if $C \cap S \neq \emptyset$, there must exist $z' \in [-h,h]$ such that
$$r^2 - (z' - z_0)^2 \geq 0$$
and
$$(R - (r^2 - (z' - z_0)^2)^{\frac{1}{2}})^2 
    \leq x_0^2 + y_0^2
    \leq (R + (r^2 - (z' - z_0)^2)^{\frac{1}{2}})^2.$$
The first inequality comes from the requirement that the sphere intersects with a plane on which the cylinder's cross sections are defined. The second inequality is the condition for two circles to intersect on the plane.
The first inequality leads to
$$
z' \in [\max(z_0-r, -h), \min(z_0+r, h)].
$$
 A: Find the cross sections of both surfaces with the plane $z=z_0$. We can geometrically see that an intersection between these 2 cross section is the necessary condition for intersection between $C$ and $S$.
So we want to find the conditions such that $x^2+y^2=R^2$ and $(x-x_0)^2+(y-y_0)^2=r^2$ intersect. We can see that there is an intersection when the distance between the two centers is less than or equal to the sum of the radii. This implies that $\boxed{\sqrt{x_0^2+y_0^2}\leq R+r}$.
A: Forget initially about $h$.
Consider the plane $\pi$ containing the cylinder axis and the center of the sphere, and project the solids there: you see a generatrix of the cylinder crossing a great circle of the sphere.
Then take a projection on the $x,y$ plane: you see the intersection of two circles.
You realize that till the two projections intersecate in  $\pi$ so do the solids.
Therefore you can reduce the problem in 2D, since it has a cylindrical symmetry, and find the two point of intersection in $z$. Then compare $[z_1, z_2]$ with $[-h,h]$
A: The distance from the axis of the cylinder $(x=0, y = 0)$ to the center of the sphere must be less than the radius of the sphere plus the radius of the cylinder.
$R + r < \sqrt {x_0^2 + y_0}^2$
