Distance from Angle and Height Calculator
This distance from angle and height calculator finds the horizontal separation between an observer and an object when the object's vertical height and the elevation angle to its top are known.
Run — free
It applies the right-triangle relationship distance equals height divided by the tangent of the angle, which is the same as multiplying height by cotangent. The result uses the same length unit as the height, making the calculation useful for field estimates, surveying exercises, photography planning, and practical geometry without requiring a sloped line-of-sight distance.
What the calculator measures
The calculation models the object height and ground distance as the perpendicular sides of a right triangle. Enter the object's known vertical height and the measured angle of elevation from the observer to the object's top. The returned horizontal distance is the adjacent side of that triangle, not the diagonal line of sight. Because tangent equals opposite divided by adjacent, rearranging the relationship gives adjacent equals opposite divided by tangent. In this setting, the opposite side is the height and the adjacent side is the horizontal distance. The height may be entered in metres, feet, centimetres, or any other consistent length unit; the output automatically represents that same unit because the trigonometric ratio has no unit. The angle must be expressed in degrees and must be strictly between zero and ninety degrees. This model assumes level ground between the observer and the object's base and treats the supplied height as the full vertical difference from the observation level to the target point.
How to obtain a useful elevation angle
A reliable result begins with a sensible angle measurement. Stand where the base of the object is visible or where its ground position is known, then use a clinometer, surveying instrument, or calibrated phone tool to measure upward from a horizontal reference to the top. Keep the instrument steady and record the angle in degrees. Small angle errors matter more when the elevation angle is shallow, because the tangent changes in a way that can produce a large distance difference. Measure several times and use a representative reading if conditions permit. The calculator assumes the observer's reference point is level with the object's base. If the instrument is above or below that base, the entered height should be the vertical difference from the instrument to the target, not necessarily the object's published total height. For example, an eye-level observation of a tower on level ground requires subtracting eye height from tower height before using this simplified relationship. Sloping ground requires a more complete survey model.
Reading and checking the result
The output includes the original height and angle, the converted angle in radians, and the calculated horizontal distance. Keeping the inputs in the result makes automated records easier to audit, while the radian value shows the quantity used by the trigonometric function. A quick reasonableness check comes from familiar angles. At forty-five degrees, tangent is one, so horizontal distance equals height. Below forty-five degrees, the distance should be greater than the height; above forty-five degrees, it should be smaller. If the result contradicts those relationships, check whether the angle was measured from horizontal rather than from vertical and confirm that degrees, not radians, were supplied. The formula describes an ideal right triangle. It does not correct for Earth curvature, atmospheric refraction, an inaccessible or offset base, terrain slope, or instrument calibration. Those effects may be negligible for ordinary nearby objects but can become important in precision surveying or long-range observations. Use the result as accurate as the geometry and measurements that support it.
What you can do with it
Estimate distance to a landmark
Use a known landmark height and a measured elevation angle to estimate its horizontal ground distance from the observer.
Plan a field observation
Determine how far from a vertical target to place a camera, instrument, or observation point for a chosen measured angle.
Check right-triangle exercises
Verify an adjacent-side calculation from an opposite side and an acute angle with a deterministic cotangent result.
FAQ
Which formula is used?
Horizontal distance equals height divided by tangent of the elevation angle, equivalently height multiplied by the cotangent of that angle.
Which unit does the result use?
The result uses the same length unit as the entered height. Enter feet to receive feet, metres to receive metres, or another consistent unit.
Is this the line-of-sight distance?
No. It is the horizontal adjacent side of the right triangle, not the diagonal hypotenuse from the observer to the target.
Why must the angle be between zero and ninety degrees?
The intended geometry uses a positive acute elevation angle. At zero degrees the distance is unbounded, while ninety degrees does not define a positive horizontal separation through this formula.
What if the observer is above the object's base?
Use the vertical difference between the observation point and the target point as the height. If that difference is unknown, this simplified calculation is not sufficient.
What does API use cost?
Each API request costs $0.002. The same deterministic calculation can also run free in the browser.
For developers — API access
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.
API endpoint
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.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/geo/distance-from-angle-height \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"height":30,"angle_degrees":35}'const res = await fetch("https://api.kit.forhosting.com/geo/distance-from-angle-height", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"height": 30,
"angle_degrees": 35
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/geo/distance-from-angle-height",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"height": 30,
"angle_degrees": 35
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/geo/distance-from-angle-height", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"height":30,"angle_degrees":35}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"height":30,"angle_degrees":35}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/geo/distance-from-angle-height", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"height": 30,
"angle_degrees": 35
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "geo.distance_from_angle_height",
"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.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |