Angle Between Two Lines Calculator

Enter the equations of two lines (in any form) to find the angle between them, see the step-by-step solution, and view the graph on the coordinate plane.

Line 1 (L1)
Line 2 (L2)

Quick Examples

Rate this tool

How to Use the Calculator

This online angle between two lines solver is an analytical tool designed to find the angular measure formed by the intersection of two lines on the Cartesian plane. In addition to providing the value, the system generates the step-by-step mathematical solution and a graph of the situation.

How to enter your data:

  • Line equations: you have two separate text fields, one for each line. You can write the equations in any valid mathematical form: slope-intercept form (y = mx + b), standard form (Ax + By = C), point-slope form, or even unordered expressions. The algebraic engine will automatically simplify, group, and solve for variables.
  • Numerical formats: the tool supports integer coefficients, decimal numbers, exact fractions, and irrationals. Values such as square roots or fractions are preserved symbolically during the analytical calculation to ensure no rounding errors occur.

Once you enter the two equations, the algorithm will process the information and provide the direct angle answer. By geometric convention, the tool always returns the measure of the acute angle, which is a value between 0° and 90°.

Below the main result, the step-by-step solution to your problem will be displayed. There you can see how the slopes are analyzed and how the trigonometric tangent formula is applied: tan(θ) = |(m2 - m1) / (1 + m1 · m2)|.

The mathematical engine is equipped to handle various analytical situations. During the process, the system automatically evaluates whether the given lines are perpendicular. Additionally, the calculator works perfectly with vertical lines (for example, x = 4); although these have an undefined slope and the traditional formula wouldn't work, the algorithm applies the necessary geometric properties to solve the intersection and give you the angle without throwing errors.

Finally, below the solution you will find an interactive graph that plots both lines on the Cartesian plane, highlighting the intersection and the angle so you can visually verify the calculated value.

Solved Exercises

The following are examples of problems solved by the calculator.

Calculate the acute angle between the lines \(2x-y+1=0\) and \(x+3y-6=0.\)

Result

The angle between the given lines is:

$$ \theta \approx 81.87^\circ $$

Step-by-step solution

1. Identify the equations and obtain their slopes.

The equations to work with are:

$$ L_1: 2x-y+1=0 \\ L_2: x+3y-6=0 $$

We make sure both equations are expressed in slope-intercept form (y = mx + b) and extract their slopes (m):

$$ L_1: y = 2 x + 1 \quad \rightarrow \quad m_1 = 2 $$
$$ L_2: y = -\dfrac{1}{3} x + 2 \quad \rightarrow \quad m_2 = -\dfrac{1}{3} $$

2. Evaluate the product of the slopes.

We multiply both slopes to check if the lines are perpendicular:

$$ m_1 \cdot m_2 = (2) \cdot \left(-\dfrac{1}{3}\right) = -\dfrac{2}{3} $$

Since the product is not -1, we continue with the general calculation.

3. Calculate the tangent of the angle between the lines.

We use the general formula for the tangent of the angle between two lines, substituting the extracted slope values:

$$ \tan(\theta) = \left| \dfrac{m_2 - m_1}{1 + m_1 \cdot m_2} \right| \\[1.5em] \tan(\theta) = \left| \dfrac{\left(-\frac{1}{3}\right) - (2)}{1 + (2) \cdot \left(-\frac{1}{3}\right)} \right| \\[1.5em] \tan(\theta) = \left| \dfrac{-\frac{7}{3}}{\frac{1}{3}} \right| \\[1.5em] \tan(\theta) = 7 $$

4. Find the angle.

We apply the arctangent function to get the final angle in degrees:

$$ \theta = \arctan(7) \\[1em] \theta \approx 81.87^\circ $$
Graph of two intersecting oblique lines on the Cartesian plane and the angle between them, one with a positive slope and the other with a negative slope. Example 1.
Graph of the lines on the plane
Determine the angle formed by the straight lines \(x - 4 = 0\) and \(2x - y + 3 = 0.\)

Result

The angle between the given lines is:

$$ \theta \approx 26.57^\circ $$

Step-by-step solution

1. Identify the type of lines and obtain slopes.

The equations to work with are:

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

We note that one of the lines is vertical (it has no y-variable), so its angle of inclination is 90°. We make sure the other equation is expressed in slope-intercept form (y = mx + b) and extract its slope:

$$ L_1: x = 4 \quad \rightarrow \quad \alpha_1 = 90^\circ $$
$$ L_2: y = 2 x + 3 \quad \rightarrow \quad m_2 = 2 $$

2. Calculate the angle of inclination of the oblique line.

We apply the arctangent function to the slope to find the angle of inclination of the oblique line with respect to the horizontal:

$$ \alpha_2 = \arctan(2) \\[1em] \alpha_2 \approx 63.43^\circ $$

3. Find the angle between the lines.

The angle between a vertical line and an oblique line is the absolute difference between their respective angles of inclination:

$$ \theta = | 90^\circ - \alpha_2 | \\[1em] \theta \approx | 90^\circ - 63.43^\circ | \\[1em] \theta \approx 26.57^\circ $$
Graph of two lines on the Cartesian plane, one vertical and the other oblique with a positive slope and the angle between them. Example 2.
Graph of the lines on the plane
Find the acute angle between the lines in standard form \(3x - 2y + 5 = 0\) and \(2x + 3y - 1 = 0.\)

Result

The angle between the given lines is:

$$ \theta = 90^\circ $$

Step-by-step solution

1. Identify the equations and obtain their slopes.

The equations to work with are:

$$ L_1: 3x - 2y + 5 = 0 \\ L_2: 2x + 3y - 1 = 0 $$

We make sure both equations are expressed in slope-intercept form (y = mx + b) and extract their slopes (m):

$$ L_1: y = \dfrac{3}{2} x + \dfrac{5}{2} \quad \rightarrow \quad m_1 = \dfrac{3}{2} $$
$$ L_2: y = -\dfrac{2}{3} x + \dfrac{1}{3} \quad \rightarrow \quad m_2 = -\dfrac{2}{3} $$

2. Evaluate the product of the slopes.

We multiply both slopes to check if the lines are perpendicular:

$$ m_1 \cdot m_2 = \left(\dfrac{3}{2}\right) \cdot \left(-\dfrac{2}{3}\right) = -1 $$

Since the product is exactly -1, it is confirmed that the lines are perpendicular to each other.

3. Find the angle.

Since they are perpendicular, there is no need to apply the general formula. The angle between them is direct:

$$ \theta = 90^\circ $$
Graph of two perpendicular lines on the Cartesian plane. Example 3.
Graph of the lines on the plane
Find the angle between the straight lines \(\sqrt{3}x - y = 0\) and \(y = x.\)

Result

The angle between the given lines is:

$$ \theta = 15^\circ $$

Step-by-step solution

1. Identify the equations and obtain their slopes.

The equations to work with are:

$$ L_1: \sqrt{3}x - y = 0 \\ L_2: y = x $$

We make sure both equations are expressed in slope-intercept form (y = mx + b) and extract their slopes (m):

$$ L_1: y = \sqrt{3} x \quad \rightarrow \quad m_1 = \sqrt{3} $$
$$ L_2: y = x \quad \rightarrow \quad m_2 = 1 $$

2. Evaluate the product of the slopes.

We multiply both slopes to check if the lines are perpendicular:

$$ m_1 \cdot m_2 = \left(\sqrt{3}\right) \cdot (1) = \sqrt{3} $$

Since the product is not -1, we continue with the general calculation.

3. Calculate the tangent of the angle between the lines.

We use the general formula for the tangent of the angle between two lines, substituting the extracted slope values:

$$ \tan(\theta) = \left| \dfrac{m_2 - m_1}{1 + m_1 \cdot m_2} \right| \\[1.5em] \tan(\theta) = \left| \dfrac{(1) - \left(\sqrt{3}\right)}{1 + \left(\sqrt{3}\right) \cdot (1)} \right| \\[1.5em] \tan(\theta) = \left| \dfrac{-\sqrt{3}+1}{\sqrt{3}+1} \right| \\[1.5em] \tan(\theta) = \left|\dfrac{-\sqrt{3}+1}{\sqrt{3}+1}\right| $$

4. Find the angle.

We apply the arctangent function to get the final angle in degrees:

$$ \theta = \arctan\left(\left|\dfrac{-\sqrt{3}+1}{\sqrt{3}+1}\right|\right) \\[1em] \theta = 15^\circ $$
Graph of two intersecting lines on the Cartesian plane with a positive slope and the angle between them. Example 4.
Graph of the lines on the 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.