コード例 #1
0
        /// <summary>
        /// The forward transform from geodetic units to linear units
        /// </summary>
        /// <param name="lp">The array of lambda, phi coordinates</param>
        /// <param name="xy">The array of x, y coordinates</param>
        protected override void OnForward(double[] lp, double[] xy)
        {
            double t, dl1, dl2;
            double sp = Math.Sin(lp[Phi]);
            double cp = Math.Cos(lp[Phi]);
            double z1 = Proj.Aacos(_sp1 * sp + _cp1 * cp * Math.Cos(dl1 = lp[Lambda] + _dlam2));
            double z2 = Proj.Aacos(_sp2 * sp + _cp2 * cp * Math.Cos(dl2 = lp[Lambda] - _dlam2));

            z1   *= z1;
            z2   *= z2;
            xy[X] = _r2z0 * (t = z1 - z2);
            t     = _z02 - t;
            xy[Y] = _r2z0 * Proj.Asqrt(4 * _z02 * z2 - t * t);
            if ((_ccs * sp - cp * (_cs * Math.Sin(dl1) - _sc * Math.Sin(dl2))) < 0)
            {
                xy[Y] = -xy[Y];
            }
        }
コード例 #2
0
 /// <summary>
 /// The inverse transform from linear units to geodetic units
 /// </summary>
 /// <param name="xy">The double values for the input x and y values stored in an array</param>
 /// <param name="lp">The double values for the output lambda and phi values stored in an array</param>
 protected override void OnInverse(double[] xy, double[] lp)
 {
     lp[Phi]    = xy[Y] / Cy;
     lp[Lambda] = xy[X] / (Cx * (Ca + Proj.Asqrt(1 - Cb * lp[Phi] * lp[Phi])));
 }
コード例 #3
0
 /// <summary>
 /// The forward transform from geodetic units to linear units
 /// </summary>
 /// <param name="lp">The array of lambda, phi coordinates</param>
 /// <param name="xy">The array of x, y coordinates</param>
 protected override void OnForward(double[] lp, double[] xy)
 {
     xy[Y] = Cy * lp[Phi];
     xy[X] = Cx * lp[Lambda] * (Ca + Proj.Asqrt(1 - Cb * lp[Phi] * lp[Phi]));
 }