大地测量学编程实习报告--大地主题解算(共16页).docx
精选优质文档-倾情为你奉上大地测量学编程实习报告大地主题解算学院: 测绘学院 专业: 测绘工程 班级: 2014级2班 学号: 39 姓名: 何杨 一、 实习目的1. 提高运用计算机语言编程开发的能力; 2. 加深对大地主题解算计算公式及辅助参数的理解并掌握计算步骤; 3. 通过编程语言实现大地主题解算。二、注意事项1. 计算所需变量多,容易混淆; 2. 正反算函数的编写; 3. 函数调用; 4. 弧度与角度之间的转化。三、 程序框图 B01 = S * Math.Cos(A12) / M;L01 = S * Math.Sin(A12)/ (N * Math.Cos(B1);A01= S *Math.Sin(A12)*Math.Tan(B1)/N;开始 输入e2,c,L1,B1,A12,S 正算Am = A12 + 0.5 * A01;Bm = B1 + 0.5 * B01;B02 = B1 + B02;L02 = L1 + L02;A02 = A12 + A02+PI; Yes 输出B2,L2,A21结束Am = A12 + 0.5 * A02;Bm = B1 + 0.5 * B02; 反算输出S,A12,A21S = U/ Math.Sin(Am);A12 = Am - 0.5 * dA;A21 = Am + 0.5 * dA + Math.PI;判断Am的象限 Am=arctan(U/V)U=SsinAm = r01 * dL + r21 * dB * dB * dL + r03 * dL * dL * dL;V=ScosAm = S10 * dB + S12 * dB * dL * dL + S30 * dB * dB * dB;开始输入e2,c,L1,B1,L2,B2Am = A12 + 0.5 * A01;Bm = B1 + 0.5 * B01; 四、 源代码调用的函数: public double Mjisuan(double B)/M计算 double M; M = a * (1 - e2) *Math.Pow(1 - e2 * Math.Sin(B) * Math.Sin(B),-1.5); return M; public double Njisuan(double B)/N计算 double N; N = a * Math.Pow(1 - e2 * Math.Sin(B) * Math.Sin(B), -0.5); return N; public double angletorad(double angle)/角度转弧度 double rad; rad = Math.PI * angle / 180; return rad; public double Amcalculate(double b,double l,double SsinAm,double ScosAm)/ Am计算 double c,T,Am; c = Math.Abs(ScosAm / SsinAm); if (Math.Abs(b) > Math.Abs(l) T = Math.Atan(Math.Abs(SsinAm / ScosAm); else T = Math.PI * 0.25 + Math.Atan(1 - c) / (1 + c); if (b > 0 && l >= 0) Am = T; else if (b < 0 && l >= 0) Am = Math.PI - T; else if (b <= 0 && l < 0) Am = Math.PI + T; else if (b = 0 && l > 0) Am = Math.PI * 0.5; else Am = 2 * Math.PI - T; return Am; 正算 private void button1_Click(object sender, EventArgs e) double B1 = Convert.ToDouble(textBox1.Text) + Convert.ToDouble(textBox8.Text) / 60 + Convert.ToDouble(textBox9.Text) / 3600; double L1 = Convert.ToDouble(textBox2.Text) + Convert.ToDouble(textBox11.Text) / 60 + Convert.ToDouble(textBox10.Text) / 3600; double A12 = Convert.ToDouble(textBox4.Text) + Convert.ToDouble(textBox12.Text) / 60 + Convert.ToDouble(textBox13.Text) / 3600; double S = Convert.ToDouble(textBox3.Text); double Am,Bm,Lm,A23,B23,L23,B01,L01,A01,M,N,B02,L02,A02,t,n2,p1,p2,p3,Vm2; B1 = angletorad(B1); L1 = angletorad(L1); A12 = angletorad(A12); M=Mjisuan(B1); N=Njisuan(B1); B01 = S * Math.Cos(A12) / M; L01 = S * Math.Sin(A12)/ (N * Math.Cos(B1); A01= S *Math.Sin(A12)*Math.Tan(B1)/N; Am = A12 + 0.5 * A01; Bm = B1 + 0.5 * B01; M = Mjisuan(Bm); N = Njisuan(Bm); t=Math.Tan(Bm); n2=Math.Cos(Bm)*Math.Cos(Bm)*e2/(1-e2); Vm2 = 1 + n2; B02 = (Vm2/ N) * S * Math.Cos(Am) * (1 + S * S / (24 * N * N) * (Math.Sin(Am) * Math.Sin(Am) * (2 + 3 * t * t + 3 * n2*t*t) + 3 * Math.Cos(Am) * Math.Cos(Am) * n2 * (t * t - 1 - n2 - 4 * n2 * t * t); L02=(1/(N*Math.Cos(Bm)*S*Math.Sin(Am)*(1+S*S/(24*N*N)*(t*t*Math.Sin(Am)*Math.Sin(Am)-Math.Cos(Am)*Math.Cos(Am)*(1+n2-9*n2*t*t+n2*n2); A02=(1/N)*S*Math.Sin(Am)*t*(1+S*S/(24*N*N)*(Math.Cos(Am)*Math.Cos(Am)*(2+7*n2+9*n2*t*t+5*n2*n2)+Math.Sin(Am)*Math.Sin(Am)*(2+t*t+2*n2); while (Math.Abs(B02 - B01) > 0. && Math.Abs(L02 - L01) > 0. && Math.Abs(A02 - A01) > 0.) A01 = A02; B01 = B02; L01 = L02; Am = A12 + 0.5 * A02; Bm = B1 + 0.5 * B02; Lm = L1 + 0.5 * L02; M = Mjisuan(Bm); N = Njisuan(Bm); t = Math.Tan(Bm); n2 = Math.Cos(Bm) * Math.Cos(Bm) * e2 / (1 - e2); B02 = (Vm2/ N) * S * Math.Cos(Am) * (1 + S * S / (24 * N * N) * (Math.Sin(Am) * Math.Sin(Am) * (2 + 3 * t * t + 3 * n2 * t * t) + 3 * Math.Cos(Am) * Math.Cos(Am) * n2 * (t * t - 1 - n2 - 4 * n2 * t * t); L02 = (1 / (N * Math.Cos(Bm) * S * Math.Sin(Am) * (1 + S * S / (24 * N * N) * (t * t * Math.Sin(Am) * Math.Sin(Am) - Math.Cos(Am) * Math.Cos(Am) * (1 + n2 - 9 * n2 * t * t + n2 * n2); A02 = (1 / N) * S * Math.Sin(Am) * t * (1 + S * S / (24 * N * N) * (Math.Cos(Am) * Math.Cos(Am) * (2 + 7 * n2 + 9 * n2 * t * t + 5 * n2 * n2) + Math.Sin(Am) * Math.Sin(Am) * (2 + t * t + 2 * n2); B02 = B1 + B02; L02 = L1 + L02; A02 = A12 + A02+Math.PI; p1 = 180.0 * A02 / Math.PI; int A21 = (int)p1; int A22 = (int)(p1 - A21) * 60); A23 = (p1 - A21 - A22 / 60.0) * 3600; p2 = 180.0 * B02 / Math.PI; int B21 = (int)p2; int B22 = (int)(p2 - B21) * 60); B23 = (p2 - B21 - B22 / 60.0) * 3600; p3 = 180.0 * L02 / Math.PI; int L21 = (int)p3; int L22 = (int)(p3 - L21) * 60); L23 = (p3 - L21 - L22 / 60.0) * 3600; if (A21 > 360) A21 = A21 - 180; textBox5.Text = B21.ToString(); textBox21.Text = B22.ToString(); textBox20.Text = B23.ToString(); textBox6.Text = L21.ToString(); textBox18.Text = L22.ToString(); textBox16.Text = L23.ToString(); textBox19.Text = A21.ToString(); textBox17.Text = A22.ToString(); textBox15.Text = A23.ToString(); 反算 private void button2_Click(object sender, EventArgs e) double B1 = Convert.ToDouble(textBox1.Text) + Convert.ToDouble(textBox8.Text) / 60 + Convert.ToDouble(textBox9.Text) / 3600; double L1 = Convert.ToDouble(textBox2.Text) + Convert.ToDouble(textBox11.Text) / 60 + Convert.ToDouble(textBox10.Text) / 3600; double B2 = Convert.ToDouble(textBox5.Text) + Convert.ToDouble(textBox21.Text) / 60 + Convert.ToDouble(textBox20.Text) / 3600; double L2 = Convert.ToDouble(textBox6.Text) + Convert.ToDouble(textBox18.Text) / 60 + Convert.ToDouble(textBox16.Text) / 3600; B1 = angletorad(B1); L1 = angletorad(L1); B2 = angletorad(B2); L2 = angletorad(L2); double SsinAm, ScosAm, r01, r21, r03, S10, S12, S30, M, N, Am, Bm, t, n2, Vm2, t01, t21, t03, dA, dL, dB, S, A12, A21; double p1, p2, A123, A213; dL = L2 - L1; dB = B2 - B1; Bm = 0.5 * (B1 + B2); M = Mjisuan(Bm); N = Njisuan(Bm); t = Math.Tan(Bm); n2 = Math.Cos(Bm) * Math.Cos(Bm) * e2 / (1 - e2); Vm2 = 1 + n2; r01 = N * Math.Cos(Bm); r21 = N * Math.Cos(Bm) / (24 * Vm2 * Vm2) * (1 + n2 - 9 * n2 * t * t + n2 * n2); r03 = -N / 24 * Math.Cos(Bm) * Math.Cos(Bm) * Math.Cos(Bm) * t; S10 = N / Vm2; S12 = -N / (24 * Vm2) * Math.Cos(Bm) * Math.Cos(Bm) * (2 + 3 * t * t + 2 * n2); S30 = N / (8 * Vm2 * Vm2 * Vm2) * (n2 - t * t * n2 + n2 * n2); t01 = t * Math.Cos(Bm); t21 = 1 / (24 * Vm2 * Vm2) * Math.Cos(Bm) * t * (2 + 7 * n2 + 9 * t * t * n2 + 5 * n2 * n2); t03 = 1 / (24) * Math.Cos(Bm) * Math.Cos(Bm) * Math.Cos(Bm) * t * (2 + t * t + 2 * n2 * t*t); SsinAm = r01 * dL + r21 * dB * dB * dL + r03 * dL * dL * dL; ScosAm = S10 * dB + S12 * dB * dL * dL + S30 * dB * dB * dB; dA = t01 * dL + t21 * dB * dB * dL + t03 * dL * dL * dL; Am = Amcalculate(B2 - B1, L2 - L1, SsinAm, ScosAm); S = SsinAm / Math.Sin(Am); A12 = Am - 0.5 * dA; A21 = Am + 0.5 * dA + Math.PI; p1 = 180.0 * A12 / Math.PI; int A121 = (int)p1; int A122 = (int)(p1 - A121) * 60); A123 = (p1 - A121 - A122 / 60.0) * 3600; p2 = 180.0 * A21 / Math.PI; int A211 = (int)p2; int A212 = (int)(p2 - A211) * 60); A213 = (p2 - A211 - A212 / 60.0) * 3600; if (A121 > 360) A121 = A121 - 180; textBox4.Text = A121.ToString(); textBox12.Text = A122.ToString(); textBox13.Text = A123.ToString(); textBox19.Text = A211.ToString(); textBox17.Text = A212.ToString(); textBox15.Text = A213.ToString(); textBox3.Text = S.ToString(); 五、 运算结果正算 反算(可对比结果,几乎一样)六、 实习总结 此次实习我收获颇多,我不仅对大地主题解算的公式更加的了解,而且对c#语言的掌握也更加熟悉了。在实习过程中,遇到了一些问题,但是在我的精心检查下,都一一排除了。简而言之,此次实习是十分理想的。专心-专注-专业