gis-tools-ts - v0.6.0
    Preparing search index...

    Class Orthodrome

    Orthodrome

    Represents an orthodrome, which is the shortest path between two points on a sphere. Learn more here

    import { Orthodrome } from 'gis-tools-ts'

    // starting at lon-lat (-60, -40) and ending at (20, 10)
    const orthodrome = new Orthodrome(-60, -40, 20, 10);
    // OR create from VectorPoints
    const orthodrome = Orthodrome.fromPoints({ x: -60, y: -40 }, { x: 20, y: 10 });
    // { x: -39.13793657428956, y: -33.72852197561652 }
    const intermediatePoint = orthodrome.intermediatePoint(0.2);
    // Distance in KM: 1.5514126949321814
    const distance = orthodrome.distanceTo();
    // get the bearing of the first point to the second in degrees
    const bearing = orthodrome.bearing();
    Index

    Constructors

    • Parameters

      • startLon: number

        start longitude in degrees

      • startLat: number

        start latitude in degrees

      • endLon: number

        end longitude in degrees

      • endLat: number

        end latitude in degrees

      Returns Orthodrome

    Properties

    a: number

    distance property

    dist: number

    distance property

    lat1: number

    start latitude in radians

    lat2: number

    end latitude in radians

    lon1: number

    start longitude in radians

    lon2: number

    end longitude in radians

    Methods

    • Returns number

      the bearing in degrees between the two points

    • Finds the distance between the two points in kilometers projected normalized (0->1)

      Returns number

      • total distance between the two points
    • input t 0->1. Find a point along the orthodrome.

      Parameters

      • t: number

        distance along the orthodrome to find

      Returns LonLat

      [lon, lat]