Connect via MCP →

Enter Calculation

Both lines must share the same a and b: a·x + b·y + c = 0.

Formula

Advertisement

Results

Distance Between Parallel Lines
3
units
|c₁ − c₂| 15
√(a² + b²) 5

What This Calculator Does

This tool computes the shortest (perpendicular) distance between two parallel straight lines in a 2D plane. The lines must be written in the standard general form \(a \cdot x + b \cdot y + c = 0\), and because they are parallel they share the same coefficients a and b while differing only in the constant term c. Enter the shared a and b, plus the two constants c₁ and c₂, and the calculator returns the distance instantly.

The Formula

The distance is given by:

$$d = \frac{\left| \text{c}_1 - \text{c}_2 \right|}{\sqrt{\text{a}^{2} + \text{b}^{2}}}$$

The numerator is the absolute difference of the constant terms, so the result is always non-negative. The denominator \(\sqrt{a^{2} + b^{2}}\) normalizes the line's coefficient vector to unit length, converting the raw difference into a true geometric distance measured perpendicular to both lines.

Two parallel lines on a coordinate plane with a perpendicular segment showing distance d
The distance d is the perpendicular gap between the two parallel lines.

How to Use It

1. Rewrite each line in the form \(a \cdot x + b \cdot y + c = 0\) if it isn't already. 2. Make sure both lines have identical a and b values (multiply one equation by a constant if needed so they match). 3. Enter a, b, c₁ and c₂. 4. Read the perpendicular distance.

Advertisement

Worked Example

Consider the lines \(3x + 4y + 5 = 0\) and \(3x + 4y - 10 = 0\). Here \(a = 3\), \(b = 4\), \(c_1 = 5\), \(c_2 = -10\). The numerator is \(\left| 5 - (-10) \right| = 15\). The denominator is \(\sqrt{3^{2} + 4^{2}} = \sqrt{25} = 5\). So $$d = \frac{15}{5} = \textbf{3 units}.$$

FAQ

What if the a and b values differ? Then the lines are not parallel and this formula does not apply — first scale one equation so both share the same a and b.

Can the distance be negative? No. The absolute value ensures a non-negative result regardless of the order of c₁ and c₂.

What if both lines are identical? If \(c_1 = c_2\) the distance is 0 because the lines coincide.

Last updated: