proof with intersection of plane and sphere. Looking at ancient mathematics and astronomy they used spherical geometry. and it states they knew an intersection of a plane and a sphere would give a circle unless of course it's tangent to the sphere. So In trying to prove this I would like to know how to prove that when you intersect a sphere and a plane you can draw a perpendicular line to the plane from the center of the sphere to a point of intersection between the sphere and plane.
 A: In 3-D (Euclidean) geometry, given a plane and a point, there's always exactly one line which is perpendicular to the plane and goes through the point. (This is true whether the point is in the plane or out of the plane.)
This step is just using the center of the sphere as that point, but finding the line really has nothing to do with the sphere.
Then of course any line through the sphere's center will intersect the sphere at exactly two points.
A: Suppose you are given the plane $ n \cdot (r - r_0) = 0 $ where $r =[x,y,z]^T$
and the sphere
$$ x^2 + y^2 + z^2 = R^2 $$
This last equation can be written as $r^T r = R^2 $
where $R$ is the radius of the sphere.
Now, given any normal vector $n$, one can find unit vectors such that
$ u_1 \cdot n = u_2 \cdot n = u_1 \cdot u_2 = 0 $
Since $u_1, u_2$ are perpendicular to the plane normal, and are linearly independent (because they are perpendicular to each other), then the point on the plane can be
expressed as
$ r = r_0 + t_1 u_1 + t_2 u_2 $
Where $t_1, t_2 \in \mathbb{R} $.  Substitute this $r$ into the equation of the sphere,
$ (r_0 + t_1 u_1 + t_2 u_2) \cdot (r_0 + t_1 u_1 + t_2 u_2) = R^2 $
The left hand side simplifies to
$ r_0^T r_0 + 2 r_0^T (t_1 u_1 + t_2 u_2) + t_1^2 + t_2^2 = R^2 $
And by completing the squares in $t_1$ and $t_2$ this becomes
$ (t_1 + r_0^T u_1)^2 + (t_2 + r_0^T u_2)^2 = R^2 + (r_0^T u_1)^2 + (r_0^T u_2)^2 - r_0^T r_0 $
Note that the square of the distance between the origin (which is the center of the sphere) and the plane is given by
$ d^2 = (n^T r_0)^2$
where it has been assumed without loss of generality that $n $ a unit vector.
As such, $ n = u_1 \times u_2$.  Further, Since $u_1, u_2, n$ form an orthonormal basis of $\mathbb{R}^3 $, we can write
$r_0 = r_1 u_1 + r_2 u_2 + r_3 (u_1 \times u_2) $
From which
$ r_0 \cdot u_1 = r_1 ,\hspace{8pt} r_0 \cdot u_2 = r_2,\hspace{8pt} r_0 \cdot n = r_0 \cdot (u_1 \times u_2) = r_3 $
Note $r_0^T r_0 = r_1^2 + r_2^2 + r_3^2  $
Hence the equation of the intersection now becomes
$ (t_1 + r_1)^2 + (t_2 + r_2)^2 = R^2  - r_3^2 $
but $r_3^2 = d^2 $, therefore,
$ (t_1 + r_1)^2 + (t_2 + r_2)^2 = R^2 - d^2 $
And this an equation of a circle in the $u_1, u_2$ plane passing through $r_0$ with a radius equal to $\sqrt{R^2 - d^2} $.  This clearly shows that we have a circular intersection only if $d \lt R$, and the intersection will be a point if $R = d$, and the intersection will be void (an empty set) if $ d \gt R $.
