Result with a radical
- Input
- P(4, 5), 2x - y + 1 = 0
- Expected output
- d = 4√5/5 ≈ 1,7889
H = (2.4, 5.8).
distance from a point to a line
Open the Point and line tab, type P and the line equation in any form (such as 2x - y + 1 = 0 or y = 2x + 1). The result gives the distance with a rationalized radical, the foot of the perpendicular H and the full drawing.
H = (2.4, 5.8).
√(3² + 4²) = 5.
2/√2 = √2.
Equivalent to 2x - y + 1 = 0.
Use the Two lines tab.
2 - 3 + 1 = 0.
Use d = √((x₂ - x₁)² + (y₂ - y₁)²), which is the Pythagorean theorem applied to the coordinate differences. Between A(1, 2) and B(5, 4): d = √(4² + 2²) = √20 = 2√5 ≈ 4.4721. The calculator simplifies the radical by pulling perfect squares out of the root (20 = 4 · 5) and shows the decimal next to it.
Without the absolute value the numerator comes out positive or negative depending on which side of the line the point is on, and distance has no sign. The signed value is useful for telling whether two points are on the same side of the line.
It is just the absolute coordinate difference: to x = k, d = |x₀ - k|; to y = k, d = |y₀ - k|. The general formula gives the same value because the denominator becomes √1 = 1.
Compute the distance from the center to the line and compare it with the radius: equal means tangent, smaller means secant, larger means outside. The Circle tab runs this test in the Relative position field.
2√5
≈ 4.4721
(3, 3)
1/2
≈ 0.5
26.5651°
50%
All calculation happens in your browser. Nothing you type is sent to a server.