The shortest way to a plane
In three dimensions, the distance from a point to a plane is the length of the perpendicular dropped from the point onto the plane. It is the shortest of all the distances from the point to points of the plane. This calculation appears in geometry homework, computer graphics, robotics and surveying.
The formula
A plane can be written as ax + by + cz + d = 0, where the vector n = (a, b, c) is perpendicular to the plane. For a point P(x₀, y₀, z₀):
Distance = |ax₀ + by₀ + cz₀ + d| ÷ √(a² + b² + c²)
Without the absolute value, the result is the signed distance: positive on the side the normal vector points to, negative on the other side.
Plane through three points
If the plane is defined by three points P₁, P₂ and P₃, the calculator takes the cross product of P₂ − P₁ and P₃ − P₁ to get a normal vector (a, b, c), then sets d = −(a x₁ + b y₁ + c z₁). If the three points are on one line, the cross product is zero and they do not define a unique plane.
Foot of the perpendicular and reflection
With t = (ax₀ + by₀ + cz₀ + d) ÷ (a² + b² + c²):
- Foot of the perpendicular (the closest point of the plane): P − t n
- Mirror image of P through the plane: P − 2t n
Worked example
The plane 2x − y + 2z − 3 = 0 and the point (4, 1, 5):
- Numerator: 2 × 4 − 1 + 2 × 5 − 3 = 14.
- Length of the normal: √(4 + 1 + 4) = 3.
- Distance: 14 ÷ 3 = 4.6667.
- The signed distance is positive, so the point is on the side the normal (2, −1, 2) points to.
- t = 14 ÷ 9 = 1.556, so the foot of the perpendicular is (0.8889, 2.5556, 1.8889).
- The mirror image is (−2.2222, 4.1111, −1.2222).
The same plane passes through (1.5, 0, 0), (0, −3, 0) and (0, 0, 1.5); entering those three points gives the same distance.
Where it is used
- Computer graphics and games: deciding which side of a wall or clipping plane an object is on, and collision detection.
- Robotics and CAD: measuring how far a tool or part is from a surface.
- Surveying and point clouds: fitting a plane to a floor or roof and measuring deviations.
- Machine learning: the distance from a point to a separating hyperplane is the margin in support vector machines.
In two dimensions the same idea gives the distance from a point to a line, |ax₀ + by₀ + c| ÷ √(a² + b²), available in the point-line distance calculator.