Skip to main content
Version: 3.1

struct LatLng

(Niantic.Lightship.AR.VpsCoverage.LatLng)

Overview

The LatLng struct represents a Latitude and Longitude pair and provides functionality for comparing LatLng instances with each other.

	struct LatLng: IEquatable< LatLng > {
// fields

double Latitude => lat_degrees;
double Longitude => lng_degrees;

// methods

LatLng(double latitude, double longtitude);
LatLng(LocationInfo locationInfo);
bool Equals(LatLng other);
override int GetHashCode();
override string ToString();
override bool Equals(object obj);
double Distance(LatLng other);
LatLng Add(double bearing, double distance);
LatLng ToRadian();
LatLng ToDegrees();
static double Distance(LatLng l1, LatLng l2);
static double Bearing(LatLng l1, LatLng l2);
static bool operator == (LatLng l1, LatLng l2);
static bool operator != (LatLng l1, LatLng l2);
};

Detailed Documentation

The LatLng struct represents a Latitude and Longitude pair and provides functionality for comparing LatLng instances with each other.

Methods

Distance

double Distance(LatLng other)

Calculates "as-the-crow-flies" distance between points using the Haversine formula.

    Returns:

    Distance between points in meters.

Add

LatLng Add(double bearing, double distance)

    Parameters:

    bearing - Bearing in degrees, clockwise from north

    distance - Distance travelled in meters

Distance

static double Distance(LatLng l1, LatLng l2)

Calculates "as-the-crow-flies" distance between points using the Haversine formula.

    Returns:

    Distance between points in meters.

Bearing

static double Bearing(LatLng l1, LatLng l2)

Calculates the initial bearing (sometimes referred to as forward azimuth) which if followed in a straight line along a great-circle arc will take you from the l1 to l2 points.

    Returns:

    Initial bearing in degrees