C# Class Azavea.Open.Reprojection.GeoMath

A class full of static methods for doing geometry-related math.
Datei anzeigen Open project: azavea/net-omgeo-reprojection

Public Methods

Method Description
ConvertToDegrees ( double radians ) : double

Converts a value in radians into degrees.

ConvertToRadians ( double degrees ) : double

Converts a value in degrees into radians.

HaversineDistanceMeters ( ICoordinate coord1, ICoordinate coord2 ) : double

Uses the Haversine formula, assuming a spherical Earth, to calculate distance (in meters) between two lat/lon coordinates. Haversine is faster but less accurate than Vicenty. You may multiply the results by the handy constants MILES_PER_METER, FEET_PER_METER, etc. to get the distance in those units instead.

HaversineDistanceMeters ( IPoint point1, IPoint point2 ) : double

Uses the Haversine formula, assuming a spherical Earth, to calculate distance (in meters) between two lat/lon points. Haversine is faster but less accurate than Vicenty. You may multiply the results by the handy constants MILES_PER_METER, FEET_PER_METER, etc. to get the distance in those units instead.

HaversineDistanceMeters ( double lon1, double lat1, double lon2, double lat2 ) : double

Uses the Haversine formula, assuming a spherical Earth, to calculate distance (in meters) between two lat/lon points. Haversine is faster but less accurate than Vicenty. You may multiply the results by the handy constants MILES_PER_METER, FEET_PER_METER, etc. to get the distance in those units instead.

VicentyDistanceMeters ( ICoordinate coord1, ICoordinate coord2 ) : double

Uses the Vicenty formula, assuming a ellopsoidal Earth, to calculate distance (in meters) between two lat/lon coordinates. Vicenty is slower but more accurate than Haversine. You may multiply the results by the handy constants MILES_PER_METER, FEET_PER_METER, etc. to get the distance in those units instead.

VicentyDistanceMeters ( IPoint point1, IPoint point2 ) : double

Uses the Vicenty formula, assuming a ellopsoidal Earth, to calculate distance (in meters) between two lat/lon points. Vicenty is slower but more accurate than Haversine. You may multiply the results by the handy constants MILES_PER_METER, FEET_PER_METER, etc. to get the distance in those units instead.

VicentyDistanceMeters ( double lon1, double lat1, double lon2, double lat2 ) : double

Uses the Vicenty formula, assuming a ellopsoidal Earth, to calculate distance (in meters) between two lat/lon points. Vicenty is slower but more accurate than Haversine. You may multiply the results by the handy constants MILES_PER_METER, FEET_PER_METER, etc. to get the distance in those units instead.

Method Details

ConvertToDegrees() public static method

Converts a value in radians into degrees.
public static ConvertToDegrees ( double radians ) : double
radians double A value in radians.
return double

ConvertToRadians() public static method

Converts a value in degrees into radians.
public static ConvertToRadians ( double degrees ) : double
degrees double A value in degrees.
return double

HaversineDistanceMeters() public static method

Uses the Haversine formula, assuming a spherical Earth, to calculate distance (in meters) between two lat/lon coordinates. Haversine is faster but less accurate than Vicenty. You may multiply the results by the handy constants MILES_PER_METER, FEET_PER_METER, etc. to get the distance in those units instead.
public static HaversineDistanceMeters ( ICoordinate coord1, ICoordinate coord2 ) : double
coord1 ICoordinate First coordinate
coord2 ICoordinate Second coordinate
return double

HaversineDistanceMeters() public static method

Uses the Haversine formula, assuming a spherical Earth, to calculate distance (in meters) between two lat/lon points. Haversine is faster but less accurate than Vicenty. You may multiply the results by the handy constants MILES_PER_METER, FEET_PER_METER, etc. to get the distance in those units instead.
public static HaversineDistanceMeters ( IPoint point1, IPoint point2 ) : double
point1 IPoint First point
point2 IPoint Second point
return double

HaversineDistanceMeters() public static method

Uses the Haversine formula, assuming a spherical Earth, to calculate distance (in meters) between two lat/lon points. Haversine is faster but less accurate than Vicenty. You may multiply the results by the handy constants MILES_PER_METER, FEET_PER_METER, etc. to get the distance in those units instead.
public static HaversineDistanceMeters ( double lon1, double lat1, double lon2, double lat2 ) : double
lon1 double First point's longitude
lat1 double First point's latitude
lon2 double Second point's longitude
lat2 double Second point's latitude
return double

VicentyDistanceMeters() public static method

Uses the Vicenty formula, assuming a ellopsoidal Earth, to calculate distance (in meters) between two lat/lon coordinates. Vicenty is slower but more accurate than Haversine. You may multiply the results by the handy constants MILES_PER_METER, FEET_PER_METER, etc. to get the distance in those units instead.
public static VicentyDistanceMeters ( ICoordinate coord1, ICoordinate coord2 ) : double
coord1 ICoordinate First coordinate
coord2 ICoordinate Second coordinate
return double

VicentyDistanceMeters() public static method

Uses the Vicenty formula, assuming a ellopsoidal Earth, to calculate distance (in meters) between two lat/lon points. Vicenty is slower but more accurate than Haversine. You may multiply the results by the handy constants MILES_PER_METER, FEET_PER_METER, etc. to get the distance in those units instead.
public static VicentyDistanceMeters ( IPoint point1, IPoint point2 ) : double
point1 IPoint First point
point2 IPoint Second point
return double

VicentyDistanceMeters() public static method

Uses the Vicenty formula, assuming a ellopsoidal Earth, to calculate distance (in meters) between two lat/lon points. Vicenty is slower but more accurate than Haversine. You may multiply the results by the handy constants MILES_PER_METER, FEET_PER_METER, etc. to get the distance in those units instead.
public static VicentyDistanceMeters ( double lon1, double lat1, double lon2, double lat2 ) : double
lon1 double First point's longitude
lat1 double First point's latitude
lon2 double Second point's longitude
lat2 double Second point's latitude
return double