GEOMETRYCoordinate GeometryMathematics Calculator

Point-to-Line Distance

The shortest distance from a point to a line is the perpendicular distance. Formula: d = |Ax₀ + By₀ + C| / √(A² + B²) for line Ax + By + C = 0. The foot of the perpendicular is the closest point on the line.

Concept Fundamentals
d = |Ax₀+By₀+C|/√(A²+B²)
Distance
Closest point on line
Foot
Indicates side of line
Signed
Shortest path
Perpendicular

Did our AI summary help? Let us know.

Distance is zero when the point lies on the line. Signed distance indicates which side of the line the point is on. Generalizes to point-to-plane in 3D.

Key quantities
d = |Ax₀+By₀+C|/√(A²+B²)
Distance
Key relation
Closest point on line
Foot
Key relation
Indicates side of line
Signed
Key relation
Shortest path
Perpendicular
Key relation

Ready to run the numbers?

Why: Point-to-line distance is used in collision detection, path planning, data fitting (regression residuals), and CAD for clearance checks. The perpendicular is always the shortest path.

How: For line Ax + By + C = 0 and point (x₀, y₀), compute d = |Ax₀ + By₀ + C| / √(A² + B²). The foot F is where the perpendicular from the point meets the line.

Distance is zero when the point lies on the line.Signed distance indicates which side of the line the point is on.

Run the calculator when you are ready.

Find Perpendicular DistanceEnter point and line coefficients

Sample Examples

Input

Point P(x₀, y₀) and line Ax + By + C = 0

Point

Line (Ax + By + C = 0)

Results

Perpendicular Distance
4.6
Shortest distance from point to line
Signed Distance
4.6
Foot X
-0.76
Foot Y
-0.68
Line
y = -0.75x - 1.25

Visualization

Visualization of the shortest distance from the point to the line

Step-by-Step

Line: 3x + 4y + 5 = 0

Point: P(2, 3)

Distance formula: d = |Ax₀ + By₀ + C| / √(A² + B²)

d = |23| / √25 = 4.6

Foot of perpendicular: F(-0.76, -0.68)

For educational and informational purposes only. Verify with a qualified professional.

🧮 Fascinating Math Facts

Perpendicular distance is always shortest.

— Geometry

F

Foot of perpendicular is the closest point.

— Property

Key Takeaways

  • The perpendicular distance is the shortest distance from a point to a line.
  • Formula: d=fracAx0+By0+CsqrtA2+B2d = \\frac{|Ax_0 + By_0 + C|}{\\sqrt{A^2 + B^2}} for line Ax+By+C=0Ax + By + C = 0.
  • The foot of the perpendicular is the closest point on the line to the given point.
  • Signed distance indicates which side of the line the point lies on.
  • For horizontal/vertical lines, the distance simplifies to a single coordinate difference.

Did You Know?

Finding the shortest path from a point to a road or boundary uses this formula.
Data fitting and regression use perpendicular distance for error margins.
Engineering designs use it for minimum clearance calculations.
Computer graphics and vision use proximity calculations extensively.
Robotics uses point-to-line distance for obstacle avoidance.
The formula generalizes to point-to-plane distance in 3D.

Understanding the Formula

Given a line in standard form Ax+By+C=0Ax + By + C = 0 and a point P(x0,y0)P(x_0, y_0), the perpendicular distance is:

d=fracAx0+By0+CsqrtA2+B2d = \\frac{|Ax_0 + By_0 + C|}{\\sqrt{A^2 + B^2}}

The foot of the perpendicular F(xf,yf)F(x_f, y_f) satisfies:

xf=fracB2x0ABy0ACA2+B2,quadyf=fracA2y0ABx0BCA2+B2x_f = \\frac{B^2 x_0 - AB y_0 - AC}{A^2 + B^2},\\quad y_f = \\frac{A^2 y_0 - AB x_0 - BC}{A^2 + B^2}

Expert Tips

For horizontal line y=k, distance = y0k|y_0 - k|, foot = (x0,k)(x_0, k).
For vertical line x=k, distance = x0k|x_0 - k|, foot = (k,y0)(k, y_0).
Ensure at least one of A or B is non-zero for a valid line.
Signed distance is positive on one side of the line, negative on the other.

FAQ

Q: What is the difference between distance and signed distance?
A: Distance is always non-negative. Signed distance indicates which side of the line the point is on.
Q: What if the point lies on the line?
A: The distance is zero and the foot coincides with the point.
Q: Can A and B both be zero?
A: No; that would not define a line. At least one must be non-zero.
Q: How do I convert y=mx+b to standard form?
A: Rewrite as mx - y + b = 0, so A=m, B=-1, C=b.
Q: What is the foot of the perpendicular?
A: The point on the line closest to the given point; the perpendicular from the point meets the line there.
Q: Does this work for 3D?
A: In 3D, use the point-to-plane distance formula for a line (plane perpendicular to line through point).
Q: Applications in real life?
A: Navigation, collision detection, CAD, and geometric modeling.

How to Use

  1. Enter the point coordinates (x₀, y₀).
  2. Enter the line coefficients A, B, C for Ax + By + C = 0.
  3. Click Calculate to get the perpendicular distance, foot, and signed distance.
  4. View the visualization to see the geometry.

Disclaimer

This calculator provides educational assistance. Verify critical calculations independently. At least one of A or B must be non-zero.

👈 START HERE
⬅️Jump in and explore the concept!
AI

Related Calculators