Distance from a Point to a Line
Online calculator for the Euclidean distance between point and line
Point-Line Distance Calculator
Euclidean Distance
Calculates the shortest distance from a point C to an infinite line through points A and B using the perpendicular method.
Visualization

The graphic shows the shortest distance as a perpendicular line from the point to the line.
The perpendicular forms a right angle to the original line.
What is the Distance from a Point to a Line?
The distance is the shortest distance between a point and a line:
- Shortest path: Always perpendicular to the line
- Perpendicular method: Right angle to the original line
- Infinite line: Endpoints are not considered
- Euclidean geometry: Standard method in the plane
- Always unique: There is only one shortest distance
- Positive value: Distance is always ≥ 0
Euclidean Distance and Mathematical Derivation
The calculation is done using the perpendicular foot method of analytical geometry:
Line Equation
Parametric form of the line through A and B
Foot of Perpendicular
Perpendicular from point to line
The Perpendicular Method Step by Step
The perpendicular method is the mathematically exact method for distance calculation:
Step 1: Direction Vector
Determine direction of the line
Step 2: Foot of Perpendicular
Parameter for the foot of perpendicular
Formulas for Point-Line Distance
Distance Formula (Coordinate Form)
For line in normal form: ax + by + c = 0
Distance Formula (Vector Form)
Via cross product in 2D (determinant)
Determinant Form
Direct calculation from coordinates
Calculate Foot of Perpendicular
Coordinates of the foot of perpendicular
Example
Example Calculation
Calculation
Direction and connection vector
Determinant
Cross product in 2D
Result
The distance is approximately 4.03 units
Applications
Computer graphics, robotics, navigation, collision detection, CAD systems.
Point-Line Distance in Practice
The distance from a point to a line is a fundamental problem in analytical geometry. It describes the shortest distance between a given point and an infinitely extended straight line in two-dimensional space.
Mathematical Foundations
The shortest distance from a point to a line is always the perpendicular distance. This means that the connecting line from the point to the nearest point on the line (the so-called foot of perpendicular) forms a right angle to the original line.
The Perpendicular Method
The mathematically exact calculation is done using the perpendicular method:
- Direction vector: Determining the direction of the line through points A and B
- Foot of perpendicular: Finding the point on the line that is closest to the given point
- Distance calculation: Calculating the distance between the given point and the foot of perpendicular
Important Properties
Uniqueness
For every point, there is exactly one shortest distance to a line.
Infinite Line
The calculation refers to an infinitely extended line, not just the segment between the two points.
Right Angle
The shortest distance is always perpendicular to the original line.
Positive Values
The distance is always a positive number or zero (if the point lies on the line).
Practical Applications
Point-line distance calculation is found in many practical areas:
- Computer graphics: Collision detection, rendering, distance calculations
- Robotics: Path planning, obstacle avoidance, navigation
- CAD/CAM: Technical drawings, tolerance calculations
- GIS (Geographic Information Systems): Distances to roads, boundaries
- Mechanical engineering: Fits, distances in mechanical components
- Architecture: Distance calculations in building plans
Special Cases
Point on the Line
Distance = 0
The point lies exactly on the line
Horizontal Line
Distance = |y₀ - y_line|
Simple Y-difference
Vertical Line
Distance = |x₀ - x_line|
Simple X-difference
|