LonelySharp.GeoLocation.DistanceTo C# (CSharp) Méthode

DistanceTo() public méthode

Computes the great circle distance between this GeoLocation instance and the location argument.
public DistanceTo ( GeoLocation location ) : double
location GeoLocation Location to act as the centre point
Résultat double
        public double DistanceTo(GeoLocation location)
        {
            return Math.Acos(Math.Sin(radLat) * Math.Sin(location.radLat) +
                    Math.Cos(radLat) * Math.Cos(location.radLat) *
                    Math.Cos(radLon - location.radLon)) * earthRadius;
        }