Method DistLawOfCosinesRAD
DistLawOfCosinesRAD(Double, Double, Double, Double)
Calculates the distance between two lat/lng's using the Law of Cosines. Due to numeric conditioning errors, it is not as accurate as the Haversine formula for small distances. But with double precision, it isn't that bad -- allegedly 1 meter.
The arguments and return value are in radians.Declaration
public static double DistLawOfCosinesRAD(double lat1, double lon1, double lat2, double lon2)
Parameters
Type | Name | Description |
---|---|---|
System.Double | lat1 | |
System.Double | lon1 | |
System.Double | lat2 | |
System.Double | lon2 |
Returns
Type | Description |
---|---|
System.Double |