Point Line Plane Distance Calculator

Use this Point Line Plane Distance Calculator to enter values, adjust options, and review results in a compact responsive workspace.

Results are calculated automatically as you enter data.

Point Line Plane Distance Calculator

Point P
Point Q

Use z = 0 for 2D point-line calculations. Lines use parametric form P + t v; planes use Ax + By + Cz + D = 0.

Shortest distance Enter geometric objects.
Formula steps

▼ See explanations and tips below ▼

What Are Shortest Distances Between Points, Lines, and Planes?

In three-dimensional analytic geometry, distance means the length of the shortest straight segment connecting two geometric objects. The objects may be two points, a point and a line, a point and a plane, two lines, a line and a plane, or two planes.

The key idea is perpendicularity. The shortest route from a point to a line is perpendicular to the line. The shortest route from a point to a plane is perpendicular to the plane. When two objects intersect or coincide, their shortest distance is \(0\) because they share at least one point.

A point is represented by a coordinate triple such as \((x,y,z)\). A line in space is represented by a point on the line and a nonzero direction vector. A plane is represented by an equation such as

$$ Ax + By + Cz + D = 0 $$

where \((A,B,C)\) is the plane's normal vector. Distances are measured in the same coordinate unit as the inputs. If the coordinates are in meters, the distance is in meters. If the coordinates are unitless, the distance is also unitless.


Why Shortest-Distance Geometry Matters

Shortest-distance calculations help turn a drawing or word problem into a precise numerical answer. Students use them in vector geometry, calculus, and linear algebra. Technical users use the same ideas when checking idealized distances between modeled lines, planes, axes, surfaces, paths, or reference features.

These calculations are also useful because they separate two questions that are easy to confuse:

  • Do the objects intersect, coincide, or lie on each other?
  • If they do not, how far apart are they at the closest point?

For example, two planes that are not parallel must intersect, so their shortest distance is \(0\). Two nonparallel lines in three dimensions may intersect, but they may also be skew: not parallel and not crossing. Skew lines can have a positive shortest distance.


Key Terms to Know

  • Cartesian coordinates: A way to locate points using \((x,y,z)\) values measured along perpendicular axes.
  • Vector: A quantity with magnitude and direction, often written as a component triple such as \(\langle 2,-1,4 \rangle\).
  • Vector norm: The length of a vector, written as \(\lVert \mathbf{v} \rVert\).
  • Direction vector: A nonzero vector that gives the direction of a line.
  • Normal vector: A vector perpendicular to a plane. For \(Ax + By + Cz + D = 0\), the normal vector is \(\mathbf{n}=\langle A,B,C \rangle\).
  • Dot product: A vector operation that helps measure angles, perpendicularity, and projection.
  • Cross product: A vector operation in 3D that gives a vector perpendicular to two input vectors.
  • Projection: The process of finding the component of one vector in the direction of another vector.
  • Line parameter: A scalar such as \(t\) that locates a point on a parameterized line.
  • Skew lines: Lines in three-dimensional space that are not parallel and do not intersect.

How Shortest-Distance Calculations Work

The calculation depends on how the objects are represented. The formulas below use bold letters for points and vectors.

A line through point \(\mathbf{P}_0\) with direction vector \(\mathbf{v}\) can be written as

$$ \mathbf{L}(t)=\mathbf{P}_0+t\mathbf{v} $$

A plane can be written as

$$ \mathbf{n}\cdot\mathbf{X}+D=0 $$

where \(\mathbf{n}=\langle A,B,C \rangle\) and \(\mathbf{X}=\langle x,y,z \rangle\).

Point to point

The distance between \(\mathbf{P}=(x_1,y_1,z_1)\) and \(\mathbf{Q}=(x_2,y_2,z_2)\) is the 3D distance formula:

$$ d=\sqrt{(x_2-x_1)^2+(y_2-y_1)^2+(z_2-z_1)^2} $$

Point to line

For a point \(\mathbf{P}\) and a line through \(\mathbf{P}_0\) with direction vector \(\mathbf{v}\), the distance is

$$ d=\frac{\lVert (\mathbf{P}-\mathbf{P}_0)\times\mathbf{v} \rVert}{\lVert \mathbf{v} \rVert} $$

The closest point on the line is the orthogonal projection of the point onto the line. Its parameter is

$$ t=\frac{(\mathbf{P}-\mathbf{P}_0)\cdot\mathbf{v}}{\mathbf{v}\cdot\mathbf{v}} $$

and the nearest line point is

$$ \mathbf{P}_0+t\mathbf{v} $$

Point to plane

For a point \(\mathbf{P}=(x_0,y_0,z_0)\) and plane \(Ax+By+Cz+D=0\), the distance is

$$ d=\frac{|Ax_0+By_0+Cz_0+D|}{\sqrt{A^2+B^2+C^2}} $$

The numerator before taking the absolute value is signed. Its sign tells which side of the plane the point is on relative to the chosen normal vector. The distance itself is never negative.

The nearest point on the plane is the perpendicular foot:

$$ \mathbf{P}-\frac{\mathbf{n}\cdot\mathbf{P}+D}{\mathbf{n}\cdot\mathbf{n}}\mathbf{n} $$

Line to line

For two lines, the relationship matters first.

If the direction vectors are parallel, the distance between the lines can be found by measuring from a point on one line to the other line. If that distance is \(0\), the lines coincide.

If the direction vectors are not parallel, the cross product \(\mathbf{v}_1\times\mathbf{v}_2\) gives a direction perpendicular to both lines. For skew lines, the distance is

$$ d=\frac{|(\mathbf{P}_1-\mathbf{P}_2)\cdot(\mathbf{v}_1\times\mathbf{v}_2)|}{\lVert \mathbf{v}_1\times\mathbf{v}_2 \rVert} $$

If nonparallel lines meet at a point, their shortest distance is \(0\).

Line to plane

For a line \(\mathbf{P}_0+t\mathbf{v}\) and a plane with normal vector \(\mathbf{n}\), the dot product \(\mathbf{n}\cdot\mathbf{v}\) determines the relationship.

If \(\mathbf{n}\cdot\mathbf{v}\ne 0\), the line intersects the plane, so the distance is \(0\). The intersection parameter is

$$ t=-\frac{\mathbf{n}\cdot\mathbf{P}_0+D}{\mathbf{n}\cdot\mathbf{v}} $$

If \(\mathbf{n}\cdot\mathbf{v}=0\), the line is parallel to the plane. Then the distance is found from any point on the line to the plane. If that distance is \(0\), the line lies in the plane.

Plane to plane

Two planes either intersect or are parallel. If their normal vectors are not parallel, the planes intersect in a line, so the distance is \(0\).

If the planes are parallel, the distance can be found by taking any point on one plane and measuring its point-to-plane distance to the other plane. When two parallel planes are written with the same \((A,B,C)\) coefficients,

$$ Ax+By+Cz+D_1=0 $$

and

$$ Ax+By+Cz+D_2=0 $$

the distance is

$$ d=\frac{|D_2-D_1|}{\sqrt{A^2+B^2+C^2}} $$

If the parallel planes have distance \(0\), they are identical.


Examples of Shortest Distance in Practice

Example 1: Distance between two points

Let

$$ P=(1,2,3), \quad Q=(4,6,3) $$

Use the 3D distance formula:

$$ d=\sqrt{(4-1)^2+(6-2)^2+(3-3)^2} $$
$$ d=\sqrt{9+16+0}=\sqrt{25}=5 $$

The points are 5 coordinate units apart.


Example 2: Distance from a point to a plane

Let

$$ P=(4,-1,2) $$

and let the plane be

$$ x+2y+2z-5=0 $$

Here, \(A=1\), \(B=2\), \(C=2\), and \(D=-5\). The distance is

$$ d=\frac{|1(4)+2(-1)+2(2)-5|}{\sqrt{1^2+2^2+2^2}} $$
$$ d=\frac{|4-2+4-5|}{\sqrt{9}}=\frac{1}{3} $$

The point is \(1/3\) coordinate unit from the plane. The nearest point on the plane is found by moving from \(\mathbf{P}\) in the normal-vector direction until the plane is reached:

$$ (4,-1,2)-\frac{1}{9}(1,2,2)=\left(\frac{35}{9},-\frac{11}{9},\frac{16}{9}\right) $$

Example 3: Distance between skew lines

Let the first line be

$$ \mathbf{L}_1(s)=(0,0,0)+s(1,0,0) $$

and the second line be

$$ \mathbf{L}_2(t)=(0,2,3)+t(0,1,0) $$

The direction vectors are

$$ \mathbf{v}_1=(1,0,0), \quad \mathbf{v}_2=(0,1,0) $$

Their cross product is

$$ \mathbf{v}_1\times\mathbf{v}_2=(0,0,1) $$

Using \(\mathbf{P}_1=(0,0,0)\) and \(\mathbf{P}_2=(0,2,3)\), the distance is

$$ d=\frac{|(\mathbf{P}_1-\mathbf{P}_2)\cdot(\mathbf{v}_1\times\mathbf{v}_2)|}{\lVert \mathbf{v}_1\times\mathbf{v}_2 \rVert} $$
$$ d=\frac{|(0,-2,-3)\cdot(0,0,1)|}{1}=3 $$

These lines do not intersect and are not parallel, so they are skew. Their shortest distance is 3 coordinate units.


How to Interpret the Result

The distance is the length of the shortest segment connecting the selected objects. It is always nonnegative and uses the same unit or scale as the coordinate inputs.

A distance of \(0\) needs context. It may mean two points coincide, a point lies on a line, a point lies on a plane, two lines intersect, a line lies in a plane, two planes intersect, or two planes are identical. Use the relationship classification together with the distance.

The nearest-point outputs are the endpoints of the measured shortest segment. When the distance is positive, they are usually different points. When the distance is \(0\), the nearest points may be the same point or representative points on coincident objects.

Line parameters such as \(t\) or \(s\) locate the nearest or intersection point on a parameterized line. A parameter is not a distance by itself; it tells how far to move along the line's direction vector from the line's starting point.

For point-to-plane results, the signed numerator \(Ax_0+By_0+Cz_0+D\) tells which side of the plane the point is on relative to the normal vector \((A,B,C)\). The absolute value of that signed quantity is used in the distance formula.

Displayed numbers are rounded to at most 6 decimal places, with trailing zeros removed. Very small values close to zero may display as 0, so classifications near a boundary should be interpreted with numerical tolerance in mind.


Common Mistakes and Misconceptions

Using a zero direction vector for a line. A line needs a direction. A vector such as \((0,0,0)\) has no direction, so it cannot define a line.

Using \(A=B=C=0\) for a plane. In \(Ax+By+Cz+D=0\), the vector \((A,B,C)\) is the normal vector. If all three coefficients are zero, there is no valid plane normal.

Entering two segment endpoints as if they defined a finite segment. A point and a direction vector define an infinite line. If you have endpoints \(\mathbf{A}\) and \(\mathbf{B}\), the direction vector is \(\mathbf{B}-\mathbf{A}\), but the calculation still treats the object as the full infinite line, not the segment between the endpoints.

Mixing units or scales. All coordinates must use the same scale. Do not mix meters with centimeters, inches with feet, or model coordinates with real-world coordinates unless they have been converted consistently.

Using the wrong sign for \(D\). The plane equation must be in the form \(Ax+By+Cz+D=0\). For example, \(x+2y+z=7\) should be entered as \(x+2y+z-7=0\), so \(D=-7\).

Thinking plane coefficients must be normalized. They do not. The equations \(x+2y+2z-5=0\) and \(2x+4y+4z-10=0\) describe the same plane. Distance formulas divide by the normal-vector length, so scaled equivalent equations give the same geometric distance.

Forgetting the \(z\) coordinate. Even 2D-style examples are handled as 3D inputs. For a flat xy-plane problem, use \(z=0\) where appropriate.


When to Use Shortest-Distance Geometry

Use this concept when you need to:

  • Measure the distance between two points in 3D coordinates.
  • Find the perpendicular distance from a point to a line or plane.
  • Check whether a point lies on a line or plane.
  • Determine whether lines are parallel, intersecting, coincident, or skew.
  • Determine whether a line intersects, lies in, or is parallel to a plane.
  • Determine whether two planes intersect, are identical, or are distinct and parallel.
  • Verify vector-geometry homework or compare a manual calculation with a numerical result.
  • Estimate clearance between idealized infinite lines or planes in a model.

For physical design, construction, surveying, machining, robotics, or safety-critical work, treat the result as a mathematical check only. Real objects have thickness, tolerances, measurement error, and constraints that may not be represented by ideal points, infinite lines, and infinite planes.


Limitations and Things to Keep in Mind

These formulas assume ordinary Euclidean 3D Cartesian geometry. They do not apply to curved surfaces, spherical geometry, map projections, or non-Euclidean spaces.

Lines are treated as infinite lines, not finite segments or rays. Planes are treated as infinite planes, not bounded rectangles, polygons, walls, slabs, or surfaces with edges.

No unit conversion is performed. The distance has the same unit as the coordinate inputs, so the inputs must already use a consistent scale.

The calculation is numerical, not symbolic. Results are displayed as decimals or coordinate triples, not exact radicals or rational simplifications unless the decimal happens to be exact in the displayed format.

Zero and parallel classifications depend on numerical tolerances. A result that is extremely close to zero may be displayed or classified as zero. A line or plane that is almost parallel to another object may be treated according to the calculator's tolerance rather than exact symbolic geometry.

Very large values or nearly degenerate configurations can produce unstable results. Finite nonzero direction vectors and plane normals remain valid even when their components are very small or very large: internally, the calculator normalizes them before distance and projection calculations, so scale-equivalent inputs describe the same geometry. Double-check inputs and use exact algebra when a boundary case matters.


How to Use This Calculator

  1. Choose the distance type: point to point, point to line, point to plane, line to line, line to plane, or plane to plane.
  2. Enter point coordinates \((x,y,z)\) for each point required by the selected mode.
  3. For a line, enter one point on the line and a nonzero direction vector.
  4. For a plane, enter \(A\), \(B\), \(C\), and \(D\) for \(Ax+By+Cz+D=0\), making sure that \((A,B,C)\) is not the zero vector.
  5. Review the distance, relationship classification, and nearest-point outputs.
  6. Use the details table and calculation steps to check the formula, projection point, intersection point, line parameter, or plane relationship.
  7. Use the diagram download option if you need to save the visual shortest-distance diagram.

Frequently Asked Questions

What does a distance of 0 mean?

A distance of \(0\) means the selected objects share at least one point or coincide. The exact meaning depends on the mode: a point may lie on a line, a line may intersect a plane, or two planes may intersect in a line. Always read the relationship classification along with the distance.


Does this work for line segments or rays?

No. A line input represents an infinite line. Segment and ray distances need extra endpoint or direction restrictions, because the nearest point on the infinite line may fall outside the finite segment or outside the allowed part of the ray.


Can I multiply all plane coefficients by the same number?

Yes, as long as the multiplier is not zero. The equations \(Ax+By+Cz+D=0\) and \(kAx+kBy+kCz+kD=0\) describe the same plane when \(k\ne0\). The distance stays the same because the formula divides by the length of the normal vector.


Why can two nonparallel lines have a positive distance?

In a flat 2D plane, nonparallel lines must meet. In 3D space, nonparallel lines can pass by each other without crossing. Such lines are called skew lines, and their shortest distance is measured along a segment perpendicular to both lines.


Why do nonparallel planes have distance 0?

Two planes in 3D either are parallel or intersect. If their normal vectors are not parallel, they intersect in a line, so the minimum distance between them is \(0\).


What unit is the distance in?

The distance uses the same unit as the coordinate inputs. If all coordinates are in meters, the distance is in meters. If the coordinates are unitless model coordinates, the distance is in those same unitless coordinate units.


Sources and References

Books and Open Textbooks

  1. Gilbert Strang and Edwin “Jed” Herman. Calculus Volume 3. OpenStax, 2016. Chapter 2, Sections 2.2–2.5: vectors in three dimensions, dot product, cross product, equations of lines and planes in space, point-line distance, point-plane distance, parallel planes, and skew-line distance project. OpenStax Calculus Volume 3, Section 2.5
  2. Steven Schlicker, David Austin, and Matthew Boelkins. Active Calculus Multivariable. Grand Valley State University Libraries, 2017. Section 9.5, “Lines and Planes in Space.” Active Calculus Multivariable, Section 9.5

Online and Official Sources

  1. MIT OpenCourseWare. “Distances to planes and lines.” 18.02SC Multivariable Calculus, Fall 2010. MIT OCW PDF