Point to Line Distance 3D Calculator
Calculate the shortest distance from a point to a 3D line using a point and direction vector or two points on the line, with projection and closest point.
Point to line distance in 3D
In 3D, a line is defined by a point on the line and a direction vector. The shortest distance from an outside point to the line is found with a cross product or by projecting the point onto the line.
s is the line direction vector, M0 is the outside point, and M1 is a point on the line.
Projection and closest point
t is the parameter of the closest point on the line.
H is the foot of the perpendicular from the point to the line.
Examples
| Point | Line | Distance |
|---|---|---|
| (0, 2, 0) | through (0, 0, 0), direction (1, 0, 0) | 2 |
| (1, 1, 3) | through origin, direction (0, 0, 1) | about 1.414 |
| (2, 0, 0) | through (0, 0, 0) and (4, 0, 0) | 0 |
Frequently Asked Questions
Sources and References
- Point-Line Distance--3-DimensionalWolfram MathWorld
- Point-Line Distance in 3 DimensionsMathwords
- Distance from a point to a line in 3DGeoGebra
- Equations of Lines and Planes in SpaceOpenStax
Calculations are based on the listed reference sources. Links open in a new tab.
Related Tools
Find the perpendicular distance from a 2D point to a line, using standard form or two points on the line, with signed distance and closest point.
Calculate the Euclidean distance between two points in 2D or 3D coordinates, with midpoint, coordinate differences, Manhattan distance, Chebyshev distance, and angle.
Calculate the length of a line segment from endpoint coordinates in 2D or 3D, with midpoint, coordinate differences, direction vector, and a 2D preview.
Find where two 2D lines intersect from standard form, slope-intercept form, or two points on each line. The calculator also detects parallel and coincident lines.