geo.centralAngleRadians
This function gives the angle between two points at the center of the sphere, in radians from 0 to pi. It uses the haversine formula. The result is the same when the two points change places.
CLI- Package
- @procedures/geo · README
- Path
["geo","centralAngleRadians"]- CLI
mark geo centralAngleRadians --a <object> --b <object>- As data
{"$proc":["geo","centralAngleRadians"],"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","centralAngleRadians"], { a: {}, b: {} });
console.log(JSON.stringify(result));From the command line
$ mark geo centralAngleRadians --a <object> --b <object>
As data, in a program
{
"$proc": ["geo", "centralAngleRadians"],
"input": { "a": {}, "b": {} }
}Input
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
a | object | yes | ||
b | object | yes |
Output
The schema does not list fields (number).
JSON Schemas
{
"input": {
"type": "object",
"properties": {
"a": {
"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": {}
},
"b": {
"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": [
"a",
"b"
],
"additionalProperties": false
},
"output": {
"type": "number"
}
}