Slope of a Straight Line Calculator

Enter the coordinates of two points to get information about the line that passes through them (equations, y-intercept, angle of inclination, etc.), the step-by-step solution, and the graph.

Point 1
( , )
Point 2
( , )

Quick Examples

Rate this tool

How to Use This Calculator

This online slope calculator is a mathematical tool designed to analyze the slope of the straight line passing through two coordinates on the Cartesian plane. In addition to giving you all the analytical data and the different forms of the equation, the solver generates the step-by-step breakdown and the visual representation of the problem.

Using this finder is very simple and is based on a single data input mode:

  1. Entering points: Type the coordinates of the first point (x1, y1) and the second point (x2, y2) into the corresponding boxes. You can use integers, decimals, and fractions.
  2. Main results: The tool will generate a complete box with all the information about the line. Here you will find the numerical value of the slope (m), the slope expressed as a percentage (%), and the angle of inclination with respect to the positive x-axis. Additionally, it will show you the y-intercept, the shortest distance from the line to the origin (0,0), and the three fundamental forms of the line: the slope-intercept form (y = mx + b), the point-slope form (y - y1 = m(x - x1)), and the general form (Ax + By + C = 0).
  3. Step-by-step resolution: Below the direct results, the detailed algebraic procedure is displayed. First, you will observe the calculation of the slope by substituting your coordinates into the formula m = (y2 - y1) / (x2 - x1). Then, you will see how the angle of inclination is determined by applying the inverse trigonometric function (arctangent of the slope). Finally, it explains how the y-intercept is found and how the terms are algebraically manipulated to construct each of the equations shown in the results.
  4. Interactive graph: At the bottom of the page, you will find a dynamic Cartesian plane. There, you can visualize the plotted line passing exactly through the two points you entered, with its slope-intercept equation visible. You can pan, zoom in, or zoom out to study the line's degree of inclination.

To ensure maximum accuracy in algebra and analytic geometry tasks, the calculator keeps the values in fraction format throughout the entire step-by-step breakdown, avoiding decimal rounding errors.

Solved Exercises

See some examples of problems solved directly with the tool.

Calculate the slope and elements of the line that passes through the points (-2, 3) and (4, 7).

Result

The line that passes through the given points has the following characteristics, equations, and elements.

Slope: \( m = \dfrac{2}{3} \approx 0.67 \)

Slope-intercept form: \( y = \dfrac{2}{3}x + \dfrac{13}{3} \)

Point-slope form: \( y - 3 = \dfrac{2}{3}\left(x + 2\right) \)

General form: \( 2x - 3y + 13 = 0 \)

y-intercept: \( b = \dfrac{13}{3} \approx 4.33 \)

Angle of inclination: \( \theta \approx 33.69^\circ \)

Vertical change: \( \Delta y = 4 \)

Horizontal change: \( \Delta x = 6 \)

Distance to the origin: \( d \approx 3.61 \)

Slope in percentage: \( m_{\%} \approx 66.67\% \)

Step-by-step solution

1. Calculate the slope (m).

We use the slope formula for two points in a plane, which is the division between the vertical change (Δy) and the horizontal change (Δx):

$$ m = \dfrac{\Delta y}{\Delta x} = \dfrac{y_2 - y_1}{x_2 - x_1} $$

We substitute the coordinates of \( P_1(-2, 3) \), \( P_2(4, 7) \):

$$ m = \dfrac{7 - 3}{4 - \left(-2\right)} = \dfrac{4}{6} = \dfrac{2}{3} $$

2. Calculate the angle of inclination (θ).

The angle of inclination is obtained by applying the arctangent function to the calculated slope:

$$ \theta = \arctan(m) = \arctan\left(\dfrac{2}{3}\right) \approx 33.69^\circ $$

3. Find the y-intercept (b) and the equations of the line.

We start from the point-slope equation using the coordinates of P₁ (the result would be the same using P₂):

$$ y - y_1 = m(x - x_1) $$
$$ y - 3 = \dfrac{2}{3}\left(x - \left(-2\right)\right) $$
$$ y - 3 = \dfrac{2}{3}\left(x + 2\right) $$

We solve for the variable 'y' and expand to get the equation in slope-intercept form (y = mx + b):

$$ y = \dfrac{2}{3}x + \dfrac{13}{3} $$

From this equation we extract that the y-intercept is \( b = \dfrac{13}{3} \).

Starting from the slope-intercept form, we rearrange the terms to equal zero in the general form Ax + By + C = 0:

$$ 2x - 3y + 13 = 0 $$
Graph on the Cartesian plane of a line with a positive slope obtained from two points.
Graph of the line
Find the slope of the straight line where (1, 5) and (6, -2) are two of its points.

Answer

Slope: \( m = -\dfrac{7}{5} = -1.4 \)

Slope-intercept form: \( y = -\dfrac{7}{5}x + \dfrac{32}{5} \)

Point-slope form: \( y - 5 = -\dfrac{7}{5}\left(x - 1\right) \)

General form: \( 7x + 5y - 32 = 0 \)

y-intercept: \( b = \dfrac{32}{5} = 6.4 \)

Angle of inclination: \( \theta \approx 125.54^\circ \)

Vertical change: \( \Delta y = -7 \)

Horizontal change: \( \Delta x = 5 \)

Distance to the origin: \( d \approx 3.72 \)

Slope in percentage: \( m_{\%} \approx -140\% \)

Step-by-step solution

1. Calculate the slope (m).

We use the slope formula for two points in a plane, which is the division between the vertical change (Δy) and the horizontal change (Δx):

$$ m = \dfrac{\Delta y}{\Delta x} = \dfrac{y_2 - y_1}{x_2 - x_1} $$

We substitute the coordinates of \( P_1(1, 5) \), \( P_2(6, -2) \):

$$ m = \dfrac{-2 - 5}{6 - 1} = \dfrac{-7}{5} = -\dfrac{7}{5} $$

2. Calculate the angle of inclination (θ).

The angle of inclination is obtained by applying the arctangent function to the calculated slope:

$$ \theta = \arctan(m) = \arctan\left(-\dfrac{7}{5}\right) \approx -54.46^\circ $$

Since the slope is negative, the arctangent function returns a negative angle (measured clockwise). By geometric convention, the angle of inclination of a line is always expressed as a positive value between 0° and 180°.

To get the standard angle of inclination, we add 180° to the arctangent:

$$ \theta = \arctan\left(-\dfrac{7}{5}\right) + 180^\circ \approx 125.54^\circ $$

3. Find the y-intercept (b) and the equations of the line.

We start from the point-slope equation using the coordinates of P₁ (the result would be the same using P₂):

$$ y - y_1 = m(x - x_1) $$
$$ y - 5 = -\dfrac{7}{5}\left(x - 1\right) $$

We solve for the variable 'y' and expand to get the equation in slope-intercept form (y = mx + b):

$$ y = -\dfrac{7}{5}x + \dfrac{32}{5} $$

From this equation we extract that the y-intercept is \( b = \dfrac{32}{5} \).

Starting from the slope-intercept form, we rearrange the terms to equal zero in the general form Ax + By + C = 0:

$$ 7x + 5y - 32 = 0 $$
Graph on the Cartesian plane of a line with a negative slope obtained from two points.
Graph of the line
Determine the slope of the line given the points (-2, -2) and (3, 2).

Solution

Slope: \( m = \dfrac{4}{5} = 0.8 \)

Slope-intercept form: \( y = \dfrac{4}{5}x - \dfrac{2}{5} \)

Point-slope form: \( y + 2 = \dfrac{4}{5}\left(x + 2\right) \)

General form: \( 4x - 5y - 2 = 0 \)

y-intercept: \( b = -\dfrac{2}{5} = -0.4 \)

Angle of inclination: \( \theta \approx 38.66^\circ \)

Vertical change: \( \Delta y = 4 \)

Horizontal change: \( \Delta x = 5 \)

Distance to the origin: \( d \approx 0.31 \)

Slope in percentage: \( m_{\%} \approx 80\% \)

Step-by-step solution

1. Calculate the slope (m).

We use the slope formula for two points in a plane, which is the division between the vertical change (Δy) and the horizontal change (Δx):

$$ m = \dfrac{\Delta y}{\Delta x} = \dfrac{y_2 - y_1}{x_2 - x_1} $$

We substitute the coordinates of \( P_1(-2, -2) \), \( P_2(3, 2) \):

$$ m = \dfrac{2 - \left(-2\right)}{3 - \left(-2\right)} = \dfrac{4}{5} $$

2. Calculate the angle of inclination (θ).

The angle of inclination is obtained by applying the arctangent function to the calculated slope:

$$ \theta = \arctan(m) = \arctan\left(\dfrac{4}{5}\right) \approx 38.66^\circ $$

3. Find the y-intercept (b) and the equations of the line.

We start from the point-slope equation using the coordinates of P₁ (the result would be the same using P₂):

$$ y - y_1 = m(x - x_1) $$
$$ y - \left(-2\right) = \dfrac{4}{5}\left(x - \left(-2\right)\right) $$
$$ y + 2 = \dfrac{4}{5}\left(x + 2\right) $$

We solve for the variable 'y' and expand to get the equation in slope-intercept form (y = mx + b):

$$ y = \dfrac{4}{5}x - \dfrac{2}{5} $$

From this equation we extract that the y-intercept is \( b = -\dfrac{2}{5} \).

Starting from the slope-intercept form, we rearrange the terms to equal zero in the general form Ax + By + C = 0:

$$ 4x - 5y - 2 = 0 $$
Graph on the Cartesian plane of a line with a positive slope obtained from two points with integer coordinates.
Graph of the line on the plane
Obtain the elements of the straight line containing the points (-1/2, 3/4) and (5/2, -1/4).

Result

Slope: \( m = -\dfrac{1}{3} \approx -0.33 \)

Slope-intercept form: \( y = -\dfrac{1}{3}x + \dfrac{7}{12} \)

Point-slope form: \( y - \dfrac{3}{4} = -\dfrac{1}{3}\left(x + \dfrac{1}{2}\right) \)

General form: \( 4x + 12y - 7 = 0 \)

y-intercept: \( b = \dfrac{7}{12} \approx 0.58 \)

Angle of inclination: \( \theta \approx 161.57^\circ \)

Vertical change: \( \Delta y = -1 \)

Horizontal change: \( \Delta x = 3 \)

Distance to the origin: \( d \approx 0.55 \)

Slope in percentage: \( m_{\%} \approx -33.33\% \)

Step-by-step solution

1. Calculate the slope (m).

We use the slope formula for two points in a plane, which is the division between the vertical change (Δy) and the horizontal change (Δx):

$$ m = \dfrac{\Delta y}{\Delta x} = \dfrac{y_2 - y_1}{x_2 - x_1} $$

We substitute the coordinates of \( P_1(-\dfrac{1}{2}, \dfrac{3}{4}) \), \( P_2(\dfrac{5}{2}, -\dfrac{1}{4}) \):

$$ m = \dfrac{-\dfrac{1}{4} - \dfrac{3}{4}}{\dfrac{5}{2} - \left(-\dfrac{1}{2}\right)} = \dfrac{-1}{3} = -\dfrac{1}{3} $$

2. Calculate the angle of inclination (θ).

The angle of inclination is obtained by applying the arctangent function to the calculated slope:

$$ \theta = \arctan(m) = \arctan\left(-\dfrac{1}{3}\right) \approx -18.43^\circ $$

Since the slope is negative, the arctangent function returns a negative angle (measured clockwise). By geometric convention, the angle of inclination of a line is always expressed as a positive value between 0° and 180°.

To get the standard angle of inclination, we add 180° to the arctangent:

$$ \theta = \arctan\left(-\dfrac{1}{3}\right) + 180^\circ \approx 161.57^\circ $$

3. Find the y-intercept (b) and the equations of the line.

We start from the point-slope equation using the coordinates of P₁ (the result would be the same using P₂):

$$ y - y_1 = m(x - x_1) $$
$$ y - \dfrac{3}{4} = -\dfrac{1}{3}\left(x - \left(-\dfrac{1}{2}\right)\right) $$
$$ y - \dfrac{3}{4} = -\dfrac{1}{3}\left(x + \dfrac{1}{2}\right) $$

We solve for the variable 'y' and expand to get the equation in slope-intercept form (y = mx + b):

$$ y = -\dfrac{1}{3}x + \dfrac{7}{12} $$

From this equation we extract that the y-intercept is \( b = \dfrac{7}{12} \).

Starting from the slope-intercept form, we rearrange the terms to equal zero in the general form Ax + By + C = 0:

$$ 4x + 12y - 7 = 0 $$
Graph on the Cartesian plane of a line with a negative slope obtained from two points with fractional coordinates.
Graph of the line 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.