public double GetDistance(GeoJSON.Net.Geometry.Point first, GeoJSON.Net.Geometry.Point second) { var d1 = first.Coordinates.Latitude * (Math.PI / 180.0); var num1 = first.Coordinates.Longitude * (Math.PI / 180.0); var d2 = second.Coordinates.Latitude * (Math.PI / 180.0); var num2 = second.Coordinates.Longitude * (Math.PI / 180.0) - num1; var d3 = Math.Pow(Math.Sin((d2 - d1) / 2.0), 2.0) + Math.Cos(d1) * Math.Cos(d2) * Math.Pow(Math.Sin(num2 / 2.0), 2.0); return(6376500.0 * (2.0 * Math.Atan2(Math.Sqrt(d3), Math.Sqrt(1.0 - d3)))); }
private Position PointToPosition(GeoJSON.Net.Geometry.Point point) { return(new Position(point.Coordinates.Latitude, point.Coordinates.Longitude)); }