Point Line Plane Distance Calculator
Use z = 0 for 2D point-line calculations. Lines use parametric form P + t v; planes use Ax + By + Cz + D = 0.
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.
Use z = 0 for 2D point-line calculations. Lines use parametric form P + t v; planes use Ax + By + Cz + D = 0.
▼ See explanations and tips below ▼
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
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.
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:
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.
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
A plane can be written as
where \(\mathbf{n}=\langle A,B,C \rangle\) and \(\mathbf{X}=\langle x,y,z \rangle\).
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:
For a point \(\mathbf{P}\) and a line through \(\mathbf{P}_0\) with direction vector \(\mathbf{v}\), the distance is
The closest point on the line is the orthogonal projection of the point onto the line. Its parameter is
and the nearest line point is
For a point \(\mathbf{P}=(x_0,y_0,z_0)\) and plane \(Ax+By+Cz+D=0\), the distance is
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:
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
If nonparallel lines meet at a point, their shortest distance is \(0\).
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
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.
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,
and
the distance is
If the parallel planes have distance \(0\), they are identical.
Let
Use the 3D distance formula:
The points are 5 coordinate units apart.
Let
and let the plane be
Here, \(A=1\), \(B=2\), \(C=2\), and \(D=-5\). The distance is
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:
Let the first line be
and the second line be
The direction vectors are
Their cross product is
Using \(\mathbf{P}_1=(0,0,0)\) and \(\mathbf{P}_2=(0,2,3)\), the distance is
These lines do not intersect and are not parallel, so they are skew. Their shortest distance is 3 coordinate units.
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.
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.
Use this concept when you need to:
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.
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.
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.
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.
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.
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.
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\).
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.
Books and Open Textbooks
Online and Official Sources