ForHosting KIT · Developer Utilities

Slope degrees between two points

This slope angle calculator converts the horizontal distance and elevation difference between two points into a signed angle in degrees.

● BetaFree · in your browser
Use it from WebAPIEmailTelegramApp soon

It applies the standard arctangent relationship between rise and run, giving positive results for an uphill second point, negative results for a downhill second point, and zero for level ground. The calculation works with metres, feet, kilometres, miles, or any other length unit, provided both measurements use the same unit. Along with the angle, the response includes the slope ratio, radians, and a plain-language direction for straightforward checking and reuse.

Measure rise and run consistently

Start with two quantities: the horizontal distance between the points and the signed elevation difference from the first point to the second. Horizontal distance means the plan-view distance, not the longer distance measured along an inclined surface. Elevation difference is the second elevation minus the first, so a point that is 18 metres higher has a rise of 18, while a point that is 18 metres lower has a rise of -18. Both values must use the same length unit. You may use feet for both, metres for both, or any other consistent unit because the division cancels the unit. Do not mix a horizontal distance in kilometres with an elevation difference in metres unless you convert one first. The horizontal distance must be greater than zero because an arctangent of rise over zero does not describe this calculator's intended two-point slope. A zero elevation difference is valid and produces a level angle of zero degrees. Good source measurements matter more than extra decimal places: rounding an uncertain field measurement to many digits does not make it more accurate.

Understand the arctangent calculation

The calculator first divides elevation difference by horizontal distance to obtain the slope ratio, often called rise over run. It then evaluates the arctangent of that ratio. Arctangent returns the angle whose tangent equals the supplied ratio; the result is converted from radians to degrees by multiplying by 180 divided by pi. For example, equal rise and run produce a ratio of 1 and an angle of 45 degrees. A rise of 1 over a run of 10 produces about 5.71 degrees. The sign is preserved: reversing only the elevation difference changes an uphill angle into an equally steep downhill angle. The returned slope ratio and radian angle make the result easier to audit or pass to software that expects another representation. Precision controls output rounding only; it does not change the internal division or arctangent. Because the algorithm uses direct finite-number arithmetic without network calls, stored state, random values, or current time, identical valid inputs always produce identical outputs. This is a geometric angle from horizontal, not a compass bearing, map azimuth, or percentage grade, although the ratio can be multiplied by 100 to obtain percent grade.

Interpret and apply the result safely

Read a positive angle as ascent from the first point toward the second, a negative angle as descent, and zero as level. The accompanying direction field states uphill, downhill, or level so applications do not need to infer meaning from a rounded number. The result is useful for surveying checks, trail planning, drainage concepts, ramps, roads, landscaping, and quick comparisons between elevation profiles. However, it is a mathematical result based entirely on the measurements supplied. It does not account for terrain between the endpoints, curvature, obstacles, local building codes, accessible-design rules, vehicle limits, soil stability, or measurement uncertainty. A long segment can have the same endpoint angle as a short segment while containing very different intermediate grades, so use shorter intervals when local steepness matters. For construction, safety-critical access, drainage, or legal compliance, verify measurements and requirements with appropriate instruments and qualified professionals. If a device reports sloped surface distance rather than horizontal distance, convert or remeasure before using this tool. In automated workflows, reject missing, non-finite, or nonpositive distance values instead of substituting defaults; explicit validation prevents a plausible-looking angle from concealing incomplete data.

Check a trail segment

Convert mapped horizontal distance and endpoint elevation change into a signed climbing or descending angle.

Compare site measurements

Calculate angles consistently for several surveyed segments while retaining the ratio and radians for analysis.

Validate an elevation workflow

Add a deterministic angle calculation to GIS, landscaping, drainage, or engineering data preparation.

What does the API calculation cost?

Each API request costs $0.002; the browser calculator is available for interactive use.

Which units can I use?

Any length unit works as long as horizontal distance and elevation difference use the same unit.

Why can the angle be negative?

A negative elevation difference means the second point is lower than the first, so the signed angle indicates downhill travel.

Is horizontal distance the same as distance along the slope?

No. Horizontal distance is the plan-view run. Using surface distance in its place understates the angle.

How is percent grade related to the result?

Percent grade is the returned slope ratio multiplied by 100; the angle is arctangent of that ratio expressed in degrees.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/geo/slope-degrees-two-points

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/geo/slope-degrees-two-points \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"horizontal_distance":120,"elevation_difference":30}'
{
  "horizontal_distance": 120,
  "elevation_difference": 30
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "geo.slope_degrees_two_points",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Read the full KIT documentation →