/// <summary> /// Performs the inverse transfrom from a single coordinate of linear units to the same coordinate in geodetic units /// </summary> /// <param name="xy">The double linear input x and y values organized into a 1 dimensional array</param> /// <param name="lp">The double geodetic output lambda and phi values organized into a 1 dimensional array</param> protected override void EllipticalInverse(double[] xy, double[] lp) { double arg = _ml0 + xy[Y] / K0; lp[Phi] = MeridionalDistance.AngularDistance(_ml0 + xy[Y] / K0, Es, _en); if (Math.Abs(lp[Phi]) >= HalfPi) { lp[Phi] = xy[Y] < 0 ? -HalfPi : HalfPi; lp[Lambda] = 0; } else { double sinphi = Math.Sin(lp[Phi]); double cosphi = Math.Cos(lp[Phi]); double t = Math.Abs(cosphi) > 1e-10 ? sinphi / cosphi : 0; double n = _esp * cosphi * cosphi; double con; double d = xy[X] * Math.Sqrt(con = 1 - Es * sinphi * sinphi) / K0; con *= t; t *= t; double ds = d * d; lp[Phi] -= (con * ds / (1 - Es)) * FC2 * (1 - ds * FC4 * (5 + t * (3 - 9 * n) + n * (1 - 4 * n) - ds * FC6 * (61 + t * (90 - 252 * n + 45 * t) + 46 * n - ds * FC8 * (1385 + t * (3633 + t * (4095 + 1574 * t)))))); lp[Lambda] = d * (FC1 - ds * FC3 * (1 + 2 * t + n - ds * FC5 * (5 + t * (28 + 24 * t + 8 * n) + 6 * n - ds * FC7 * (61 + t * (662 + t * (1320 + 720 * t)))))) / cosphi; } }
/// <summary> /// /// </summary> /// <param name="arg"></param> /// <param name="es"></param> /// <param name="en"></param> /// <returns></returns> public static double InvMlfn(double arg, double es, double[] en) { return(MeridionalDistance.AngularDistance(arg, es, en)); }