Spherical class

December 12, 2019 ยท View on GitHub


API Reference


Static method

  • computeDistanceBetween(locationA, locationB)

    Returns the distance, in meters, between two LatLngs.

    Params Type Details
    locationA ILatLng origin
    locationB ILatLng destination

    :arrow_right: number

  • computeOffset(from, distance, heading)

    Returns the LatLng resulting from moving a distance from an origin in the specified heading (expressed in degrees clockwise from north)

    Params Type Details
    from ILatLng origin
    distances number in meter
    heading number angle(clockwise)

    :arrow_right: LatLng

  • computeOffsetOrigin(to, distance, heading)

    Returns the location of origin when provided with a LatLng destination, meters travelled and original heading. Headings are expressed in degrees clockwise from North. This function returns null when no solution is available.

    Params Type Details
    to ILatLng destination
    distances number in meter
    heading number angle(clockwise)

    :arrow_right: LatLng

  • computeLength(path)

    Returns the length of the given path.

    Params Type Details
    path ILatLng[] | BaseArrayClass<ILatLng> a sequence of LatLngs

    :arrow_right: number

  • computeArea(path)

    Returns the area of a closed path. The computed area uses the same units as the radius.

    Params Type Details
    path ILatLng[] | BaseArrayClass<ILatLng> a sequence of LatLngs

    :arrow_right: number

  • computeSignedArea(path)

    Returns the signed area of a closed path. The signed area may be used to determine the orientation of the path.

    Params Type Details
    path ILatLng[] | BaseArrayClass<ILatLng> a sequence of LatLngs

    :arrow_right: number

  • computeHeading(from, to)

    Returns the heading from one LatLng to another LatLng. Headings are expressed in degrees clockwise from North within the range (-180,180).

    Params Type Details
    from ILatLng origin
    to ILatLng destination

    :arrow_right: number

  • interpolate(from, to, fraction)

    Returns the LatLng which lies the given fraction of the way between the origin LatLng and the destination LatLng.

    Params Type Details
    from ILatLng origin
    to ILatLng destination
    fraction number A fraction of the distance to travel from 0.0 to 1.0 .

    :arrow_right: LatLng