TL;DR: A line slope calculator determines the steepness and direction of a straight line using its coordinates or equation.
- The slope formula is m = (y₂ − y₁) / (x₂ − x₁), which represents the line"s vertical change (rise) over its horizontal change (run).
- You can find the slope by inputting two points on the line, (x₁, y₁) and (x₂, y₂).
- For an equation in slope-intercept form (y = mx + b), the slope is the coefficient "m'.
- A positive slope indicates the line rises from left to right, while a negative slope indicates it falls.
- A horizontal line has a slope of zero, and a vertical line has an undefined slope.
What Is the Formula for Slope?
The formula to calculate the slope (m) of a straight line is m = (y₂ − y₁) / (x₂ − x₁). This equation quantifies the "rise over run", or the change in the vertical position (y-axis) divided by the change in the horizontal position (x-axis) between any two distinct points on the line.
The variable "m" is also known as the gradient. It measures both the steepness and the direction of the line. The points (x₁, y₁) and (x₂, y₂) represent the coordinates of the first and second points, respectively. The order of the points does not matter as long as it is consistent in both the numerator and the denominator.
| Component | Variable | Represents |
|---|---|---|
| Slope | m | The steepness and direction of the line. |
| First Point | (x₁, y₁) | The coordinates of the starting point. |
| Second Point | (x₂, y₂) | The coordinates of the ending point. |
| Rise | y₂ − y₁ | The vertical change between the two points. |
| Run | x₂ − x₁ | The horizontal change between the two points. |
How to Use a Line Slope Calculator
To use a line slope calculator, you provide the coordinates of two points on the line. The tool then applies the slope formula to compute the result automatically. This is the most common method for finding the slope between two known locations on a Cartesian plane.
The typical steps for using the two-point method are:
- Step 1: Identify the coordinates for two separate points on the line. Let"s call them Point 1 (x₁, y₁) and Point 2 (x₂, y₂).
- Step 2: Enter the x-coordinate and y-coordinate for Point 1 into the designated fields.
- Step 3: Enter the corresponding coordinates for Point 2.
- Step 4: Execute the calculation. The tool computes the difference in y-coordinates (rise) and divides it by the difference in x-coordinates (run) to output the slope "m'.
Some calculators also allow you to work backward. If you have one point (x₁, y₁) and the slope (m), they can help you find the line's full equation, typically in slope-intercept form (y = mx + b).
How to Find the Slope from a Linear Equation
To find the slope from a linear equation, you must first identify the form of the equation. The easiest form to work with is the slope-intercept form, y = mx + b, where the coefficient "m" directly represents the slope.
If the equation is in a different format, such as the standard form (Ax + By = C), you need to algebraically rearrange it to isolate "y" on one side. This conversion puts the equation into slope-intercept form, making the slope visible.
| Equation Form | Formula | How to Find Slope (m) |
|---|---|---|
| Slope-Intercept | y = mx + b | "m" is the coefficient of the x term. |
| Standard Form | Ax + By = C | Rearrange to y = (-A/B)x + (C/B). The slope is -A/B. |
| Point-Slope Form | y - y₁ = m(x - x₁) | "m" is the value multiplying the (x - x₁) term. |
Interpreting Slope Values
The value and sign of the slope describe the line's direction and steepness on a graph. A positive slope signifies an upward trajectory from left to right, while a negative slope indicates a downward trajectory.
The magnitude of the slope value indicates its steepness. A slope with a larger absolute value (e.g., -5 or 5) is steeper than a slope with a smaller absolute value (e.g., -0.5 or 0.5). Two special cases are horizontal and vertical lines.
| Slope Value (m) | Line Direction & Description |
|---|---|
| Positive (m > 0) | The line rises from left to right. As the x-value increases, the y-value increases. |
| Negative (m < 0) | The line falls from left to right. As the x-value increases, the y-value decreases. |
| Zero (m = 0) | The line is horizontal. There is no vertical change (rise is 0). |
| Undefined | The line is vertical. There is no horizontal change (run is 0), which results in division by zero. |
Calculating Slope as a Percentage or Angle
To convert a slope to a percentage, you multiply the calculated slope value (m) by 100. The formula is Percentage Grade = m × 100. This format is commonly used in civil engineering, construction, and geography to describe the steepness of roads, ramps, or terrain.
A 5% grade, for example, means that for every 100 units of horizontal distance (like feet or meters), the elevation changes by 5 units. This provides a practical way to understand steepness in real-world applications.
You can also express slope as an angle in degrees. To do this, calculate the arctangent (or inverse tangent) of the slope value. The formula is Angle (θ) = arctan(m). For a slope of 1, the angle is 45°, as the rise equals the run.
Frequently Asked Questions
How do I calculate the slope of a line? You calculate the slope by dividing the vertical change (rise) by the horizontal change (run) between two points. The formula is m = (y₂ − y₁) / (x₂ − x₁).
What is a 2% slope over 10 feet? A 2% slope means a vertical rise of 0.02 units for every 1 unit of horizontal distance. Over a horizontal distance of 10 feet (120 inches), the total vertical rise is 0.02 multiplied by 120, which equals 2.4 inches.
How steep is a 20% slope? A 20% slope corresponds to an angle of approximately 11.3 degrees from the horizontal. It means that for every 10 meters you move forward horizontally, the elevation changes by 2 meters.
Can a slope be a whole number? Yes, a slope can be any real number, including a whole number. A slope of 3, for instance, means the line rises 3 vertical units for every 1 horizontal unit it moves to the right.