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?
 A: The distance squared,
writing $c$ for $\lambda$, from
$R 
= (1,0,a) + c [a \quad a \quad 0]
= (1+ca,ca,a)
$
to
$C = \left( 1 , - \frac{3}{2}, \frac{1}{2} \right)
$
is
$\begin{array}\\
d^2
&=(1+ca-1)^2+(ca+\frac32)^2+(a-\frac12)^2\\
&=c^2a^2+c^2a^2+3ca+\frac94+a^2-a+\frac14\\
&=2c^2a^2+3ca+\frac52+a^2-a\\
\end{array}
$
For fixed $a$,
since
$\frac{\partial d^2}{\partial c}
=4ca^2+3a
$
and
$\frac{\partial^2 d^2}{\partial c^2}
=4a^2
> 0
$,
the minimum,
unless $a = 0$,
 is at
$4ca^2+3a = 0$
or
$c = -\frac{3}{4a}$
when
$\begin{array}\\
d^2 
&=2c^2a^2+3ca+\frac52+a^2-a \\
&=2\frac{9}{16a^2}a^2-3\frac{3}{4a}a+\frac52+a^2-a\\
&=\frac98-\frac{9}{4}+\frac52+a^2-a\\
&=\frac98+\frac14+a^2-a\\
&=\frac98+(a-\frac12)^2\\
\end{array}
$ 
From this,
$d^2 \ge \frac98$
and,
since
$r^2 = \frac98$,
it seems that
the line is never
inside the sphere
for any $a$
and is tangent to the sphere
when $a = \frac12$.
When $a=0$,
the line is just the point
$(1, 0, 0)$
with distance
$d^2 = \frac52$.
A: 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$
