Distance Between Two Lines Calculator

Enter the equations of both lines to get the distance between them, see the step-by-step solution, and their graph.

Equation of Line L1
x + y + = 0
Equation of Line L2
x + y + = 0

Result

The distance between line and line is:

Quick Examples

Rate this tool

What Is the Distance Between Two Lines?

The distance between two lines in the plane is the measure of their minimum separation. When the lines are intersecting (they cross at a single point) or coincident (they are the same line), the distance between them is zero.

On the other hand, if the lines are parallel and non-coincident, the distance between them is the length of the perpendicular segment drawn from any point on one line to the other line, and it is a constant positive value.

Given two parallel lines in their general form: L1: Ax + By + C1 = 0 and L2: Ax + By + C2 = 0 where the coefficients A and B are identical, the distance between them is given by the following formula:

\(d(L_1, L_2)=\dfrac{|C_2-C_1|}{\sqrt{A^2+B^2}}\)

Distance between two parallel lines on the Cartesian plane

Solved Exercises

Calculate the distance between the parallel lines 2x + 3y - 5 = 0 and 4x + 6y + 12 = 0.

Result

The distance between the line \( 2x+ 3y- 5 = 0 \) and the line \( 4x+ 6y+ 12 = 0 \) is:

$$ d = \dfrac{11\sqrt{13}}{13} \approx 3.05 $$

Step-by-step solution

1. Analyze if the lines are parallel.

We calculate the ratio of the corresponding linear terms and determine if they are equal:

$$ \dfrac{A_1}{A_2} = \dfrac{2}{4} = \dfrac{1}{2} \quad \dfrac{B_1}{B_2} = \dfrac{3}{6} = \dfrac{1}{2} $$
$$ \dfrac{A_1}{A_2} = \dfrac{B_1}{B_2} $$

The ratios are equal; therefore, the lines are parallel.

2. Standardize the linear coefficients.

We express both equations in general form; in this case, they are already in that form:

$$ L_1: 2x+ 3y- 5 = 0 $$
$$ L_2: 4x+ 6y+ 12 = 0 $$

We multiply L2 by a suitable constant k so that the linear coefficients are equal to L1.

$$ k = \dfrac{1}{2} $$
$$ L_2 \xrightarrow{\times k} 2x+ 3y+ 6 = 0 $$

3. Apply the formula.

The formula to use is:

$$ d = \dfrac{|C_2 - C_1|}{\sqrt{A^2 + B^2}} $$

We identify the coefficients and the constant terms:

$$ A = 2, \; B = 3, \; C_1 = -5, \; C_2 = 6 $$

We substitute into the formula and calculate:

$$ d = \dfrac{|6 - \left(-5\right)|}{\sqrt{2^2 + 3^2}} = \dfrac{|11|}{\sqrt{4 + 9}} = \dfrac{11}{\sqrt{13}} $$
$$ d = \dfrac{11\sqrt{13}}{13} \approx 3.05 $$
Distance between two parallel lines on the Cartesian plane, equations in general form.
Distance between two lines
Find the distance separating the straight lines y = 2x - 1 and y = 2x + 4.

Solution

The distance between the line \( y = 2x - 1 \) and the line \( y = 2x + 4 \) is:

$$ d = \sqrt{5} \approx 2.24 $$

Step-by-step solution

1. Analyze if the lines are parallel.

We verify if the slopes of both lines are equal:

$$ m_1 = 2, \quad m_2 = 2 $$
$$ m_1 = m_2 $$

The slopes are equal; therefore, the lines are parallel.

2. Standardize the linear coefficients.

We express both equations in general form:

$$ L_1: 2x- y- 1 = 0 $$
$$ L_2: 2x- y+ 4 = 0 $$

The linear coefficients are already standardized. We continue.

3. Apply the formula.

The formula to use is:

$$ d = \dfrac{|C_2 - C_1|}{\sqrt{A^2 + B^2}} $$

We identify the coefficients and the constant terms:

$$ A = 2, \; B = -1, \; C_1 = -1, \; C_2 = 4 $$

We substitute into the formula and calculate:

$$ d = \dfrac{|4 - \left(-1\right)|}{\sqrt{2^2 + \left(-1\right)^2}} = \dfrac{|5|}{\sqrt{4 + 1}} = \dfrac{5}{\sqrt{5}} $$
$$ d = \sqrt{5} \approx 2.24 $$
Graph of the distance between two parallel lines on the Cartesian plane, equations given in general form.
Determine the distance between the parallel lines y = (1/2)x + 3 and x + 2y - 10 = 0.

Answer

The distance between the line \( y = \dfrac{1}{2}x + 3\) and the line \( x+ 2y- 10 = 0 \) is:

$$ d = \dfrac{4\sqrt{5}}{5} \approx 1.79 $$

Step-by-step solution

1. Analyze if the lines are parallel.

We convert the equation in slope-intercept form to its general form:

$$ L_1: -\dfrac{1}{2}x- y+ 3 = 0 $$
$$ L_2: x+ 2y- 10 = 0 $$

We calculate the ratio of the corresponding linear terms and determine if they are equal:

$$ \dfrac{A_1}{A_2} = \dfrac{-\dfrac{1}{2}}{1} = -\dfrac{1}{2} \quad \dfrac{B_1}{B_2} = -\dfrac{1}{2} $$
$$ \dfrac{A_1}{A_2} = \dfrac{B_1}{B_2} $$

The ratios are equal; therefore, the lines are parallel.

2. Standardize the linear coefficients.

We express both equations in general form:

$$ L_1: -\dfrac{1}{2}x- y+ 3 = 0 $$
$$ L_2: x+ 2y- 10 = 0 $$

We multiply L2 by a suitable constant k so that the linear coefficients are equal to L1.

$$ k = -\dfrac{1}{2} $$
$$ L_2 \xrightarrow{\times k} -\dfrac{1}{2}x- y+ 5 = 0 $$

3. Apply the formula.

The formula to use is:

$$ d = \dfrac{|C_2 - C_1|}{\sqrt{A^2 + B^2}} $$

We identify the coefficients and the constant terms:

$$ A = -\dfrac{1}{2}, \; B = -1, \; C_1 = 3, \; C_2 = 5 $$

We substitute into the formula and calculate:

$$ d = \dfrac{|5 - 3|}{\sqrt{\left(-\dfrac{1}{2}\right)^2 + \left(-1\right)^2}} = \dfrac{|2|}{\sqrt{\dfrac{1}{4} + 1}} = \dfrac{2}{\sqrt{\dfrac{5}{4}}} $$
$$ d = \dfrac{4\sqrt{5}}{5} \approx 1.79 $$
Graph of the distance between two parallel lines on the Cartesian plane.

Related Tools

Daniel Machado

Professor of Mathematics, graduated from the Faculty of Exact, Chemical and Natural Sciences of the National University of Misiones (UNAM). Developer and creator of RigelUp, dedicated to building tools for mathematical learning.

Leave a Reply

Your email address will not be published. Required fields are marked *