StatGardenREF. DESK
Calculators/Maths/Distance from a point to a line
Maths

Distance from a point to a line calculator

Perpendicular distance from a point to a line given in general form.

What this calculator does

Distance from a point to a line works out perpendicular distance from a point to a line given in general form. Enter your own figures above and the answer updates as you type: nothing is fixed in the code, so the result reflects exactly the numbers you supply.

The formula this calculator evaluates is printed under the tool and explained below, so you can check the working by hand or reuse it in a spreadsheet.

The formula

FormulaLine: Ax + By + C = 0; distance = |Ax₀ + By₀ + C| / √(A² + B²)

The inputs explained

FieldWhat to enter
AA number. Starts at 1.
BA number. Starts at -1.
CA number. Starts at -2.
Point x₀A number. Starts at 5.
Point y₀A number. Starts at 1.

Worked examples

Every figure in the tables below is produced by this page’s own calculator at build time, so the numbers and the tool always agree. Select any row to load that scenario.

How the answer changes with a

Every other input is held at the calculator’s starting values while a varies. Select any row to load that scenario into the calculator.

How the answer changes with a
ADistanceFoot of the perpendicularLine
0.50.4472(5.200, 0.6000)Ax + By + C = 0
0.750.6000(4.640, 1.480)Ax + By + C = 0
11.414(4.000, 2.000)Ax + By + C = 0
1.52.496(2.923, 2.385)Ax + By + C = 0
23.130(2.200, 2.400)Ax + By + C = 0
33.795(1.400, 2.200)Ax + By + C = 0