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 Gnomonic Projection.
/// Spherical Stereographic Projection.
/// </summary>
public class StereographicProjection : AzimuthalProjection
{
@ -35,7 +35,7 @@ namespace MapControl
GetAzimuthDistance(ProjectionCenter, location, out azimuth, out distance);
var mapDistance = 2d * Wgs84EquatorialRadius * Math.Tan(distance / 2d);
var mapDistance = Math.Tan(distance / 2d) * TrueScale * 360d / Math.PI;
return new Point(mapDistance * Math.Sin(azimuth), mapDistance * Math.Cos(azimuth));
}
@ -49,7 +49,7 @@ namespace MapControl
var azimuth = Math.Atan2(point.X, point.Y);
var mapDistance = Math.Sqrt(point.X * point.X + point.Y * point.Y);
var distance = 2d * Math.Atan(mapDistance / (2d * Wgs84EquatorialRadius));
var distance = 2d * Math.Atan(mapDistance / (TrueScale * 360d / Math.PI));
return GetLocation(ProjectionCenter, azimuth, distance);
}