public static double ConvergenceAngle(dPoint dp, int what)
        {
            int      a;
            double   B, l, L, L0, t, n, r;
            Elliptse ell = new Elliptse();

            Ellipses.SetEllipse(what);
            B  = dp.B;
            L  = dp.L;
            a  = (int)(L / 6) + 1;
            L0 = 6 * (double)a - 3;
            Ang A1, A2, b;

            A1.val = L;
            A2.val = L0;
            b.val  = B;
            L      = AngelTransformation.AngtoRad(A1);
            L0     = AngelTransformation.AngtoRad(A2);
            l      = L - L0;
            B      = AngelTransformation.AngtoRad(b);
            t      = Math.Tan(B);
            n      = Math.Sqrt(ell.e2) * Math.Cos(B);
            r      = Math.Sin(B) * l + Math.Sin(B) * Math.Pow(Math.Cos(B), 2) * l * l * l *
                     (1 + 3 * n * n + 2 * Math.Pow(n, 4)) / 3 + Math.Sin(B) * Math.Pow(Math.Cos(B), 4)
                     * Math.Pow(l, 5) * (2 - t * t) / 15;
            Rad r1;

            r1.val = r;
            r      = AngelTransformation.RadtoAng(r1);
            return(r);
        }
        public static dPoint KToD(kPoint kp, int what)
        {
            Elliptse ell = new Elliptse();

            ell = Ellipses.SetEllipse(what);
            double X, Y, Z, N;

            X = kp.X;
            Y = kp.Y;
            Z = kp.Z;
            dPoint dp = new dPoint();
            Rad    b, l;

            l.val = Math.Acos(X / Math.Sqrt(Math.Pow(X, 2.0) + Math.Pow(Y, 2.0)));
            dp.L  = AngelTransformation.RadtoAng(l);
            double[] B1 = new double[99999];
            B1[0] = Math.Atan(Z / Math.Sqrt(X * X + Y * Y));
            int i = 0;

            for (i = 0; i < 99999; i++)
            {
                B1[i + 1] = Math.Atan((1 / Math.Sqrt(Math.Pow(X, 2.0) + Math.Pow(Y, 2.0))) * (Z + (ell.c * ell.e1 * Math.Tan(B1[i])) / Math.Sqrt(1 + ell.e2 + Math.Pow(Math.Tan(B1[i]), 2.0))));
                if (Math.Abs(B1[i + 1] - B1[i]) <= 0.001 / (648000 / Math.PI))
                {
                    break;
                }
            }
            b.val = B1[i];
            dp.B  = AngelTransformation.RadtoAng(b);
            N     = ell.c / Math.Sqrt(1.0 + ell.e2 * Math.Pow(Math.Cos(b.val), 2.0));
            dp.H  = Z / Math.Sin(b.val) - N * (1 - ell.e1);
            return(dp);
        }
Ejemplo n.º 3
0
        public static kPoint Forsol(dPoint dp, int what)
        {
            int      a;
            double   B, L, N, l, t, n, e, X, x, y, a0, a1, a2, a3, a4, a5, a6, a7, L0;
            Elliptse ell = new Elliptse();

            ell = Ellipses.SetEllipse(what);
            B   = dp.B;
            L   = dp.L;
            a   = (int)(L / 6) + 1;
            L0  = 6 * (double)a - 3;
            Ang A1, A2, b;

            A1.val = L;
            A2.val = L0;
            b.val  = B;
            L      = AngelTransformation.AngtoRad(A1);
            L0     = AngelTransformation.AngtoRad(A2);
            l      = L - L0;
            B      = AngelTransformation.AngtoRad(b);
            N      = ell.a / Math.Sqrt(1 - ell.e1 * Math.Pow(Math.Sin(B), 2.0));
            t      = Math.Tan(B);
            n      = Math.Sqrt(ell.e2) * Math.Cos(B);
            e      = ell.e1;
            a0     = 1 + 3 * e / 4 + 45 * e * e / 64 + 175 * e * e * e / 256 + 11025 * e * e * e * e / 16384
                     + 43659 * e * e * e * e * e / 65336 + 693693 * Math.Pow(e, 6) / 1048576
                     + 2760615 * Math.Pow(e, 7) / 41944304 + 703956835 * Math.Pow(e, 8) / 1073741824;
            a1 = 3 * e / 4 + 15 * e * e / 16 + 525 * e * e * e / 512 + 2205 * e * e * e * e / 2048
                 + 72765 * e * e * e * e * e / 65536 + 297297 * Math.Pow(e, 6) / 262144
                 + 19324305 * Math.Pow(e, 7) / 16777216;
            a2 = 15 * e * e / 64 + 105 * e * e * e / 256 + 2205 * e * e * e * e / 4096
                 + 10395 * e * e * e * e * e / 16384 + 1486485 * Math.Pow(e, 6) / 2097152
                 + 6441435 * Math.Pow(e, 7) / 8388608;
            a3 = 35 * e * e * e / 512 + 315 * e * e * e * e / 2048 + 31185 * e * e * e * e * e / 131072
                 + 165165 * Math.Pow(e, 6) / 524288 + 6441435 * Math.Pow(e, 7) / 16777216;
            a4 = 315 * e * e * e * e / 16348 + 3465 * e * e * e * e * e / 65536
                 + 90999 * Math.Pow(e, 6) / 1048576 + 585585 * Math.Pow(e, 7) / 4194304;
            a5 = 693 * Math.Pow(e, 5) / 131072 + 9009 * Math.Pow(e, 6) / 524288
                 + 585585 * Math.Pow(e, 7) / 16777216;
            a6 = 3003 * Math.Pow(e, 6) / 2097152 + 45045 * Math.Pow(e, 7) / 8388608;
            a7 = 6435 * Math.Pow(e, 7) / 16777216;
            X  = ell.a * (1 - e) * (a0 * B - 0.5 * a1 * Math.Sin(2 * B) + 0.25 * a2 * Math.Sin(4 * B)
                                    - a3 * Math.Sin(6 * B) / 6 + a4 * Math.Sin(8 * B) / 8 - a5 * Math.Sin(10 * B) / 10
                                    + a6 * Math.Sin(12 * B) / 12 - a7 * Math.Sin(14 * B) / 14);
            x = X + N * Math.Sin(B) * Math.Cos(B) * l * l / 2
                + N * Math.Sin(B) * Math.Pow(Math.Cos(B), 3) * (5 - t + 9 * n * n + 4 * Math.Pow(n, 4))
                * Math.Pow(l, 4) / 24
                + N * Math.Sin(B) * Math.Pow(Math.Cos(B), 5) * (61 - 58 * t * t + Math.Pow(t, 4))
                * Math.Pow(l, 6) / 720;
            y = N * Math.Cos(B) * l + N * Math.Pow(Math.Cos(B), 3) * (1 - t * t + n * n) * Math.Pow(l, 3) / 6
                + N * Math.Pow(Math.Cos(B), 5)
                * (5 - 18 * t * t + Math.Pow(t, 4) + 14 * n * n - 58 * t * t * n * n) * Math.Pow(l, 5);
            kPoint kp = new kPoint();

            kp.X = x;
            kp.Y = y;
            return(kp);
        }
Ejemplo n.º 4
0
        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            Elliptse _elsp = Ellipses.SetEllipse(comboBox1.SelectedIndex); //获得当前椭球索引

            textBox20.Text = _elsp.name;
            textBox2.Text  = _elsp.a.ToString("F4");
            textBox3.Text  = _elsp.b.ToString("F6");
            textBox4.Text  = Math.Sqrt(_elsp.e1).ToString("F12");
            textBox5.Text  = Math.Sqrt(_elsp.e2).ToString("F9");
            textBox6.Text  = _elsp.f.ToString("F9");
            _elsp.f        = 1 / _elsp.f;
            string f = "(1/" + _elsp.f.ToString("F2") + ")";

            textBox6.Text += f;
            textBox7.Text  = _elsp.c.ToString("F12");
        }
        public static kPoint DToK(dPoint dp, int what)
        {
            Elliptse ell = new Elliptse();

            ell = Ellipses.SetEllipse(what);
            double W, N, B, L, H;
            Ang    b, l;

            b.val = dp.B;
            l.val = dp.L;
            B     = AngelTransformation.AngtoRad(b);
            L     = AngelTransformation.AngtoRad(l);
            H     = dp.H;
            W     = Math.Sqrt(1 - ell.e1 * Math.Pow(Math.Sin(B), 2.0));
            N     = ell.a / W;
            kPoint kp = new kPoint();

            kp.X = (N + H) * Math.Cos(B) * Math.Cos(L);
            kp.Y = (N + H) * Math.Cos(B) * Math.Sin(L);
            kp.Z = (N * (1 - ell.e1) + H) * Math.Sin(B);
            return(kp);
        }