Fixed RelativeTransform of azimuthal projections

This commit is contained in:
ClemensFischer 2026-01-28 09:52:11 +01:00
parent 8d25310b8e
commit 3922297e7b
12 changed files with 72 additions and 39 deletions

View file

@ -21,7 +21,7 @@ namespace MapControl
public double FalseNorthing { get; set; } = 2e6;
public Hemisphere Hemisphere { get; set; }
public static double RelativeScale(Hemisphere hemisphere, double flattening, double latitude)
public static double RelativeScale(Hemisphere hemisphere, double flattening, double scaleFactor, double latitude)
{
var sign = hemisphere == Hemisphere.North ? 1d : -1d;
var phi = sign * latitude * Math.PI / 180d;
@ -32,8 +32,8 @@ namespace MapControl
var t = Math.Tan(Math.PI / 4d - phi / 2d)
/ Math.Pow((1d - eSinPhi) / (1d + eSinPhi), e / 2d); // p.161 (15-9)
// r == ρ/(a*k0), omit k0 for relative scale
var r = 2d * t / Math.Sqrt(Math.Pow(1d + e, 1d + e) * Math.Pow(1d - e, 1d - e)); // p.161 (21-33)
// r == ρ/a
var r = scaleFactor * 2d * t / Math.Sqrt(Math.Pow(1d + e, 1d + e) * Math.Pow(1d - e, 1d - e)); // p.161 (21-33)
var m = Math.Cos(phi) / Math.Sqrt(1d - eSinPhi * eSinPhi); // p.160 (14-15)
return r / m; // p.161 (21-32)
@ -41,7 +41,7 @@ namespace MapControl
public override Matrix RelativeTransform(double latitude, double longitude)
{
var k = RelativeScale(Hemisphere, Flattening, latitude);
var k = RelativeScale(Hemisphere, Flattening, ScaleFactor, latitude);
return new Matrix(k, 0d, 0d, k, 0d, 0d);
}