Distance from point to line

Type A, B, C of the line Ax+By+C=0 and the point x, y. d = |Ax+By+C|/√(A²+B²). 3, 4, 5 and (0,0) give 1. 3, 4, −12 and (0,0) give 2.400000. 0, 1, 0 and (0,3) give 3.

Five fields: A, B, C, x, y. A fraction goes through six decimal places, so 2.4 shows as 2.400000. When A and B are zero the calculator returns 0.

Input data

Results

Enter data and click Calculate.

How it works

The distance from a point to the line Ax+By+C=0 is |Ax+By+C| over √(A²+B²). With A=3, B=4, C=5 and the point (0,0) you have |5|/5 = 1. The result is 1, because the result is an integer.

The fields are A, B, C, x, y. The IDs stay a, b, c, d, e. 3, 4, −12 and (0,0) give 12/5 = 2.4, on screen 2.400000. 0, 1, 0 and (0,3) is the x-axis and a point three up: 3.

When A=0 and B=0 the denominator is zero. The implementation returns 0, not a blank. That is not a distance of zero, only the branch on a degenerate line.

Distance between two points is on the neighbouring page and does not take A, B, C. The midpoint card builds the text M = (x, y). Here you always stay with one number.

The header units switch does not multiply anything. 3, 4, 5, 0, 0 stay 1 whatever the label says.

3, 4, 5 and (0,0) give 1. 3, 4, −12 and (0,0) give 2.400000. 0, 1, 0 and (0,3) give 3.

Formula

d = |Ax + By + C| / √(A²+B²), when A²+B² ≠ 0; otherwise 0

How to use

  1. Type A, B, C, for example 3, 4, 5, and the point x, y, for example 0, 0.
  2. Click Calculate. The distance is 1.
  3. 3, 4, −12 and (0,0) give 2.400000. 0, 1, 0 and (0,3) give 3.
  4. When A and B are zero, the result is 0.
  5. Distance between two points, with no line, lives on the neighbouring card.

3, 4, 5 and (0,0) give 1

d = |Ax+By+C|/√(A²+B²). 3, 4, 5 and (0,0) give 1. 3, 4, −12 and (0,0) give 2.400000. A=B=0 returns 0.

line
Ax+By+C=0. 3, 4, 5 with (0,0) give 1. 3, 4, −12 give 2.400000.
point
Fields x and y. (0,3) with A=0, B=1, C=0 gives 3.
denominator
√(A²+B²). When A and B are zero the calculator returns 0.

Examples

Example 1

  • A = 3
  • B = 4
  • C = 5
  • (0, 0)

1

What is it from (0,0) to 3x+4y+5=0? 1. |5|/5.

Example 2

  • A = 3
  • B = 4
  • C = −12
  • (0, 0)

2.400000

What is it from (0,0) to 3x+4y−12=0? 2.400000. 12/5 and six decimal places.

Example 3

  • A = 0
  • B = 1
  • C = 0
  • (0, 3)

3

What is it from (0,3) to the x-axis? 3. The line y = 0.

Related calculators

Common questions

What is it from (0,0) to 3x+4y+5=0?

1. |5|/√(9+16) = 1.

What does distance from a point to a line mean?

|Ax+By+C| over √(A²+B²). The line in general form, the point (x, y).

What about 3, 4, −12 and (0,0)?

2.400000. 12/5. A fraction goes through six decimal places.

What about (0,3) to y = 0?

3. Typed 0, 1, 0 and the point (0,3).

What if A and B are zero?

The denominator is zero. The calculator returns 0, not a blank.

Which field is the point x?

The fourth. The fifth is y. The first three are A, B, C.

Does 1 get six zeros?

No. An integer result goes as the string 1. A fraction as six decimal places.

How is this different from distance between two points?

A line and a point here. Two points there, no A, B, C.

Does a point on the line give zero?

Yes. 3, 4, 5 and a point on that line give 0 when the typed values are clean.

Does a comma in −12.0 work?

Yes. −12 and −12.0 are the same C.

Knowledge sources

The calculator computes the same formula as the definition below.

Page updated in 2026.