測(cè)繪類C#程序代碼_第1頁(yè)
測(cè)繪類C#程序代碼_第2頁(yè)
測(cè)繪類C#程序代碼_第3頁(yè)
已閱讀5頁(yè),還剩25頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、.常用測(cè)量程序設(shè)計(jì)代碼(1)用全站儀在A點(diǎn)觀測(cè)了B點(diǎn)斜邊和垂直角,求A到B的高差。(提示:,D-斜邊,-垂直角,-儀器高,-反光鏡高,-大氣折光系數(shù))using System;using System.Collections.Generic;using System.Text;namespace ConsoleApplication1classApplication staticvoid Main(string args) Console.Write("請(qǐng)輸入斜邊=");double D = double.Parse(Console.ReadLine();Console.W

2、rite("請(qǐng)輸入垂直角ddd.mmss=");double a = DEG(double.Parse(Console.ReadLine();Console.Write("請(qǐng)輸入儀器高=");double i = double.Parse(Console.ReadLine();Console.Write("請(qǐng)輸入反光鏡高=");double v = double.Parse(Console.ReadLine();double h = D * Math.Sin(a) + (1 - 0.13) * D / 6371000.0 * D /

3、6371000.0 * Math.Cos(a) * Math.Cos(a) / 2.0 + i - v;Console.WriteLine("高差為0",h); /將ddd.mmss轉(zhuǎn)為弧度staticpublicdouble DEG(double ang) int fuhao = (int)(ang / Math.Abs(ang); ang = Math.Abs(ang);int d = (int)ang;int m = (int)(ang * 100) - d * 100;double s = ang * 10000 - m * 100 - d * 10000;retu

4、rn (d + m / 60.0 + s / 3600.0) * fuhao) / 180.0 * Math.PI; (2)如圖所示,已知A點(diǎn)的坐標(biāo)及A點(diǎn)到B點(diǎn)的邊長(zhǎng)及方位角,計(jì)算B點(diǎn)的坐標(biāo)。using System;using System.Collections.Generic;using System.Text;namespace ConsoleApplication1classApplication staticvoid Main(string args) Console.Write("請(qǐng)輸入A點(diǎn)的X坐標(biāo)=");double XA = double.Parse(Co

5、nsole.ReadLine();Console.Write("請(qǐng)輸入A點(diǎn)的Y坐標(biāo)=");double YA = double.Parse(Console.ReadLine();Console.Write("請(qǐng)輸入A到B的方位角ddd.mmss=");double a = DEG(double.Parse(Console.ReadLine();Console.Write("請(qǐng)輸入A到B的水平距離=");double S = double.Parse(Console.ReadLine();double XB = XA + S*Math.

6、Cos(a);double YB = YA + S*Math.Sin(a);Console.WriteLine("B點(diǎn)的坐標(biāo)(0,1)",XB,YB); /將ddd.mmss轉(zhuǎn)為弧度staticpublicdouble DEG(double ang) int fuhao = (int)(ang / Math.Abs(ang); ang = Math.Abs(ang);int d = (int)ang;int m = (int)(ang * 100) - d * 100;double s = ang * 10000 - m * 100 - d * 10000;return (

7、d + m / 60.0 + s / 3600.0) * fuhao) / 180.0 * Math.PI; (3)如圖所示,已知A點(diǎn)和B點(diǎn)的坐標(biāo),計(jì)算A點(diǎn)到的邊長(zhǎng)及方位角。using System;using System.Collections.Generic;using System.Text;namespace ConsoleApplication1classApplication staticvoid Main(string args) Console.Write("請(qǐng)輸入A點(diǎn)的X坐標(biāo)=");double XA = double.Parse(Console.Rea

8、dLine();Console.Write("請(qǐng)輸入A點(diǎn)的Y坐標(biāo)=");double YA = double.Parse(Console.ReadLine();Console.Write("請(qǐng)輸入B點(diǎn)的X坐標(biāo)=");double XB = double.Parse(Console.ReadLine();Console.Write("請(qǐng)輸入B點(diǎn)的Y坐標(biāo)=");double YB = double.Parse(Console.ReadLine();double S = 距離(XA, YA, XB, YB);double a = 方位角(X

9、A, YA, XB, YB);Console.WriteLine("AB間的距離=0,從A到B的方位角=1",S,DMS(a); /將弧度轉(zhuǎn)為ddd.mmssstaticpublicdouble DMS(double ang) ang += 1.0E-15;/加上一個(gè)小量,以保證進(jìn)位int fuhao = (int)(ang / Math.Abs(ang); ang = Math.Abs(ang) * 180.0 / Math.PI;int d = (int)ang; ang = (ang - d) * 60.0;int m = (int)ang;double s = (a

10、ng - m) * 60.0;return (d + m / 100.0 + s / 10000.0) * fuhao; /計(jì)算方位角,返回弧度值publicstaticdouble 方位角(double x1, double y1, double x2, double y2) double deltaX = x2 - x1;double deltaY = y2 - y1;double angle = Math.PI * 0.5;if (Math.Abs(deltaX) > 0.000000001) angle = Math.Atan2(deltaY, deltaX); if (angl

11、e < 0) angle += Math.PI; if (deltaY < 0.0) angle += Math.PI; return angle; /計(jì)算距離publicstaticdouble 距離(double x1, double y1, double x2, double y2) returnMath.Sqrt(x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1); (4)在如圖所示的支中導(dǎo)線,已知A點(diǎn)到M點(diǎn)的坐標(biāo)方位角及每個(gè)左角,求每條邊的坐標(biāo)方位角。using System;using System.Collections.Gene

12、ric;using System.Text;namespace ConsoleApplication1classApplication staticvoid Main(string args) Console.Write("請(qǐng)輸入A點(diǎn)到M點(diǎn)的坐標(biāo)方位角=");/將A點(diǎn)到M點(diǎn)的坐標(biāo)方位角換算為M點(diǎn)到A點(diǎn)的坐標(biāo)方位角,以便利用公式double a0 = DEG(double.Parse(Console.ReadLine() +180.0);if (a0 > 2 * Math.PI) a0 -= 2 * Math.PI; List<double> 導(dǎo)線轉(zhuǎn)角集合

13、= newList<double>();int i = 1;do Console.Write("請(qǐng)輸入第0個(gè)轉(zhuǎn)角的水平角左角為正,右角為負(fù) <直接回車結(jié)束輸入>=",i+);string str = Console.ReadLine();if (str != ") 導(dǎo)線轉(zhuǎn)角集合.Add(DEG(double.Parse(str); else break; while (true); i = 1;foreach (double a in 導(dǎo)線轉(zhuǎn)角集合) a0 += a + Math.PI;if (a0 > 2 * Math.PI) a0

14、 -= 2 * Math.PI; elseif (a0 < 0.0) a0 += 2 * Math.PI; Console.WriteLine("第0條邊的方位角為1",i+,DMS(a0); /將弧度轉(zhuǎn)為ddd.mmssstaticpublicdouble DMS(double ang) ang += 1.0E-15;/加上一個(gè)小量,以保證進(jìn)位int fuhao = (int)(ang / Math.Abs(ang); ang = Math.Abs(ang) * 180.0 / Math.PI;int d = (int)ang; ang = (ang - d) *

15、60.0;int m = (int)ang;double s = (ang - m) * 60.0;return (d + m / 100.0 + s / 10000.0) * fuhao; /將ddd.mmss轉(zhuǎn)為弧度staticpublicdouble DEG(double ang) int fuhao = (int)(ang / Math.Abs(ang); ang = Math.Abs(ang);int d = (int)ang;int m = (int)(ang * 100) - d * 100;double s = ang * 10000 - m * 100 - d * 10000

16、;return (d + m / 60.0 + s / 3600.0) * fuhao) / 180.0 * Math.PI; (5)在如圖所示的支中導(dǎo)線,已知A點(diǎn)和M點(diǎn)的坐標(biāo)及每個(gè)左角和每條邊長(zhǎng),求每個(gè)點(diǎn)的坐標(biāo)。using System;using System.Collections.Generic;using System.Text;namespace ConsoleApplication1classApplication staticvoid Main(string args) Console.Write("請(qǐng)輸入M點(diǎn)的x坐標(biāo)=");double Mx = doub

17、le.Parse(Console.ReadLine();Console.Write("請(qǐng)輸入M點(diǎn)的y坐標(biāo)=");double My = double.Parse(Console.ReadLine();Console.Write("請(qǐng)輸入A點(diǎn)的x坐標(biāo)=");double Ax = double.Parse(Console.ReadLine();Console.Write("請(qǐng)輸入A點(diǎn)的y坐標(biāo)=");double Ay = double.Parse(Console.ReadLine();List<double> 導(dǎo)線轉(zhuǎn)角集合

18、= newList<double>();List<double> 導(dǎo)線邊長(zhǎng)集合 = newList<double>();int i = 1;do Console.Write("請(qǐng)輸入第0個(gè)轉(zhuǎn)角的水平角左角為正,右角為負(fù)<直接回車結(jié)束輸入>=",i);string str = Console.ReadLine();if (str != ") 導(dǎo)線轉(zhuǎn)角集合.Add(DEG(double.Parse(str); else break; Console.Write("請(qǐng)輸入第0條邊長(zhǎng)值=", i+); 導(dǎo)

19、線邊長(zhǎng)集合.Add( double.Parse(Console.ReadLine(); while (true);/計(jì)算M到A的坐標(biāo)方位角double a0 = 方位角(Mx, My, Ax, Ay);/計(jì)算每個(gè)點(diǎn)的坐標(biāo)double x0 = Ax;double y0 = Ay;for (int j = 0; j < 導(dǎo)線轉(zhuǎn)角集合.Count; j+) a0 += 導(dǎo)線轉(zhuǎn)角集合j + Math.PI;if (a0 > 2 * Math.PI) a0 -= 2 * Math.PI; x0 = x0 + 導(dǎo)線邊長(zhǎng)集合j * Math.Cos(a0); y0 = y0 + 導(dǎo)線邊長(zhǎng)集合j

20、 * Math.Sin(a0);Console.WriteLine("P0點(diǎn)的坐標(biāo)是:1,2",j+2,x0,y0); /將ddd.mmss轉(zhuǎn)為弧度staticpublicdouble DEG(double ang) int fuhao = (int)(ang / Math.Abs(ang); ang = Math.Abs(ang);int d = (int)ang;int m = (int)(ang * 100) - d * 100;double s = ang * 10000 - m * 100 - d * 10000;return (d + m / 60.0 + s

21、/ 3600.0) * fuhao) / 180.0 * Math.PI; /計(jì)算方位角,返回弧度值publicstaticdouble 方位角(double x1, double y1, double x2, double y2) double deltaX = x2 - x1;double deltaY = y2 - y1;double angle = Math.PI * 0.5;if (Math.Abs(deltaX) > 0.000000001) angle = Math.Atan2(deltaY, deltaX); if (angle < 0) angle += Math

22、.PI; if (deltaY < 0.0) angle += Math.PI; return angle; (6)在如圖所示的單一附合水準(zhǔn)路線中,已知A點(diǎn)和B點(diǎn)的高程及每段的長(zhǎng)度和高差,求每個(gè)點(diǎn)的高程。using System;using System.Collections.Generic;using System.Text;namespace ConsoleApplication1classApplication staticvoid Main(string args) Console.Write("請(qǐng)輸入A點(diǎn)的高程=");double Ha = double.

23、Parse(Console.ReadLine();Console.Write("請(qǐng)輸入B點(diǎn)的高程=");double Hb = double.Parse(Console.ReadLine();List<double> 路線段長(zhǎng)度集合 = newList<double>();List<double> 路線段高差集合 =newList<double>();int i = 1;do Console.Write("請(qǐng)輸入第0段長(zhǎng)度公里為單位<直接回車結(jié)束輸入>=",i);string str = Con

24、sole.ReadLine();if (str != ") 路線段長(zhǎng)度集合.Add(double.Parse(str); else break; Console.Write("請(qǐng)輸入第0段高差=", i+); 路線段高差集合.Add(double.Parse(Console.ReadLine(); while (true);/計(jì)算水準(zhǔn)路線閉合差double w = 0;double 總長(zhǎng)度 = 0;for (int j = 0; j < 路線段長(zhǎng)度集合.Count; j+) w += 路線段高差集合j; 總長(zhǎng)度 += 路線段長(zhǎng)度集合j; w = w - (H

25、b - Ha); /閉合差double v = -w / 總長(zhǎng)度; /每公里改正數(shù)/計(jì)算每個(gè)點(diǎn)的高程double H = Ha;for (int j = 0; j < 路線段長(zhǎng)度集合.Count; j+) H += 路線段高差集合j + v * 路線段長(zhǎng)度集合j;Console.WriteLine("P0點(diǎn)的高程是:1",j+1,H); Console.WriteLine("最后一點(diǎn)就是B點(diǎn)!"); (7)在如圖所示的前方交會(huì)中,ABJ三點(diǎn)按逆時(shí)針?lè)较蚺帕?,已知AB兩點(diǎn)的坐標(biāo)和兩個(gè)交會(huì)角度,求J點(diǎn)的坐標(biāo)。using System;using Sys

26、tem.Collections.Generic;using System.Text;namespace ConsoleApplication1classApplication staticvoid Main(string args) Console.Write("請(qǐng)輸入A點(diǎn)的x坐標(biāo)=");double Ax = double.Parse(Console.ReadLine();Console.Write("請(qǐng)輸入A點(diǎn)的y坐標(biāo)=");doubleAy = double.Parse(Console.ReadLine();Console.Write("

27、請(qǐng)輸入B點(diǎn)的x坐標(biāo)=");double Bx = double.Parse(Console.ReadLine();Console.Write("請(qǐng)輸入B點(diǎn)的y坐標(biāo)=");double By = double.Parse(Console.ReadLine();Console.Write("請(qǐng)輸入的角度值=");double = DEG(double.Parse(Console.ReadLine();Console.Write("請(qǐng)輸入的角度值=");double = DEG(double.Parse(Console.ReadL

28、ine();/計(jì)算A到B的坐標(biāo)方位角double a0 = 方位角(Ax, Ay, Bx, By);/計(jì)算A到J的坐標(biāo)方位角 a0 -= ;/計(jì)算A到B的邊長(zhǎng)double s = 距離(Ax, Ay, Bx, By);/計(jì)算A到J的邊長(zhǎng) s = s / Math.Sin(Math.PI - - ) * Math.Sin();/計(jì)算J的坐標(biāo)double Jx = Ax + s * Math.Cos(a0);double Jy = Ay + s * Math.Sin(a0);Console.WriteLine("J點(diǎn)的坐標(biāo)=0,1",Jx,Jy); /將ddd.mmss轉(zhuǎn)為弧度

29、staticpublicdouble DEG(double ang) int fuhao = (int)(ang / Math.Abs(ang); ang = Math.Abs(ang);int d = (int)ang;int m = (int)(ang * 100) - d * 100;double s = ang * 10000 - m * 100 - d * 10000;return (d + m / 60.0 + s / 3600.0) * fuhao) / 180.0 * Math.PI; /計(jì)算方位角,返回弧度值publicstaticdouble 方位角(double x1,

30、double y1, double x2, double y2) double deltaX = x2 - x1;double deltaY = y2 - y1;double angle = Math.PI * 0.5;if (Math.Abs(deltaX) > 0.000000001) angle = Math.Atan2(deltaY, deltaX); if (angle < 0) angle += Math.PI; if (deltaY < 0.0) angle += Math.PI; return angle; /計(jì)算距離publicstaticdouble 距離

31、(double x1, double y1, double x2, double y2) returnMath.Sqrt(x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1); (8)在如圖所示的單個(gè)多邊形中,已知每個(gè)點(diǎn)的坐標(biāo),求多邊形的面積。提示面積的計(jì)算公式為:using System;using System.Collections.Generic;using System.Text;namespace ConsoleApplication1classApplication staticvoid Main(string args) List<do

32、uble> 多邊形X坐標(biāo)集 = newList<double>();List<double> 多邊形Y坐標(biāo)集 = newList<double>();int i = 1;do Console.Write("請(qǐng)輸入第0點(diǎn)的x坐標(biāo)<直接回車就結(jié)束輸入>=",i);string str = Console.ReadLine();if (str != ") 多邊形X坐標(biāo)集.Add(double.Parse(str); else break; Console.Write("請(qǐng)輸入第0點(diǎn)的y坐標(biāo)=",i

33、+); 多邊形Y坐標(biāo)集.Add( double.Parse(Console.ReadLine(); while (true);/計(jì)算面積double area = 0;/點(diǎn)的個(gè)數(shù)int Count = 多邊形X坐標(biāo)集.Count;for (int j = 0; j < Count-1; j+) area += 多邊形X坐標(biāo)集j * 多邊形Y坐標(biāo)集j + 1 - 多邊形X坐標(biāo)集j + 1 * 多邊形Y坐標(biāo)集j; /計(jì)算最后一點(diǎn)到起點(diǎn)的項(xiàng) area += 多邊形X坐標(biāo)集Count - 1 * 多邊形Y坐標(biāo)集0 - 多邊形X坐標(biāo)集0 * 多邊形Y坐標(biāo)集Count - 1;Console.Wri

34、teLine("多邊形的面積=0",Math.Abs(area * 0.5); (9)在如圖所示的僅有一個(gè)連接角的附合導(dǎo)線中,已知A點(diǎn)和B點(diǎn)的高程及每條邊的斜邊、垂直角、儀器高和反光鏡高,求每個(gè)點(diǎn)的高程。(提示:,D-斜邊,-垂直角,-儀器高,-反光鏡高,-大氣折光系數(shù))using System;usingSystem.Collections.Generic;using System.Linq;using System.Text;namespace導(dǎo)線classProgram staticvoid Main(string args) Console.Write("

35、請(qǐng)輸入A點(diǎn)的高程=");double HA = double.Parse(Console.ReadLine();Console.Write("請(qǐng)輸入B點(diǎn)的高程=");double HB = double.Parse(Console.ReadLine();List<double> 高差集合 = newList<double>();List<double> 水平距離平方集合 = newList<double>();int i = 1;double高差和 = 0;double水平距離平方和 = 0;do Console.W

36、rite("請(qǐng)輸入0點(diǎn)到1點(diǎn)的斜距D<直接回車結(jié)束輸入>=",i,i+1);string str = Console.ReadLine();if (str = ") break;double D = double.Parse(str);Console.Write("請(qǐng)輸入0點(diǎn)到1點(diǎn)的垂直角=", i, i + 1);double = 導(dǎo)線.DEG(double.Parse(Console.ReadLine();/并化為弧度Console.Write("請(qǐng)輸入0的儀器高=", i);double儀器高 = doub

37、le.Parse(Console.ReadLine();Console.Write("請(qǐng)輸入0的反光鏡高=", i+1);double反光鏡高 = double.Parse(Console.ReadLine(); i+;double水平距離;double h = 導(dǎo)線.高差(D, , 儀器高, 反光鏡高, out水平距離);水平距離平方集合.Add(水平距離 * 水平距離);高差集合.Add(h);水平距離平方和 += 水平距離 * 水平距離;高差和 += h; while (true);/計(jì)算高差閉合差double高差閉合差 = HA + 高差和 - HB;/計(jì)算單位長(zhǎng)度

38、改正數(shù),三角高程的權(quán)與距離的平方成反比double單位長(zhǎng)度改正數(shù) = -高差閉合差 / 水平距離平方和;/計(jì)算每點(diǎn)高程double H = HA;for (int j = 0; j < 高差集合.Count; j+) H += 高差集合j + 單位長(zhǎng)度改正數(shù) * 水平距離平方集合j;Console.WriteLine("第0點(diǎn)的高程H=1",j+2,H); Console.WriteLine("最后一個(gè)點(diǎn)的高程應(yīng)該與B點(diǎn)的高程相同!"); class導(dǎo)線 /將ddd.mmss轉(zhuǎn)為弧度staticpublicdouble DEG(double ang

39、) int fuhao = (int)(ang / Math.Abs(ang); ang = Math.Abs(ang);int d = (int)ang;int m = (int)(ang * 100) - d * 100;double s = ang * 10000 - m * 100 - d * 10000;return (d + m / 60.0 + s / 3600.0) * fuhao) / 180.0 * Math.PI; /高差計(jì)算,返回高差publicstaticdouble高差(double斜距,double垂直角,double儀器高,double反光鏡高,outdoubl

40、e水平距離) double h = 斜距 * Math.Sin(垂直角) + 斜距 * Math.Cos(垂直角) / 6371000.0 * 斜距 * Math.Cos(垂直角) * (1 - 0.13) + 儀器高 - 反光鏡高;水平距離 = 斜距*Math.Cos(垂直角);return h; (10)在如圖所示的僅有一個(gè)連接角的附合導(dǎo)線中,已知M點(diǎn)、A點(diǎn)和B點(diǎn)的坐標(biāo),每個(gè)點(diǎn)的左角及每條邊的水平距離,求每個(gè)點(diǎn)的坐標(biāo)。using System;using System.Collections.Generic;using System.Text;namespace導(dǎo)線classProgram

41、 staticvoid Main(string args) Console.Write("請(qǐng)輸入M點(diǎn)的X坐標(biāo)=");double MX = double.Parse(Console.ReadLine();Console.Write("請(qǐng)輸入M點(diǎn)的Y坐標(biāo)=");double MY = double.Parse(Console.ReadLine();Console.Write("請(qǐng)輸入A點(diǎn)的X坐標(biāo)=");double AX = double.Parse(Console.ReadLine();Console.Write("請(qǐng)輸入A

42、點(diǎn)的Y坐標(biāo)=");double AY = double.Parse(Console.ReadLine();Console.Write("請(qǐng)輸入B點(diǎn)的X坐標(biāo)=");double BX = double.Parse(Console.ReadLine();Console.Write("請(qǐng)輸入B點(diǎn)的Y坐標(biāo)=");double BY = double.Parse(Console.ReadLine();/計(jì)算M到A的方位角double0 = 導(dǎo)線.方位角(MX, MY, AX, AY);List<double> 坐標(biāo)增量X集合 = newLis

43、t<double>();List<double> 坐標(biāo)增量Y集合 = newList<double>();int i = 1;double坐標(biāo)增量X和 = 0;double坐標(biāo)增量Y和 = 0;double坐標(biāo)增量X絕對(duì)值和 = 0;double坐標(biāo)增量Y絕對(duì)值和 = 0;double水平距離和 = 0;do Console.Write("請(qǐng)輸入0點(diǎn)到1點(diǎn)的水平距離S<直接回車結(jié)束輸入>=",i,i+1);string str = Console.ReadLine();if (str = ") break;doubl

44、e S = double.Parse(str);Console.Write("請(qǐng)輸入0點(diǎn)的水平角<左角為正,右角為負(fù)>=", i);double = 導(dǎo)線.DEG(double.Parse(Console.ReadLine(); i+;/計(jì)算坐標(biāo)增量double dx, dy;0 = 導(dǎo)線.坐標(biāo)(0, 0, , S, 0, out dx, out dy);坐標(biāo)增量X集合.Add(dx);坐標(biāo)增量Y集合.Add(dy);坐標(biāo)增量X和 += dx; ;坐標(biāo)增量Y和 += dy; ;坐標(biāo)增量X絕對(duì)值和 += Math.Abs(dx);坐標(biāo)增量Y絕對(duì)值和 += Math

45、.Abs(dy);水平距離和 += S; while (true);/計(jì)算閉合差double閉合差X = AX + 坐標(biāo)增量X和 - BX;double閉合差Y = AY + 坐標(biāo)增量Y和 - BY;/計(jì)算單位長(zhǎng)度改正數(shù)double X坐標(biāo)單位長(zhǎng)度改正數(shù) = -閉合差X / 坐標(biāo)增量X絕對(duì)值和;double Y坐標(biāo)單位長(zhǎng)度改正數(shù) = -閉合差Y / 坐標(biāo)增量Y絕對(duì)值和;/計(jì)算導(dǎo)線相對(duì)精度int f = (int)(水平距離和 / Math.Sqrt(閉合差X * 閉合差X + 閉合差Y * 閉合差Y);Console.WriteLine("導(dǎo)線的相對(duì)精度為1/0",f);/

46、計(jì)算每點(diǎn)坐標(biāo)double X = AX;double Y = AY;for (int j = 0; j < 坐標(biāo)增量X集合.Count; j+) X += 坐標(biāo)增量X集合j + X坐標(biāo)單位長(zhǎng)度改正數(shù) * Math.Abs(坐標(biāo)增量X集合j); Y += 坐標(biāo)增量Y集合j + Y坐標(biāo)單位長(zhǎng)度改正數(shù) * Math.Abs(坐標(biāo)增量Y集合j);Console.WriteLine("第0點(diǎn)的X坐標(biāo)=1,Y坐標(biāo)=2",j+2,X,Y); Console.WriteLine("最后一個(gè)點(diǎn)的坐標(biāo)應(yīng)該與B點(diǎn)的坐標(biāo)相同!"); class導(dǎo)線 /將ddd.mmss轉(zhuǎn)

47、為弧度staticpublicdouble DEG(double ang) int fuhao = (int)(ang / Math.Abs(ang); ang = Math.Abs(ang);int d = (int)ang;int m = (int)(ang * 100) - d * 100;double s = ang * 10000 - m * 100 - d * 10000;return (d + m / 60.0 + s / 3600.0) * fuhao) / 180.0 * Math.PI; /計(jì)算方位角,返回弧度值publicstaticdouble方位角(double x1

48、, double y1, double x2, double y2) double deltaX = x2 - x1;double deltaY = y2 - y1;double angle = Math.PI * 0.5;if (Math.Abs(deltaX) > 0.000000001) angle = Math.Atan2(deltaY, deltaX); if (angle < 0) angle += Math.PI; if (deltaY < 0.0) angle += Math.PI; return angle; /計(jì)算坐標(biāo),返回已知點(diǎn)到計(jì)算點(diǎn)的方位角publi

49、cstaticdouble坐標(biāo)(double x0, double y0, double左角, double水平距離,double已知方位角,outdouble x,outdouble y) double方位角 = 已知方位角 + 左角 + Math.PI; /將方位角調(diào)整到0到2之間if (方位角 >= Math.PI * 2) 方位角 -= Math.PI * 2;if (方位角 < 0.0) 方位角 += Math.PI * 2; x = x0 + 水平距離 * Math.Cos(方位角); y = y0 + 水平距離 * Math.Sin(方位角);return方位角; (

50、11)在如圖所示的僅有一個(gè)連接角的附合導(dǎo)線中,已知M點(diǎn)、A點(diǎn)和B點(diǎn)的坐標(biāo),A點(diǎn)和B點(diǎn)的高程,每個(gè)點(diǎn)的左角及每條邊的斜邊、垂直角、儀器高和反光鏡高,求每個(gè)點(diǎn)的坐標(biāo)和高程。(提示:,D-斜邊,-垂直角,-儀器高,-反光鏡高,-大氣折光系數(shù))using System;using System.Collections.Generic;using System.Text;namespace導(dǎo)線classProgram staticvoid Main(string args) Console.Write("請(qǐng)輸入M點(diǎn)的X坐標(biāo)=");double MX = double.Parse(Console.ReadLine();Console.Write("請(qǐng)輸入M點(diǎn)的Y坐標(biāo)=");double MY = double.Parse(Console.ReadLine();Console.Write("請(qǐng)輸入A點(diǎn)的X坐標(biāo)=");double AX = double.Parse(Console.ReadLine();Console.Wr

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論