Take this generalised funny sphere/circle question that Mr White likes so much apparently: (you can just remove the z values and its the same thing)
Given that
$$\begin{align} L_{1}:& \ r=\begin{pmatrix} a \\ b \\ c \end{pmatrix} + \lambda \times \begin{pmatrix} d \\ e \\ f \end{pmatrix} \\ S:& \ |r-\begin{pmatrix} g \\ h \\ i \end{pmatrix}|= \alpha \end{align} $$Find where: i) $L_{1}$ is tangent to $S$. ii) $L_{1}$ intersects $S$ twice. iii) $L_{1}$ doesn't intersect $S$.
Consider i). This occurs when:
Let $\vec{d}$ be the distance vector between the line and the sphere centre. Hence,
$$\begin{align} \vec{d}&=\begin{pmatrix} a \\ b \\ c \end{pmatrix} + \lambda \times \begin{pmatrix} d \\ e \\ f \end{pmatrix} - \begin{pmatrix} g \\ h \\ i \end{pmatrix} \\ &=\begin{pmatrix} a-g+\lambda d \\ b-h+\lambda e \\ c-i+\lambda f \end{pmatrix} \end{align} $$Consider (1), i.e. $|\vec{d}|=R$. Hence,
$$\begin{align} |\begin{pmatrix} a-g+\lambda d \\ b-h+\lambda e \\ c-i+\lambda f \end{pmatrix}|=\alpha \\ \therefore \sqrt{ (a-g+\lambda d)^{2} + (b-h+\lambda e)^{2} + (c-i+\lambda f)^{2} } = \alpha \end{align} $$Consider (2), i.e.
$$\vec{d} \cdot \begin{pmatrix} d \\ e \\ f \end{pmatrix} = 0 $$ $$\begin{align} \therefore d(a-g+\lambda d)+e(b-h+\lambda e)+f(c-i+\lambda f)=0 \end{align} $$Hence, solve lines (6) and (7) simultaneously using CAS, i.e.
$$\begin{cases} \sqrt{ (a-g+\lambda d)^{2} + (b-h+\lambda e)^{2} + (c-i+\lambda f)^{2} } = \alpha \\ -d(a-g+\lambda d)+e(b-h+\lambda e)+f(c-i+\lambda f)=0 \end{cases} \ \ \ \alpha, \lambda $$And thus: i) When $\alpha = \text{ans}$ (from simultaneous equation) ii) When $\alpha >\text{ans}$ iii) When $0<\alpha<\text{ans}$
Given that
$$\begin{align} L_{1}:& \ r=\begin{pmatrix} a \\ \beta \\ c \end{pmatrix} + \lambda \times \begin{pmatrix} d \\ e \\ f \end{pmatrix} \\ S:& \ |r-\begin{pmatrix} g \\ h \\ i \end{pmatrix}|= R \end{align} $$Find where: i) $L_{1}$ is tangent to $S$. ii) $L_{1}$ intersects $S$ twice. iii) $L_{1}$ doesn't intersect $S$.
This is exactly the same as above. Same principles, but now we are solving for $\beta$, and thus your answers will be slightly different.
In this case, we will get 2 solutions for $\beta$, which I will call $ans_{1}$ and $ans_{2}$, where $ans_{1} ans_{2}$.
Thus: i) When $\beta =ans_{1}$ or $\beta=ans_{2}$ ii) When $ans{1} < \beta < ans_{2}$ iii) When $\beta < ans_{1}$ or $\beta > ans_{2}$