Slope Calculator
Enter two points and get the slope (rise over run), the grade in percent, the angle from the horizontal, the run per unit rise (the "1 in N" gradient)
Try your own numbers
Estimate only. Not engineering or safety advice. Check the result against the applicable standard and the equipment data, and have a competent engineer review it before it is relied on. Terms of use.
Open in the calculator with these values
About this calculator
This page calculates slope m, grade, angle from the horizontal and 5 more results from point 1, x, point 1, y, point 2, x and point 2, y. Change any value or its unit and the result updates. The steps below show the working for the default values, so you can check each line against your own method.
Limits of this calculator
Use this to check the fall on a cable trench or drain, the gradient of a conduit or cable-tray run, the pitch of a ramp or access road, or the slope between two surveyed levels. For the straight-line distance between the points use the distance calculator, and for a value between two known points use the linear interpolation calculator.
Cross-check: 34 reference cases, calculated from textbook formulas coded separately from the engine by the same author, agree with this calculator. This is not an independent review.
Verification status: Engineering reference
Engineering reference. Formula and method documented and tested against separately coded reference calculations. Not yet Verified: the evidence listed on this page is still needed.
What this calculator checks
- The arithmetic of the published formula for the values you entered, in the units shown.
What remains unverified
- That the inputs suit your application. Take ratings, resistances and constants from the manufacturer data sheet or project specification.
Verification register entry
| Calculation author | Rahul Sharma (author) |
|---|---|
| Technical review | No independent technical review has been carried out |
| Individual professional approval | Not recorded |
| Formula reference | not recorded |
| Standard and edition | Not applicable: Pure mathematics or statistics; no electrical standard governs the method |
| Standard review state | Not applicable |
| Scope-screening note | not recorded |
| Cross-check test cases | 34 reference vectors (tests/reference_vectors.json) |
| Review date | not recorded |
| Next review date | not recorded |
| Status | Engineering reference |
Needed before this calculator can be marked Verified: reviewer name, qualification and review date; exact formula reference; formula source (textbook or standard); next review date.
Formula
Worked example
| Input | Value |
|---|---|
| Point 1, x | 0 |
| Point 1, y | 0 |
| Point 2, x | 20 |
| Point 2, y | 1 |
- Rise = y₂ − y₁ = 1 − 0 = 1 Run = x₂ − x₁ = 20 − 0 = 20
- Slope m = rise / run = 0.05 Grade = 100 m = 5%
- Angle = atan(m) = 2.86240523° Run per unit rise = 20 (1 in 20)
- Length = √(run² + rise²) = 20.0249843945 y-intercept b = y₁ − m x₁ = 0
Assumptions
- The two points are joined by a straight line and the slope is the same everywhere along it
- Slope is rise divided by run. A positive slope rises from point 1 to point 2, a negative slope falls, and the order of the points does not change the slope
- Grade is the slope as a percentage, so a grade of 5% rises 5 units for every 100 units of run. "1 in N" is the same gradient written as the run needed for one unit of rise
- A vertical line (the two x values equal) has no defined slope, grade, 1-in-N or y-intercept; its angle is 90° and its length is still found. A level line has slope zero and no 1-in-N figure
- The tool works on plain numbers and does not track units: enter all four values in the same unit; the slope, grade and angle do not depend on which unit that is
- Identical points do not define a line and are rejected
Use this to check the fall on a cable trench or drain, the gradient of a conduit or cable-tray run, the pitch of a ramp or access road, or the slope between two surveyed levels. For the straight-line distance between the points use the distance calculator, and for a value between two known points use the linear interpolation calculator.
Inputs and results
| Input | Unit | Allowed or shown | Note |
|---|---|---|---|
| Point 1, x | (number) | -1,000,000,000,000 or more, up to 1,000,000,000,000 | The horizontal position of the first point. Use the same unit for all four values; negative values are allowed. |
| Point 1, y | (number) | -1,000,000,000,000 or more, up to 1,000,000,000,000 | The vertical position (height) of the first point. |
| Point 2, x | (number) | -1,000,000,000,000 or more, up to 1,000,000,000,000 | |
| Point 2, y | (number) | -1,000,000,000,000 or more, up to 1,000,000,000,000 |
| Result | Unit | Allowed or shown | Note |
|---|---|---|---|
| Slope m (rise / run) | (number) | Shown to 10 decimal places | |
| Grade (percent) | (number) | Shown to 8 decimal places | |
| Angle from the horizontal (degrees) | (number) | Shown to 8 decimal places | |
| Run per unit rise (the N in 1 in N) | (number) | Shown to 8 decimal places | |
| Rise (y2 − y1) | (number) | Shown to 10 decimal places | |
| Run (x2 − x1) | (number) | Shown to 10 decimal places | |
| Length along the line | (number) | Shown to 10 decimal places | |
| y-intercept b (y at x = 0) | (number) | Shown to 10 decimal places |
How it is calculated
Each input is converted to the base unit of its quantity, the formula above is applied in the order shown in the worked example, and each result is shown in the unit you choose. Results are held at full precision and rounded only for display, except where a step selects a standard size, as the worked example shows. A value outside its allowed range is refused with a message instead of giving a result.
How the result changes with point 2, x
| Point 2, x | Slope m | Grade | Angle from the horizontal |
|---|---|---|---|
| 2 | 0.5 | 50 | 26.56505118 |
| 5 | 0.2 | 20 | 11.30993247 |
| 10 | 0.1 | 10 | 5.71059314 |
| 20 | 0.05 | 5 | 2.86240523 |
| 40 | 0.025 | 2.5 | 1.43209618 |
| 80 | 0.0125 | 1.25 | 0.71615995 |
| 200 | 0.005 | 0.5 | 0.28647651 |
Other inputs are the same as in the worked example above.
Standards and further reading
Complex numbers, rectangular and polar form and angle conversion are standard mathematics, not the subject of a standard. Standards apply when the result feeds an electrical design, and they set the method there.
Frequently asked questions
What do I need to enter?
Enter point 1, x, point 1, y, point 2, x, point 2 and y. Change the unit of a value with its selector and the result stays the same.
What does this calculator assume?
The two points are joined by a straight line and the slope is the same everywhere along it. Slope is rise divided by run. A positive slope rises from point 1 to point 2, a negative slope falls, and the order of the points does not change the slope. Grade is the slope as a percentage, so a grade of 5% rises 5 units for every 100 units of run. "1 in N" is the same gradient written as the run needed for one unit of rise. A vertical line (the two x values equal) has no defined slope, grade, 1-in-N or y-intercept; its angle is 90° and its length is still found. A level line has slope zero and no 1-in-N figure. The tool works on plain numbers and does not track units: enter all four values in the same unit; the slope, grade and angle do not depend on which unit that is. Identical points do not define a line and are rejected.
Which calculators should I use next?
Common next steps are Distance Calculator (Between Two Points, 2D or 3D), Linear Interpolation Calculator, Pythagorean Theorem (Right Triangle) Calculator and Trigonometry (Sin, Cos, Tan). The related links at the bottom of this page open them.
How accurate are the results?
Every figure comes from the same tested engine as the Elecmetric calculators and is meant for estimating. 34 reference cases, calculated from textbook formulas coded separately from the engine by the same author, agree with this calculator. This is not an independent review. Check design values against the standard and the equipment data you work to.
Formula guides and reference
Longer explanations with worked examples and tables, written for the same topic.
- Trigonometry Formulas for Electrical Engineers: Sine, cosine and tangent formulas for engineers: the six trig functions, degrees and radians
- Conveyor Belt Power Formulas: Belt conveyor power formulas: the material load per metre, the friction force
- Solar Array Row Spacing Formulas: Solar row spacing formulas: the solar altitude at the winter solstice, the shadow length
More Engineering Mathematics calculatorsAll engineering calculatorsSlope Calculator (Gradient, Grade and Angle from Two Points) in Elecmetric