Distance off by two bearings
Take a bearing of 45° on a landmark, run 2 nautical miles, take 90°, and you were 2.828427124746 miles off at the first sight, 2 at the second and 2 when abeam. Enter both relative bearings and the run to cross-check your plotter. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- First bearing
- 45
- Second bearing
- 90
- Distance run
- 2
- Bearing difference
- 45
- Distance off at first
- 2.8284271247
- Distance off at second
- 2
- Distance off abeam
- 2
Coastal navigators still use two successive bearings of a fixed landmark—a lighthouse, headland, or conspicuous tower—to estimate how far off they are without radar or GNSS. You steam a steady course, note the relative bearing of the object, run a known distance, then take a second relative bearing of the same object. This distance off by two bearings calculator applies the law of sines in the triangle formed by the two ship positions and the landmark, returning distance off at the first fix, distance off at the second fix, and the classic distance off when the object is abeam. Special cases such as doubling the angle on the bow and the four-point bearing fall out of the same formulas, so training drills and watchkeeping checks stay consistent.
What two bearings and a distance run measure
When a vessel holds a constant course and observes a fixed object twice, the path between the two fixes is a straight track segment of known length—the distance run, from log, speed and time, or planned legs. The first relative bearing is the angle between the heading and the line of sight to the landmark at the first observation; the second relative bearing is the same angle measured later after steaming that distance.
Those two angles and the run form a triangle with vertices at the first position, the second position, and the landmark. The interior angle at the first position equals the first relative bearing; the angle at the landmark equals the absolute difference of the two relative bearings; the angle at the second position is the supplement of the second relative bearing when both sights are on the same side of the course.
The law of sines then gives distance off at the second position as distance run times sine of the first bearing divided by sine of the bearing difference, distance off at the first position as distance run times sine of the second bearing divided by the same sine of the difference, and distance off when abeam as distance run times the product of both sines divided by that difference sine.
Relative bearings must lie strictly between zero and one hundred eighty degrees so the object is not dead ahead or dead astern on the course line, and they must differ so the triangle does not collapse. Units of the run—nautical miles, kilometres, or statute miles—pass through unchanged into every distance-off result.
Where this calculation helps on the water
Watch officers and coastal skippers use a distance off by two bearings calculator to cross-check plotter ranges when a lighthouse or headland is the only conspicuous mark, especially when radar clutter or GNSS multipath near cliffs is a concern. Sailing schools and exam prep for coastal navigation certificates need a deterministic oracle that reproduces doubling-the-angle and four-point answers so candidates can verify hand work without a full ECDIS stack.
Simulator and game engines that model visual piloting can call the same pure module to place a vessel’s distance off after two logged relative bearings and a logged run. Keep bearings as relative angles from course, not raw compass readings unless you first reduce them to relative bearings on the same side of the track, pin the rounded distances in tests, and you get reproducible coastal geometry for homework, LMS plugins, and edge workers without standing up a chartroom library of your own.
What you can do with it
Bridge and coastal piloting checks
From two relative bearings of a lighthouse and the distance run between them, compute distance off at each fix and when abeam to cross-check radar or plotter ranges.
Coastal navigation training and exams
Verify doubling-the-angle-on-the-bow and four-point bearing drills with a deterministic oracle that matches textbook law-of-sines answers.
FAQ
What is a relative bearing here?
The angle in degrees between the ship’s course (heading along the track) and the line of sight to the landmark. Convert absolute compass bearings to relative bearings before calling if you measured true or magnetic bearings.
Why must the two bearings differ?
Equal or nearly equal bearings make sin(|β−α|) zero, so the triangle collapses and distance off is undefined.
What is the four-point bearing?
It is the classic case of a first bearing of 45° and a second of 90°. The distance off when the landmark is abeam then equals the distance run: after a run of 2 miles, you are 2 miles off.
Which three distances does the calculator give?
The distance off the landmark at the first sight, at the second sight, and when it is abeam. With 45°, 90° and a run of 2, they are 2.828427124746, 2 and 2.
Why must each bearing be between 0° and 180°?
A bearing of 0° or 180° puts the landmark dead ahead or dead astern on your course line, so no triangle can be formed and the distance off cannot be solved.
Related tools
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-off-two-bearings \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"first_bearing":45,"second_bearing":90,"distance_run":2}'const res = await fetch("https://api.kit.forhosting.com/geo/distance-off-two-bearings", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"first_bearing": 45,
"second_bearing": 90,
"distance_run": 2
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/geo/distance-off-two-bearings",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"first_bearing": 45,
"second_bearing": 90,
"distance_run": 2
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/geo/distance-off-two-bearings", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"first_bearing":45,"second_bearing":90,"distance_run":2}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"first_bearing":45,"second_bearing":90,"distance_run":2}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/geo/distance-off-two-bearings", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"first_bearing": 45,
"second_bearing": 90,
"distance_run": 2
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "geo.distance_off_two_bearings",
"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. |
Technical notes
Input contract, response fields, and validation
Relative bearings must be strictly greater than zero and strictly less than one hundred eighty degrees. Distance run must be strictly positive. A method string names the law-of-sines relative-bearing solve, and a formula string restates the three identities for display beside the answer. Failed validation is not billed; successful parse calls use the published base price. POST a JSON body with three required finite numbers: first_bearing, the relative bearing in degrees at the first observation; second_bearing, the relative bearing in degrees at the second observation; and distance_run, the positive distance steamed between those sights on a constant course. Each field may arrive as a JSON number or as a numeric string; aliases such as bearing1, bearing2, first_angle, second_angle, alpha, beta, run, distance, and distance_steamed are accepted for the same quantities. On success the body echoes first_bearing, second_bearing, and distance_run; reports bearing_difference as the absolute difference in degrees; and returns distance_off_at_first, distance_off_at_second, and distance_off_abeam rounded to twelve decimal places for stable goldens across runtimes. Example: first_bearing forty-five, second_bearing ninety, distance_run two recovers the four-point rule with distance off when abeam equal to two in the same unit as the run.
Integration use cases
Simulators and automation
Feed logged relative bearings and run distance into a pure parse API so bridge simulators and notebooks get stable distance-off values without chart libraries.
Technical questions
How do I compute distance off from two bearings?
Send first_bearing and second_bearing as relative bearings in degrees (strictly between 0 and 180) and distance_run as the positive distance steamed between sights. The API returns distance off at first and second positions and when abeam via the law of sines.
Does doubling the angle on the bow work?
Yes. When the second relative bearing is twice the first, distance_off_at_second equals distance_run. A four-point pair (45° then 90°) yields distance_off_abeam equal to the run.
What does the distance off by two bearings calculator cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.