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 M₀ (the point to measure from)
    Point on the line M₁
    Direction vector s

    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.

    If the line is entered by two points, those points define an infinite line. This is not distance to a finite segment.

    Examples

    PointLineDistance
    (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

    Calculations are based on the listed reference sources. Links open in a new tab.

    Updated:

    Related Tools