mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-06 06:55:04 +00:00
Version 4.12. Revised projections
This commit is contained in:
parent
8cafe207cb
commit
90aa92def0
25 changed files with 390 additions and 167 deletions
|
|
@ -10,7 +10,7 @@ using System.Windows;
|
|||
namespace MapControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Transforms map coordinates according to the Gnomonic Projection.
|
||||
/// Spherical Gnomonic Projection.
|
||||
/// </summary>
|
||||
public class GnomonicProjection : AzimuthalProjection
|
||||
{
|
||||
|
|
@ -36,7 +36,7 @@ namespace MapControl
|
|||
GetAzimuthDistance(ProjectionCenter, location, out azimuth, out distance);
|
||||
|
||||
var mapDistance = distance < Math.PI / 2d
|
||||
? Wgs84EquatorialRadius * Math.Tan(distance)
|
||||
? Math.Tan(distance) * TrueScale * 180d / Math.PI
|
||||
: double.PositiveInfinity;
|
||||
|
||||
return new Point(mapDistance * Math.Sin(azimuth), mapDistance * Math.Cos(azimuth));
|
||||
|
|
@ -51,7 +51,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 = Math.Atan(mapDistance / Wgs84EquatorialRadius);
|
||||
var distance = Math.Atan(mapDistance / (TrueScale * 180d / Math.PI));
|
||||
|
||||
return GetLocation(ProjectionCenter, azimuth, distance);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue