← All procedures

geo.initialBearing

This function gives the initial bearing of the great circle from `from` to `to`, in degrees clockwise from north. The result is from 0 to less than 360.

CLI
Package
@procedures/geo · README
Path
["geo","initialBearing"]
CLI
mark geo initialBearing --from <object> --to <object>
As data
{"$proc":["geo","initialBearing"],"input":{}}

Use it

In TypeScript

import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/geo/register"; // registers its procedures

const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["geo","initialBearing"], { from: {}, to: {} });
console.log(JSON.stringify(result));

From the command line

$ mark geo initialBearing --from <object> --to <object>

As data, in a program

{
  "$proc": ["geo", "initialBearing"],
  "input": { "from": {}, "to": {} }
}

Input

FieldTypeRequiredDefaultDescription
fromobjectyes
toobjectyes

Output

The schema does not list fields (number).

JSON Schemas
{
  "input": {
    "type": "object",
    "properties": {
      "from": {
        "type": "object",
        "properties": {
          "lat": {
            "type": "number",
            "description": "The latitude in degrees, from -90 to 90."
          },
          "lon": {
            "type": "number",
            "description": "The longitude in degrees. A normalized longitude is from -180 to less than 180."
          }
        },
        "required": [
          "lat",
          "lon"
        ],
        "additionalProperties": {}
      },
      "to": {
        "type": "object",
        "properties": {
          "lat": {
            "type": "number",
            "description": "The latitude in degrees, from -90 to 90."
          },
          "lon": {
            "type": "number",
            "description": "The longitude in degrees. A normalized longitude is from -180 to less than 180."
          }
        },
        "required": [
          "lat",
          "lon"
        ],
        "additionalProperties": {}
      }
    },
    "required": [
      "from",
      "to"
    ],
    "additionalProperties": false
  },
  "output": {
    "type": "number"
  }
}