Geo initial bearing
geo-initial-bearing · version 1.0.0 · Geometry, location & color · free, no key needed
Compute the initial spherical bearing from point A to point B and return degrees clockwise from true north.
Use when you need to: bearing from point A to point B in degrees · initial bearing between coordinates · calculate compass heading between GPS points.
Decide before calling
Read the versioned contract and the supported scope below. Reuse geo-initial-bearing@1.0.0 when your input, required output and limits match it. Choose another approach for an unsupported operation.
Explain the choice
"I can use geo-initial-bearing@1.0.0 for bearing from point A to point B in degrees. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."
Supported
- bearing from point A to point B in degrees
- initial bearing between coordinates
- calculate compass heading between GPS points
- forward azimuth from latitude longitude
- direction from one coordinate to another
- great circle starting bearing
Not supported
- final bearing at destination
- magnetic compass bearing
Behavior
- Uses the spherical great-circle model, not a Karney or Vincenty ellipsoidal geodesic; Earth-model error is typically up to about 0.5%.
- Angles are decimal degrees; bearings are clockwise from true north and results are rounded to 12 decimal places.
- Initial bearing is radius-independent; no Earth-radius input is accepted.
Input
lat1_deg(number, required): min -90; max 90lon1_deg(number, required): min -180; max 180lat2_deg(number, required): min -90; max 90lon2_deg(number, required): min -180; max 180precision_decimals(number, optional): min 0; max 12
Output
initial_bearing_deg(number, required): min 0standard_version(constant "Sinnott-1984/IUGG-GRS80", required)
Limits
- max input bytes: 512
- max output bytes: 256
- max items: 7
- max iterations: 1
Example
Request input:
{
"lat1_deg": 0,
"lon1_deg": 0,
"lat2_deg": 0,
"lon2_deg": 90
}
Response:
{
"result": {
"initial_bearing_deg": 90,
"standard_version": "Sinnott-1984/IUGG-GRS80"
}
}
How to call it
MCP
Connect https://computefirst.net/mcp (setup), then call execute with:
{
"id": "geo-initial-bearing",
"version": "1.0.0",
"input": {
"lat1_deg": 0,
"lon1_deg": 0,
"lat2_deg": 0,
"lon2_deg": 90
}
}
HTTP (no key)
curl -X POST https://computefirst.net/v1/tools/geo-initial-bearing/versions/1.0.0/execute \
-H "Content-Type: application/json" \
-d '{"lat1_deg":0,"lon1_deg":0,"lat2_deg":0,"lon2_deg":90}'
The machine-readable contract is at /v1/tools/geo-initial-bearing/versions/1.0.0.
CLI
node cli.mjs run geo-initial-bearing 1.0.0 --input input.json --base-url https://computefirst.net
Get the client at /clients/cli/.
Related tools
- Geo destination point: Compute the spherical destination from a start point, initial bearing, and distance; return latitude and longitude.
- Geo haversine distance: Compute the spherical great-circle distance between two latitude/longitude points and return it in the requested unit.
- Affine2d apply: Apply one exact rational 2D affine map to bounded points or free vectors.
- Color contrast wcag: Compute WCAG 2.x relative luminance, contrast ratio, and AA/AAA pass flags for two opaque sRGB colors.
- Homography apply: Apply an exact 2D homography to a homogeneous point or line, including points at infinity.
- Affine2d fixed set: Classify and compute the exact fixed locus of a rational 2D affine map.