Plane

Also known as the ground in ancient flight simulators

    • Plane Equation: ax + by + cz = d.
    • If n = [a,b,c] : p·n = d.
    • n is perpendicular to the plane, the normal.
    • Distance a from plane to point q : a = q·n - d

Closest point q' on a plane to point q

    • Calculate distance between plane and closest point and then offset from q.
    • q' = q + (q·n - d ) n

Intersection of a plane and a sphere.

    • Get sphere center distance d from plane.
    • If d > radius then sphere in front of plane. If d < -radius then sphere behind plane. Otherwise it intersect the plane.