Point to Plane Distance (3D) — Perpendicular Distance

Compute the shortest distance from a point to a plane. Private by design—everything runs locally in your browser.

Point, Plane & Actions

d = —

Formula (standard form): d = |A x₀ + B y₀ + C z₀ + D| / √(A² + B² + C²). Toggle Signed distance to see the sign relative to the plane’s normal.

Preview

Simple axonometric view. The blue patch is the plane, the red segment is the perpendicular from the point to the plane, and the teal arrow shows the plane’s normal direction.

Learn more: distance from a point to a plane (3D)

In analytic geometry, the shortest distance from a point to a plane is measured along a line that is perpendicular to the plane. If the plane is written in standard form A x + B y + C z + D = 0 and the point is P = (x₀, y₀, z₀), the (unsigned) distance is

d = |A x₀ + B y₀ + C z₀ + D| / √(A² + B² + C²)

This formula is scale-invariant: multiplying all plane coefficients by the same nonzero number doesn’t change d, because numerator and denominator scale together. The sign of A x₀ + B y₀ + C z₀ + D tells you on which side of the oriented plane the point lies; drop the absolute value to get the signed distance:

dₛ = (A x₀ + B y₀ + C z₀ + D) / √(A² + B² + C²)

Where does the formula come from?

The vector n = (A, B, C) is a normal to the plane. Any point Q on the plane satisfies A Qₓ + B Qᵧ + C Q_z + D = 0. The displacement from Q to P is v = P − Q. Projecting v onto n gives the component perpendicular to the plane: (v · n)/‖n‖. Replace v · n with (P · n) − (Q · n) = A x₀ + B y₀ + C z₀ + D and take absolute value to get the shortest (unsigned) distance. The same projection also yields the perpendicular foot (closest point) on the plane:

k = (A x₀ + B y₀ + C z₀ + D) / (A² + B² + C²)
F = (x₀ − A k,  y₀ − B k,  z₀ − C k)
  

Other plane descriptions you can use

  • Point + normal: given a plane point Pₚ and normal n, set (A,B,C) = n and D = −n · Pₚ, then apply the core formula.
  • Three points: with non-collinear P₁, P₂, P₃, compute n = (P₂ − P₁) × (P₃ − P₁), then D = −n · P₁. Collinear or repeated points are invalid.

Worked example

Let P = (2, −1, 0.5) and the plane 2x − y + 2z − 3 = 0. Then n = (2, −1, 2), ‖n‖ = √(4 + 1 + 4) = 3, and the numerator is |2·2 + (−1)·(−1) + 2·0.5 − 3| = |4 + 1 + 1 − 3| = 3. Therefore d = 3 / 3 = 1. The foot uses k = (A x₀ + B y₀ + C z₀ + D)/(A²+B²+C²) = 3/9 = 1/3, so F = (2 − 2·1/3, −1 − (−1)·1/3, 0.5 − 2·1/3) = (4/3, −2/3, −1/6).

Numerical tips & pitfalls

  • Degenerate planes: standard form with A=B=C=0 or a zero normal vector is invalid.
  • Stability: if your coordinates are very large or very small, distances can lose precision in floating-point; rescale your data (meters → kilometers, etc.) if needed.
  • Normalization: you do not need to normalize (A,B,C) because the formula divides by ‖n‖ automatically.
  • Signed vs. unsigned: signed distance is handy for orientation tests (e.g., which side of a cutting plane a point lies on); for pure “how far,” use the unsigned value.

Where this shows up

Point-to-plane distance is everywhere: CAD “snap to surface,” camera pose residuals in computer vision, collision detection and steering behaviors in robotics/games, fitting planes to noisy 3D scans, geospatial offsets to terrain surfaces, and quality checks in manufacturing metrology.

Privacy note: everything on this page runs locally in your browser—no inputs are uploaded.

5 Fun Facts about Point-to-Plane Distance

Projection in one line

d = |A x₀ + B y₀ + C z₀ + D| / √(A² + B² + C²) is just a dot-product projection onto the plane’s normal—linear algebra hiding as geometry.

Dot power

Signed distance fields

Drop the absolute value and you get a signed distance field (SDF) to a plane—core to smooth text, shaders, and collision buffers.

SDF ready

Plane from three points

Any three non-collinear points define a unique plane; the normal is the cross product of two edge vectors. Distance piggybacks on that normal.

Cross-product roots

Scale doesn’t matter

Multiply A,B,C,D by any nonzero constant and the distance is unchanged—numerator and denominator scale together.

Scale invariant

Robotics staple

Point-to-plane residuals drive ICP scan matching and plane constraints in SLAM: a tiny distance term helps robots keep their maps aligned.

SLAM link

Explore more tools