# Sphere and Line Intersection Calculator

## Points of Intersection

To find the points of intersection between a sphere and a line in 3D space, you can use the parametric equations of the line and substitute them into the equation of the sphere.The general equation of a sphere is \[(x - h)^2 + (y - k)^2 + (z - l)^2 = r^2 \quad (I) \], and the parametric equations of a line are \[x = x_0 + at \; , \; y = y_0 + bt \; , \; \text{and} \; z = z_0 + ct \quad (II) \].

The point(s) of intersection are found by solving the above system of equation as follows:

Substitute \( x ,y , z \) in equaion (I) by their expressions in (II) to obtain the equation: \[( x_0 + at - h)^2 + (y_0 + bt - k)^2 + (z_0 + ct - l)^2 = r^2 \] Expand the above equation to obtain a quadratic equation in one variable \( t \), solve it to find \( t \) and substitute into equations (II) to find the point of intersection \( (x,y,z) \)