Version 4.12. Revised projections

This commit is contained in:
ClemensF 2018-12-20 21:55:12 +01:00
parent 8cafe207cb
commit 90aa92def0
25 changed files with 390 additions and 167 deletions

View file

@ -10,7 +10,7 @@ using System.Windows;
namespace MapControl
{
/// <summary>
/// Transforms map coordinates according to the Orthographic Projection.
/// Spherical Orthographic Projection.
/// </summary>
public class OrthographicProjection : AzimuthalProjection
{
@ -34,10 +34,11 @@ namespace MapControl
var lat0 = ProjectionCenter.Latitude * Math.PI / 180d;
var lat = location.Latitude * Math.PI / 180d;
var dLon = (location.Longitude - ProjectionCenter.Longitude) * Math.PI / 180d;
var s = TrueScale * 180d / Math.PI;
return new Point(
Wgs84EquatorialRadius * Math.Cos(lat) * Math.Sin(dLon),
Wgs84EquatorialRadius * (Math.Cos(lat0) * Math.Sin(lat) - Math.Sin(lat0) * Math.Cos(lat) * Math.Cos(dLon)));
s * Math.Cos(lat) * Math.Sin(dLon),
s * (Math.Cos(lat0) * Math.Sin(lat) - Math.Sin(lat0) * Math.Cos(lat) * Math.Cos(dLon)));
}
public override Location PointToLocation(Point point)
@ -47,8 +48,9 @@ namespace MapControl
return ProjectionCenter;
}
var x = point.X / Wgs84EquatorialRadius;
var y = point.Y / Wgs84EquatorialRadius;
var s = TrueScale * 180d / Math.PI;
var x = point.X / s;
var y = point.Y / s;
var r2 = x * x + y * y;
if (r2 > 1d)