Gradient Calculator
Calculate line gradient, y-intercept, equation, and angle from two coordinate points.
About Line Gradients
Gradient Examples
These point pairs demonstrate rising, falling, and vertical lines.
| Points | Gradient and equation | Line type |
|---|---|---|
| (1, 2) and (3, 6) | m = 2, y = 2x | Rising line |
| (0, 5) and (5, 0) | m = -1, y = -x + 5 | Falling line |
| (2, 1) and (2, 8) | Undefined, x = 2 | Vertical line |
How to Calculate Gradient
- Enter the x-coordinate and y-coordinate of the first point.
- Enter the coordinates of a different second point.
- Select Calculate Gradient to divide the change in y by the change in x.
- Review the slope, intercept, line equation, and inclination angle.
Frequently Asked Questions
What is the gradient formula?
Subtract the first y-coordinate from the second and divide by the second x-coordinate minus the first. This is commonly described as rise over run.
What does a negative gradient mean?
A negative gradient means y decreases as x increases. On a standard graph, the line slopes downward from left to right.
Why is a vertical line's gradient undefined?
Both points on a vertical line have the same x-coordinate, so the run is zero. Division by zero is undefined, and the line is written with a constant x-value instead.
How is the y-intercept found?
Insert either point and the calculated gradient into the slope-intercept relationship. Rearranging gives the intercept as y minus gradient times x.
Can I use decimal or negative coordinates?
Yes, each coordinate can be positive, negative, zero, or decimal. The only invalid pair is two identical points because infinitely many lines pass through a single location.