← All procedures
geo.geodesicDirect
This function gives the point at a distance along the geodesic from a start point with an initial bearing. It also gives the bearing of the geodesic at that point.
CLI- Package
- @procedures/geo · README
- Path
["geo","geodesicDirect"]- CLI
mark geo geodesicDirect --from <object> --bearingDegrees <number> --meters <number>- As data
{"$proc":["geo","geodesicDirect"],"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","geodesicDirect"], { from: {}, bearingDegrees: 1, meters: 1 });
console.log(JSON.stringify(result));From the command line
$ mark geo geodesicDirect --from <object> --bearingDegrees <number> --meters <number>
As data, in a program
{
"$proc": ["geo", "geodesicDirect"],
"input": { "from": {}, "bearingDegrees": 1, "meters": 1 }
}Input
Output
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": {},
"description": "The start point."
},
"bearingDegrees": {
"type": "number",
"description": "The initial bearing in degrees clockwise from north. Each finite value is correct."
},
"meters": {
"type": "number",
"description": "The distance along the geodesic in metres. Each finite value is correct."
},
"ellipsoid": {
"type": "object",
"properties": {
"equatorialRadiusMeters": {
"type": "number",
"description": "The equatorial radius `a` in metres. It is a finite number more than 0."
},
"flattening": {
"type": "number",
"description": "The flattening `f`, equal to `(a - b) / a` for the polar radius `b`. It is a finite number less than 1. A negative flattening gives a prolate ellipsoid. The results are accurate for an absolute flattening of 1/50 or less."
}
},
"required": [
"equatorialRadiusMeters",
"flattening"
],
"additionalProperties": {},
"description": "The ellipsoid. The default is `WGS84`."
}
},
"required": [
"from",
"bearingDegrees",
"meters"
],
"additionalProperties": false
},
"output": {
"type": "object",
"properties": {
"point": {
"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": {},
"description": "The end point. Its longitude is normalized."
},
"finalBearing": {
"type": "number",
"description": "The bearing of the geodesic at the end point, in degrees clockwise from north, from 0 to less than 360."
}
},
"required": [
"point",
"finalBearing"
],
"additionalProperties": {}
}
}