ForHosting KIT · Developer Utilities

Relative bearing from heading

This relative bearing calculator converts a target's true bearing into the angle seen from a vessel's bow.

● BetaFree · in your browser
Use it from WebAPIEmailTelegramApp soon

Enter the true bearing to the target and the vessel's true heading, both in degrees clockwise from north. The result is normalized to the full 0–360 degree relative-bearing circle and identifies whether the target is ahead, astern, to port, or to starboard. It is useful for navigation exercises, lookout reports, radar interpretation, and checking course-relative observations without manually handling the wrap through north.

What relative bearing tells you

True bearing and relative bearing describe the same line of sight from different references. A true bearing is measured clockwise from true north, while a relative bearing is measured clockwise from the vessel's bow. The calculator changes the reference by subtracting vessel heading from the true bearing to the target. A result of 0 degrees means the target is dead ahead, 90 degrees places it directly on the starboard beam, 180 degrees is dead astern, and 270 degrees is directly on the port beam. Values between those cardinal relative positions give a precise direction around the vessel. This distinction matters because a lookout often speaks in relation to the bow, while a chart, plotted position, or navigation sensor may report directions relative to north. The returned target side makes the numeric result easier to check: values greater than 0 and less than 180 are on the starboard side, while values greater than 180 and less than 360 are on the port side.

How the calculation handles north

The core formula is relative bearing = true bearing − vessel heading. A direct subtraction can be negative when the target's true bearing is numerically smaller than the heading. That does not mean the direction is invalid; it means the result crossed the zero-degree north reference. This calculator adds 360 degrees and applies modulo 360, producing a conventional result from 0 up to, but not including, 360 degrees. For example, a vessel heading of 350 degrees and a target bearing of 45 degrees produce a relative bearing of 55 degrees, so the target is forward on the starboard side. Inputs may use either 0 or 360 degrees for north, and both are normalized to 0 in the result. Decimal degrees are supported for bearings taken from instruments or computed positions. Results are rounded to six decimal places so repeated calls remain stable while retaining more precision than ordinary marine observations generally require. Both inputs must be finite numbers within the published 0–360 degree range.

Using the result correctly

Confirm that both source angles use true north before calculating. A magnetic compass heading combined with a true bearing mixes reference systems and can produce a plausible-looking but incorrect relative bearing. Convert magnetic values to true values first when variation or deviation applies. Also remember that heading describes where the bow points; it is not necessarily the vessel's course over ground when wind, current, or leeway is present. Use heading when the question concerns the target's direction relative to the vessel itself. The output follows the clockwise 0–360 convention rather than a signed port-or-starboard angle. Thus 315 degrees means 45 degrees to port, not 315 degrees of physical separation by the longer route. The target_side field states port or starboard to remove that ambiguity, with exact special labels for dead ahead and dead astern. The calculation is instantaneous and deterministic, making it suitable for training worksheets, bridge software checks, log processing, or repeated API automation at $0.002 per request. It does not determine distance, collision risk, closest point of approach, or whether either vessel is changing course.

Convert a plotted target bearing

Turn a true bearing taken from a chart or sensor into the clockwise angle a lookout would report from the vessel's bow.

Check navigation exercises

Verify relative-bearing arithmetic, including cases where subtraction crosses north and would otherwise produce a negative number.

Normalize bridge observations

Convert heading and true-bearing records into consistent 0–360 degree relative bearings for logs, displays, or downstream analysis.

What formula is used?

The calculator subtracts vessel heading from true bearing, then normalizes the difference into the range from 0 up to, but not including, 360 degrees.

What does a relative bearing of 270 degrees mean?

It means the target is directly on the port beam, equivalent to 90 degrees to port from the bow.

Can I mix magnetic and true bearings?

No. Both angles must share the same north reference. This capability specifically expects a true bearing and a true vessel heading.

Does this calculate collision risk or distance?

No. It calculates direction relative to the bow only; it does not use range, speed, course changes, or closest-point-of-approach data.

How much does an API request cost?

Each API request costs $0.002. The calculation can also run locally in the browser as a tier A capability.

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/relative-bearing

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/relative-bearing \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"true_bearing":45,"vessel_heading":350}'
{
  "true_bearing": 45,
  "vessel_heading": 350
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "geo.relative_bearing",
  "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 →