← All procedures

geo.intermediatePoint

This function gives the point at a part of the way along the great circle from `from` to `to`. A part of 0 gives the start, 0.5 gives the middle, and 1 gives the end. The longitude of the result is normalized.

CLI
Package
@procedures/geo · README
Path
["geo","intermediatePoint"]
CLI
mark geo intermediatePoint --from <object> --to <object> --part <number>
As data
{"$proc":["geo","intermediatePoint"],"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","intermediatePoint"], { from: {}, to: {}, part: 1 });
console.log(JSON.stringify(result));

From the command line

$ mark geo intermediatePoint --from <object> --to <object> --part <number>

As data, in a program

{
  "$proc": ["geo", "intermediatePoint"],
  "input": { "from": {}, "to": {}, "part": 1 }
}

Input

FieldTypeRequiredDefaultDescription
fromobjectyes
toobjectyes
partnumberyesThe part of the way, as a number. Each finite value is correct.

Output

FieldTypeRequiredDefaultDescription
latnumberyesThe latitude in degrees, from -90 to 90.
lonnumberyesThe longitude in degrees. A normalized longitude is from -180 to less than 180.
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": {}
      },
      "part": {
        "type": "number",
        "description": "The part of the way, as a number. Each finite value is correct."
      }
    },
    "required": [
      "from",
      "to",
      "part"
    ],
    "additionalProperties": false
  },
  "output": {
    "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": {}
  }
}