struct LatLng (Niantic.ARDK.LocationService.LatLng)
Overview
Latitude and Longitude, location on a globe More…
struct LatLng: IEquatable< LatLng > { // fields static const double DegToRad = Math.PI / 180.0; static const double EarthRadius = 6371009.0; static const double RadToDeg = 180.0 / Math.PI; // properties double Latitude; double Longitude; // methods LatLng Add(double bearing, double distance); double Distance(LatLng other); bool Equals(LatLng other); override bool Equals(object obj); override int GetHashCode(); LatLng(double latitude, double longtitude); LatLng(LocationInfo locationInfo); LatLng(UnityEngine.LocationInfo locationInfo); LatLng ToDegrees(); LatLng ToRadian(); override string ToString(); static double Bearing(LatLng l1, LatLng l2); static double Distance(LatLng l1, LatLng l2); static bool operator != (LatLng l1, LatLng l2); static bool operator == (LatLng l1, LatLng l2); };
Detailed Documentation
Latitude and Longitude, location on a globe
Methods
LatLng Add(double bearing, double distance)
Parameters:
bearing |
Bearing in degrees, clockwise from north |
distance |
Distance travelled in meters |
double Distance(LatLng other)
Calculates “as-the-crow-flies” distance between points using the Haversine formula.
Returns:
Distance between points in meters.
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
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.