Plane–sphere intersection
From Wikipedia, the free encyclopedia
In analytic geometry, the intersection of a plane and a sphere can be the empty set, a point, or a circle. Distinguishing these cases, and determining equations for the point and circle in the latter cases have use, for example, when calculating ray intersections in ray tracing.
To distinguish the cases, let us parametrize the plane as
- ax + by + cz + d = 0
and the sphere as
- (x − x0)2 + (y − y0)2 + (z − z0)2 − R2 = 0
In other words, c = (x0,y0,z0) is the center of the sphere and R>0 is its radius. Let D be the shortest distance from c to the plane, whence (see Plane)
This gives three cases:
- If D>R, the plane does not intersect the sphere.
- If D=R, the plane intersects the sphere at exactly one point.
- If D<R, the plane intersects the sphere on a circle.
To characterize the circle formed by the intersection when D≤R, let the center of the sphere be the origin (mathematics) of an XY plane P=(x,y,0). In this case D=0 and the sphere and the circle have the same radius and center, making the circle a great circle on the sphere.
Increasing D moves the plane perpendicular to some radius of the sphere, Rs. This also decreases the radius of the circle,Rc. Let the motion be in the negative Z direction. Let Rd be the displacement along Rs.
This places the center of the circle, Oc at (0,0,-Rd). The radius of the circle, Rc in terms of Rd is
When D=R this places Oc at (0,0,-R), which we know is a point since its radius is
These results may be generalized to motion along any radius of the sphere via linear transformations.