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)]. $$
The final condition is the following: $$\begin{cases}h\ge0\\ \lvert z_0\rvert\ge h\\ (h-\lvert z_0\rvert)^2+\left(\lvert R\rvert-\sqrt{x_0^2+y_0^2}\right)^2\le r^2\\ r^2\le(h+\lvert z_0\rvert)^2+\left(\lvert R\rvert+\sqrt{x_0^2+y_0^2}\right)^2\end{cases}\lor\begin{cases}h> 0\\ \lvert z_0\rvert<h\\ \left\lvert \lvert R\rvert-\sqrt{x_0^2+y_0^2}\right\rvert\le\lvert r\rvert\\ r^2\le(h+\lvert z_0\rvert)^2+\left(\lvert R\rvert+\sqrt{x_0^2+y_0^2}\right)^2\end{cases}$$
And an interpretation of this in terms of funny segments is left to whoever may want to do so.
First, let's recall that the parametric system $$\begin{cases}c_1\le ax+by\le c_2\\ x^2+y^2=R^2\end{cases}$$ has solutions in $(x,y)$ if and only if $$\begin{cases} c_1\le \lvert R\rvert\sqrt{a^2+b^2}\\c_2\ge-\lvert R\rvert\sqrt{a^2+b^2}\\ c_2\ge c_1\end{cases}$$
Now, your condition is that the following system has solutions in $(x,y,z)$ \begin{align}&\begin{cases}(x-x_0)^2+(y-y_0)^2+(z-z_0)^2=r^2\\ x^2+y^2=R^2\\ \lvert z\rvert\le h\end{cases}\\\\\hline\\&\begin{cases}h\ge 0\\(z-z_0)^2=r^2-R^2-x_0^2-y_0^2+2x_0x+2y_0y\\ x^2+y^2=R^2\\ -h\le z\le h\\ \end{cases}\\ \\\hline\\&\begin{cases}z=z_0+\sqrt{r^2-R^2-x_0^2-y_0^2+2x_0x+2y_0y}\\(i)\begin{cases}r^2-R^2-x_0^2-y_0^2+2x_0x+2y_0y\ge0\\ \sqrt{r^2-R^2-x_0^2-y_0^2+2x_0x+2y_0y}\le h-z_0\\ \sqrt{r^2-R^2-x_0^2-y_0^2+2x_0x+2y_0y}\ge-h-z_0\\ x^2+y^2=R^2\\ h\ge 0\end{cases}\end{cases}\lor \begin{cases}z=z_0-\sqrt{r^2-R^2-x_0^2-y_0^2+2x_0x+2y_0y}\\(ii)\begin{cases}r^2-R^2-x_0^2-y_0^2+2x_0x+2y_0y\ge0\\ \sqrt{r^2-R^2-x_0^2-y_0^2+2x_0x+2y_0y}\ge z_0-h\\ \sqrt{r^2-R^2-x_0^2-y_0^2+2x_0x+2y_0y}\le h+z_0\\ x^2+y^2=R^2\\ h\ge 0\end{cases}\end{cases}\end{align}
Now, it is clear that the disjunction of the two systems has solutions in $(x,y,z)$ if and only if $(i)\lor (ii)$ has solutions in $(x,y)$. Let's notice that $(ii)_{R,r,h,x_0,y_0,z_0}$ is just $(i)_{R,r,h,x_0,y_0,-z_0}$. Therefore, let's focus on $(i)$.
\begin{align}&\begin{cases}r^2-R^2-x_0^2-y_0^2+2x_0x+2y_0y\ge0\\ \sqrt{r^2-R^2-x_0^2-y_0^2+2x_0x+2y_0y}\le h-z_0\\ \sqrt{r^2-R^2-x_0^2-y_0^2+2x_0x+2y_0y}\ge-h-z_0\\ x^2+y^2=R^2\\ h\le0\end{cases}\\\\\hline\\ &\begin{cases}2x_0x+2y_0y\ge R^2+x_0^2+y_0^2-r^2\\ h\ge z_0\\ 2x_0x+2y_0y\le(h-z_0)^2+R^2+x_0^2+y_0^2-r^2\\ z_0\le- h\\ 2x_0x+2y_0y\ge(h+z_0)^2+R^2+x_0^2+y_0^2-r^2\\ x^2+y^2=R^2\\ h\ge0\end{cases}\lor\begin{cases}2x_0x+2y_0y\ge R^2+x_0^2+y_0^2-r^2\\ h\ge z_0\\ 2x_0x+2y_0y\le(h-z_0)^2+R^2+x_0^2+y_0^2-r^2\\ z_0>-h\\ x^2+y^2=R^2\\ h\ge0\end{cases}\\ \\\hline\\&\begin{cases}z_0\le- h\\ 2x_0x+2y_0y\le(h-z_0)^2+R^2+x_0^2+y_0^2-r^2\\ 2x_0x+2y_0y\ge(h+z_0)^2+R^2+x_0^2+y_0^2-r^2\\ x^2+y^2=R^2\\ h\ge0\end{cases}\lor\begin{cases}-h<z_0\le h\\ 2x_0x+2y_0y\ge R^2+x_0^2+y_0^2-r^2\\ 2x_0x+2y_0y\le(h-z_0)^2+R^2+x_0^2+y_0^2-r^2\\ x^2+y^2=R^2\\ h>0\end{cases}\end{align}
By the previous lemma about intersection of a circle with a stripe, the disjoint systems above have solutions in $(x,y)$ if and only if $$\begin{cases}z_0\le- h\\ (h+z_0)^2+R^2+x_0^2+y_0^2-r^2\le2\lvert R\rvert\sqrt{x_0^2+y_0^2}\\ -2\lvert R\rvert\sqrt{x_0^2+y_0^2}\le(h-z_0)^2+R^2+x_0^2+y_0^2-r^2\\ (h-z_0)^2\ge(h+z_0)^2\\ h\ge0\end{cases}\lor\begin{cases}-h<z_0\le h\\ 2\lvert R\rvert\sqrt{x_0^2+y_0^2}\ge R^2+x_0^2+y_0^2-r^2\\ -2\lvert R\rvert\sqrt{x_0^2+y_0^2}<(h-z_0)^2+R^2+x_0^2+y_0^2-r^2\\ (h-z_0)^2\ge0\\ h>0\end{cases}$$ And the latter may be simplified to $$\begin{cases}z_0\le- h\\ (h+z_0)^2+\left(\rvert R\rvert-\sqrt{x_0^2+y_0^2}\right)^2\le r^2\\ r^2\le(h-z_0)^2+\left(\lvert R\rvert+\sqrt{x_0^2+y_0^2}\right)^2\\ h\ge0\end{cases}\lor\begin{cases}-h<z_0\le h\\ \left\lvert\lvert R\rvert-\sqrt{x_0^2+y_0^2}\right\rvert\le \lvert r\rvert\\ r^2\le(h-z_0)^2+\left(\lvert R\rvert+\sqrt{x_0^2+y_0^2}\right)^2\\ h>0\end{cases}$$
Let's call these two conditions $(ia)$ and $(ib)$. As it was remarked before, $(ii)$ is just $(i)$ with parameter $-z_0$ instead of $z_0$, therefore it has solutions in $(x,y)$ if and only if $$\begin{cases}z_0\ge h\\ (h-z_0)^2+\left(\rvert R\rvert-\sqrt{x_0^2+y_0^2}\right)^2\le r^2\\ r^2\le(h+z_0)^2+\left(\lvert R\rvert+\sqrt{x_0^2+y_0^2}\right)^2\\ h\ge0\end{cases}\lor\begin{cases}-h\le z_0< h\\ \left\lvert\lvert R\rvert-\sqrt{x_0^2+y_0^2}\right\rvert\le \lvert r\rvert\\ r^2\le(h+z_0)^2+\left(\lvert R\rvert+\sqrt{x_0^2+y_0^2}\right)^2\\ h> 0\end{cases}$$
Let's call these two conditions $(iia)$ and $(iib)$. The original system has solutions if and only if $(ia)\lor(ib)\lor(iia)\lor(iib)$. Now, notice that $(ia)\lor (iia)$ is equivalent to $$\begin{cases}\lvert z_0\rvert\ge h\\ (h-\lvert z_0\rvert)^2+\left(\rvert R\rvert-\sqrt{x_0^2+y_0^2}\right)^2\le r^2\\ r^2\le(h+\lvert z_0\rvert)^2+\left(\lvert R\rvert+\sqrt{x_0^2+y_0^2}\right)^2\\ h\ge0\end{cases}$$ Moreover, $((ib)\land z_0=h)\Rightarrow (iia)$ and $((iib)\land z_0=-h)\Rightarrow (ia)$. Therefore, $(ia)\lor (iia)$ is equivalent to $(ia)\lor(iia)\lor((ib)\land z_0=h)\lor((iib)\land z_0=-h)$. All that is left is the part $((ib)\land z\ne h)\lor((iib)\land z\ne -h)$. Notice that this is equivalent to $$\begin{cases}\lvert z_0\rvert<h\\ \left\lvert\lvert R\rvert-\sqrt{x_0^2+y_0^2}\right\rvert\le \lvert r\rvert\\ r^2\le\max((h+z_0)^2,(h-z_0)^2)+\left(\lvert R\rvert+\sqrt{x_0^2+y_0^2}\right)^2\\ h>0\end{cases}$$
Since $h\ge0$, we have that $\max((h+z_0)^2,(h-z_0)^2)=(h+\lvert z_0\rvert)^2$. This concludes the proof.