Elecmetric

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)

Point 1, x 0, point 1, y 0, point 2, x 20, point 2, y 1 gives
Slope m: 0.05 · Grade: 5 · Angle from the horizontal: 2.86240523

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

What remains unverified

Verification register entry

Calculation authorRahul Sharma (author)
Technical reviewNo independent technical review has been carried out
Individual professional approvalNot recorded
Formula referencenot recorded
Standard and editionNot applicable: Pure mathematics or statistics; no electrical standard governs the method
Standard review stateNot applicable
Scope-screening notenot recorded
Cross-check test cases34 reference vectors (tests/reference_vectors.json)
Review datenot recorded
Next review datenot recorded
StatusEngineering 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

m = (y₂ − y₁) / (x₂ − x₁) grade = 100 m angle = atan(m) 1 in N: N = run / rise length = √(run² + rise²) y = m x + b, b = y₁ − m x₁

Worked example

InputValue
Point 1, x0
Point 1, y0
Point 2, x20
Point 2, y1
  1. Rise = y₂ − y₁ = 1 − 0 = 1 Run = x₂ − x₁ = 20 − 0 = 20
  2. Slope m = rise / run = 0.05 Grade = 100 m = 5%
  3. Angle = atan(m) = 2.86240523° Run per unit rise = 20 (1 in 20)
  4. Length = √(run² + rise²) = 20.0249843945 y-intercept b = y₁ − m x₁ = 0

Assumptions

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

InputUnitAllowed or shownNote
Point 1, x(number)-1,000,000,000,000 or more, up to 1,000,000,000,000The 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,000The 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
ResultUnitAllowed or shownNote
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, xSlope mGradeAngle from the horizontal
20.55026.56505118
50.22011.30993247
100.1105.71059314
200.0552.86240523
400.0252.51.43209618
800.01251.250.71615995
2000.0050.50.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.

More Engineering Mathematics calculatorsAll engineering calculatorsSlope Calculator (Gradient, Grade and Angle from Two Points) in Elecmetric

Tell us how to improve this page

This opens your email app. Nothing is sent until you press send.