wasSharp

Subversion Repositories:
Compare Path: Rev
With Path: Rev
?path1? @ 16  →  ?path2? @ 27
/Geo/Constants.cs
@@ -10,4 +10,4 @@
{
public static readonly Distance EARTH_MEAN_RADIUS = new Distance(6371000);
}
}
}
/Geo/Distance.cs
@@ -21,7 +21,7 @@
Meters = meters;
}
 
public double Kilometers => Meters/1000d;
public double Kilometers => Meters / 1000d;
 
public double Meters { get; }
 
@@ -82,4 +82,4 @@
return base.GetHashCode();
}
}
}
}
/Geo/GeodesicExtensions.cs
@@ -20,19 +20,18 @@
GeographicCoordinate targetGeographicCoordinate,
DistanceUnits distanceUnits)
{
var sourcePhi = Math.PI*sourceGeographicCoordinate.Latitude/180;
var targetPhi = Math.PI*targetGeographicCoordinate.Latitude/180;
var deltaPhi = Math.PI*(targetPhi - sourcePhi)/180;
var deltaLam = Math.PI*(targetGeographicCoordinate.Longitude - sourceGeographicCoordinate.Longitude)/180;
var sourcePhi = Math.PI * sourceGeographicCoordinate.Latitude / 180;
var targetPhi = Math.PI * targetGeographicCoordinate.Latitude / 180;
var deltaPhi = Math.PI * (targetPhi - sourcePhi) / 180;
var deltaLam = Math.PI * (targetGeographicCoordinate.Longitude - sourceGeographicCoordinate.Longitude) / 180;
 
var a = Math.Sin(deltaPhi / 2) * Math.Sin(deltaPhi / 2) +
Math.Cos(sourcePhi) * Math.Cos(targetPhi) *
Math.Sin(deltaLam / 2) * Math.Sin(deltaLam / 2);
 
var a = Math.Sin(deltaPhi/2)*Math.Sin(deltaPhi/2) +
Math.Cos(sourcePhi)*Math.Cos(targetPhi)*
Math.Sin(deltaLam/2)*Math.Sin(deltaLam/2);
var c = 2 * Math.Atan2(Math.Sqrt(a), Math.Sqrt(1 - a));
 
var c = 2*Math.Atan2(Math.Sqrt(a), Math.Sqrt(1 - a));
 
return new Distance(Constants.EARTH_MEAN_RADIUS.Meters*c);
return new Distance(Constants.EARTH_MEAN_RADIUS.Meters * c);
}
}
}
}
/Geo/GeographicCoordinate.cs
@@ -18,4 +18,4 @@
 
public double Longitude { get; }
}
}
}