I am working in Cartesian coordinates, and have a known plane P in the form Ax + By + Cz = D and a sphere S in the form (x-x0)^2 + (y-y0)^2 + (z - z0)^2 = R^2. I have successfully solved for the circle of intersection between them using the method found here: Determine Circle of Intersection of Plane and Sphere
Assuming the plane and the radius of the sphere do not change, but the y-coordinate of the sphere's center can, I need to solve for the point of intersection between the plane and the sphere when they become a point of tangency instead of an intersecting circle.
That is to say, if the sphere can slide along the y-axis (the x and z coordinate of the center do not change) until it just touches the plane at a point, what is the y-coordinate of the sphere's center, and what is the location of the point where the sphere and the plane meet?
Thank you for any assistance you can provide.
YOu've got a radius $R$ sphere at location $P + t e_2$, where $P = (x_0, y_0, z_0)$, and $e_2 = (0, 1, 0)$, and you want to know "how far to move $P$" to make there sphere tangent to the plane $Ax + By + Cz + D = 0$, i.e., you want to find the value of $t$ that'll make the two tangent.
Just to be clear: there are two answers. Suppose you have a basketball and a thin glass tabletop. You can lower the basketball onto the tabletop, or you can raise it from below until it's tangent to the tabletop ... so two different displacements work.
Now for a solution.
The distance from the sphere-center to your plane is
$$ \frac{A\cdot x_0 + B \cdot (y_0 + t) + D \cdot z_0 + D}{\sqrt{A^2 + B^2 + C^2}} $$ You want that to be $R$. So you want \begin{align} R &= \frac{A\cdot x_0 + B \cdot (y_0 + t) + C \cdot z_0 + D}{\sqrt{A^2 + B^2 + C^2}}\\ R\sqrt{A^2 + B^2 + C^2} &= A\cdot x_0 + B \cdot (y_0 + t) + C \cdot z_0 + D\\ R^2\cdot (A^2 + B^2 + C^2) &= (A\cdot x_0 + B \cdot (y_0 + t) +C\cdot z_0 + D)^2\\ \end{align} Calling the stuff on the left hand side $E$, we want to solve \begin{align} E &= (A\cdot x_0 + B \cdot (y_0 + t) + c \cdot z_0 + D)^2\\ \end{align} for $t$. Letting $U = Ax_0+ By_0+ Cz_0 + D$, this becomes \begin{align} E &= ( U + B t)^2\\ \pm\sqrt{E} &= U + B t\\ -U \pm\sqrt{E} &= B t\\ \frac{-U \pm\sqrt{E}}{B} &= t\\ \end{align}
And for either of those two $t$ values, moving the circle center by distance $t$ along the $y$-axis will cause the circle and your plane to be tangent.
Note that if by some change, $B = 0$, then there's no solution; geometrically, it's clear why: In this case, the plane is vertical, and no amount of up/down movement will make the sphere get closer to or farther from it.