mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-08 07:55:13 +00:00
Use mean radius in distance calculations
This commit is contained in:
parent
c187f323a8
commit
23a8e49efb
8 changed files with 20 additions and 14 deletions
|
|
@ -36,7 +36,7 @@ namespace MapControl
|
|||
|
||||
Center.GetAzimuthDistance(latitude, longitude, out double azimuth, out double distance);
|
||||
|
||||
var mapDistance = Math.Tan(distance / 2d) * 2d * Wgs84EquatorialRadius;
|
||||
var mapDistance = Math.Tan(distance / 2d) * 2d * Wgs84MeanRadius;
|
||||
|
||||
return new Point(mapDistance * Math.Sin(azimuth), mapDistance * Math.Cos(azimuth));
|
||||
}
|
||||
|
|
@ -50,7 +50,7 @@ namespace MapControl
|
|||
|
||||
var azimuth = Math.Atan2(x, y);
|
||||
var mapDistance = Math.Sqrt(x * x + y * y);
|
||||
var distance = 2d * Math.Atan(mapDistance / (2d * Wgs84EquatorialRadius));
|
||||
var distance = 2d * Math.Atan(mapDistance / (2d * Wgs84MeanRadius));
|
||||
|
||||
return Center.GetLocation(azimuth, distance);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue