Calculate Slope of a Line

Online calculator for calculating the slope between two points

Slope Calculator

Slope of a Line

The slope m of a line describes by how many units the Y-value changes when the X-value increases by one unit.

X-coordinate of point A
Y-coordinate of point A
X-coordinate of point B
Y-coordinate of point B
Results
Slope m:
Angle to X-axis:

Visualization

Slope of a line

The graphic shows the slope as the ratio of height difference to horizontal distance.
The slope triangle illustrates the geometric meaning of the slope.

What is the Slope of a Line?

The slope indicates how steeply a line rises or falls:

  • Positive slope: Line rises from left to right
  • Negative slope: Line falls from left to right
  • Slope = 0: Horizontal line (parallel to X-axis)
  • Slope = 1: 45° rise (m = tan(45°))
  • Large slope: Steep line
  • Small slope: Flat line

Relationship Between Slope and Angle

The slope and the inclination angle are in direct relationship to each other:

Slope from Angle
\[m = \tan(\alpha)\]

Slope is the tangent of the angle

Angle from Slope
\[\alpha = \arctan(m)\]

Angle is the arctangent of the slope

Formulas for Slope Calculation

Main Formula - Slope Between Two Points
\[m = \frac{y_2 - y_1}{x_2 - x_1} = \frac{\Delta y}{\Delta x}\]

Slope = Change in Y-direction ÷ Change in X-direction

Angle to X-axis (Arcsine)
\[\alpha = \arcsin\left(\frac{y_2-y_1}{\sqrt{(x_2-x_1)^2 + (y_2-y_1)^2}}\right)\]

Calculation via the sine of the slope triangle

Angle to X-axis (Arccosine)
\[\alpha = \arccos\left(\frac{x_2-x_1}{\sqrt{(x_2-x_1)^2 + (y_2-y_1)^2}}\right)\]

Calculation via the cosine of the slope triangle

Distance Between Points
\[c = \sqrt{(x_2-x_1)^2 + (y_2-y_1)^2}\]

Hypotenuse of the slope triangle

Slope via Tangent
\[m = \tan(\alpha) \quad \Leftrightarrow \quad \alpha = \arctan(m)\]

Direct relationship between slope and angle

Example

Example Calculation
A(0,0) B(6,8)
Calculate Slope
\[m = \frac{8-0}{6-0} = \frac{4}{3} \approx 1.33\]

The slope is 4/3 ≈ 1.33

Calculate Angle
\[\alpha = \arctan\left(\frac{4}{3}\right) \approx 53.13°\]

The inclination angle is approximately 53.13°

Interpretation
  • Slope 4/3: Y rises by 4 for every 3 X-units
  • Positive slope: Line rises
  • Steep rise: Angle > 45°
Applications

Road gradients, roof slopes, terrain profiles, technical drawings.

Understanding Slope in Practice

The slope of a line is a fundamental concept in mathematics and describes how steeply a line rises or falls. It is defined as the ratio of the vertical change to the horizontal change between two points.

Geometric Meaning

The slope m of a line between two points A(x₁,y₁) and B(x₂,y₂) is calculated as:

\[m = \frac{y_2 - y_1}{x_2 - x_1} = \frac{\text{height difference}}{\text{horizontal distance}}\]

Types of Slope

Positive Slope (m > 0)

The line rises from left to right. The larger the value, the steeper the rise.

Negative Slope (m < 0)

The line falls from left to right. The more negative the value, the steeper the fall.

Zero Slope (m = 0)

The line runs horizontally. There is no change in Y-direction.

Infinite Slope

For vertical lines, the slope is undefined (division by zero).

Practical Applications

Slope calculation is found in many practical areas:

  • Construction: Roof slopes, ramps, road gradients
  • Geography: Terrain profiles, contour lines on maps
  • Economics: Growth rates, trends in charts
  • Physics: Velocity-time diagrams, force-displacement diagrams
  • Engineering: Mechanical engineering, electronics (characteristic curves)

Special Slope Values

m = 1

45° rise
α = arctan(1) = 45°

m = √3 ≈ 1.73

60° rise
α = arctan(√3) = 60°

m = 1/√3 ≈ 0.58

30° rise
α = arctan(1/√3) = 30°

Is this page helpful?            
Thank you for your feedback!

Sorry about that

How can we improve it?


More graphics functions

Angle of two lines  •  Angle of two vectors  •  Center of a straight line  •  Distance of two points  •  Distance of a point and a line  •  Rise over Run  •  Slope of a line  •  Straight line equation  •  Circular arc  •  Helix  •  Koch snowflake  •