<s>[INST] Find $a$ so that a line is tangent, secant or external from a sphere I am given the following problem:

Given the line $$r \{ R = (1,0,a) + \lambda [a \quad a \quad 0]$$ and the sphere $$S \{ 8x^2 + 8y^2 +8z^2 - 16x +24y -8z + 19 = 0$$ find, relating to values of $a$, when the line is external, tangent and secant to the sphere.

I completed the square on the sphere's equation for some clarity
$$(x-1)^2 + \left( y + \frac{3}{2} \right)^2 + \left( z - \frac{1}{2} \right)^2 = \frac{9}{8}$$
which gave me a center $C = \left( 1 , - \frac{3}{2}, \frac{1}{2} \right)$ and a radius $r = \frac{3}{2 \sqrt{2}}$.
To evaluate when a line is external or not to a sphere one must relate the distance of the center of the sphere to the line and check if it is greater (or not) than the radius. And my question is: how can I do that given the fact that the line has two variables?
Is the problem not well-made?
 [/INST] let $u$ be the vector from $(1,0,a)$ to the center of the circle (1,-\frac 32, \frac 12)
$u = (0,-\frac 32, \frac 12-a)$ 
let $v$ be the direction vector of the line. $(a,a,0)$
$\frac {u\cdot v}{v\cdot v} v$ will give the projection of $u$ onto $v$
$u - \frac {u\cdot v}{v\cdot v} v$ will be orthogonal to $v$ and be the shortest vector from the line to the center of the circle 
If the magnitude of this vector equals the radius of the circle:
$\|u - \frac {u\cdot v}{v\cdot v} v\| = \sqrt{\frac 98}$
Then our line will be tangent.
$\|(0,-\frac 32, \frac 12-a) - \frac {-\frac 32 a}{2a^2} (a,a,0)\|\\
\|(0,-\frac 32, \frac 12-a) + (\frac 34,\frac 34,0)\|\\
\|(\frac 34,-\frac 34, \frac 12-a)\|\\
\frac {9}{16} + \frac {9}{16} + (\frac 12 - a)^2 = \frac 98\\
(\frac 12 - a)^2 = 0\\
a = \frac 12$
</s>