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 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); }
public static kPoint ParaSwi(kPoint kp, double X, double Y, double xita, double k) { kPoint kp1 = new kPoint(); Ang a; a.val = xita; xita = AngelTransformation.AngtoRad(a); kp1.X = X + k * kp.X * Math.Cos(xita) - k * kp.Y * Math.Sin(xita); kp1.Y = Y + k * kp.Y * Math.Cos(xita) + k * kp.X * Math.Sin(xita); return(kp1); }
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); }