测绘类C#程序代码.docx

上传人:大张伟 文档编号:6124525 上传时间:2020-09-11 格式:DOCX 页数:40 大小:239.80KB
返回 下载 相关 举报
测绘类C#程序代码.docx_第1页
第1页 / 共40页
测绘类C#程序代码.docx_第2页
第2页 / 共40页
测绘类C#程序代码.docx_第3页
第3页 / 共40页
测绘类C#程序代码.docx_第4页
第4页 / 共40页
测绘类C#程序代码.docx_第5页
第5页 / 共40页
点击查看更多>>
资源描述

《测绘类C#程序代码.docx》由会员分享,可在线阅读,更多相关《测绘类C#程序代码.docx(40页珍藏版)》请在三一文库上搜索。

1、常用测量程序设计代码(1)用全站仪在点观测了 B 点斜边与垂直角,求到(提示 :,D-斜边, -垂直角, -仪器高,反光镜高B 得高差。,大气折光系数)usig Syste;usingSystem、 Co le ti ns、 Generi ;usSyste、 Tet ;namepaceosol pplicat on1c ass Applicatontat c voain( str ng rg )Console 、 Wri e( ”请输入斜边 =”);double D= double 、 Pa se( Co s e、 RaLine ( ) ;Console 、 rite( ”请输入垂直角d、 m

2、 s );doub e a G( doub e、 r e( C ns e、 Re dLine( ) ) );C ns l 、 Wri e( ”请输入仪器高 =”);d uble =doub、 Par( Co s le 、 Re d ne( ) ; onso e、 Writ ( ”请输入反光镜高 = );do be v =double 、 Pa se( nsole 、 ea L e() ;dou l h = *Mat、Si (a ) + (1 -、 13) / 6 71000、 0 / 6371 00、 0 * Mat、C s( a) Math、 o( a) /、 0 v ;Cono、 Wr t

3、 in ( ”高差为 0 ,h) ;/ 将 dd、 mmss转为弧度 taticpuli double DEG(do an ) tfuha = ( int ) ( a g Ma h、 bs( ang) ;an =Math、 Abs( ng);int =( int ) a;int ( int )(an * 100) ) 1 0; ou e = a g * 10000 - m 100d 000;retur ( (d m / 60 、 0 s 3600 、 0)*fuhao ) / 180、0* Math、 PI;(2)如图所示 ,已知 A 点得坐标及A 点到点得边长及方位角,计算点得坐标. sin

4、g y tem;u ingSyst 、 Colle t o s、 neric;usingystem 、 Text;na e pacCnsoleApplication1classApp ic ion tati v idM in ( s inga s)C nsol 、 Write ( 请输入 A点得 X坐标 ) ;do l XA =doub e、Pase( Console 、ReaLine () ;C ole 、 W ite( 请输入 A点得坐标 =);doubl A = doubl 、Parse ( Console 、 ea Ln();Conole 、Write ( 请输入 A到 B得方位角 d

5、d、 mm s= ); o ble a = DEG ( double 、 P e( ons e、R Line () ; C nole 、 i e( ”请输入到 B得水平距离 );duble S =d bl 、Pas ( Con ole 、 ReadLine( ));doub e B= XA + S* ath 、C( );d uble YB = Y + ah、 Sin ( ) ;ons 、 riteLine( 点得坐标 ( , 1) ,XB,YB) ;/ 将 dd、 s转为弧度staticpubl c u le DEG( do le ang)in fuhao =( int )(an /ath 、

6、 Abs( ng) );ng = Math、 Abs(an);i t = ( int )ang;nt m ( ( int )( ng *0) ) - d * 100;dou l sang 00m 100d *1 000;ret rn ( + m/ 6 、 0 + s / 36、 0) fu a) 80、0* M t 、PI;(3)如图所示 ,已知点与B 点得坐标,计算A 点到得边长及方位角。usingSy tem;usin Sysem、Colle tio s、 Generi ;usingSyste 、 Text ;n mespae on l App icat n1clssA p ic tios

7、t ticvoiMain( stringarg) nsole 、 rite( 请输入 A点得 X坐标 =”);dou le XA =double 、 Pa s ( C nse、 Rea ine () ); onsoe、 rit( ”请输入 A点得坐标= );do le YA = u le 、 Pars ( Cn l 、 ReadLine(); onsoe、Wr te ( ”请输入 B点得 X坐标 = );double X = double 、P se( C n le 、ReaLi ();Consl 、Write ( 请输入点得 Y坐标 = ) ;double Y = double 、 Pars

8、e( Co sole 、 R Li e() );dou leS= 距离( X, YA, B, Y );doubl a =方位角 ( A,YA, XB,YB) ;C nsole 、Write in ( ”AB间得距离 ,从到 B得方位角 = ,S,DM (a) ;/ 将弧度转为 ddd、 mss ticpubl c o le DM( o le a g)an += 1 、 E15;/ 加上一个小量, 以保证进位intfuha = ( in ) (an / Math、A s( ang) ) ;ang= Math、 A (a g) * 18、 0 /Mat、P;intd (int )a g;n =(a

9、n - d) 0、 0; nt m ( i t )ang; uble s =( an m) 6、 0;return (d+ m / 00、0 + / 000、 0)fuhao ;/ 计算方位角 , 返回弧度值p licsaiduble方位角 ( ouble x , doubley1, ouble ,double y2)double d ltaX =x - x;do ledelta = y2 1;doube angle =ath 、 PI 0 、 5; f ( Math、 Abs(del aX) 0、 00 000 01) g e= ath 、 tan ( d lt Y, de a) ; f(

10、n le )ang e += at 、 P;if( deltaY、 0)agle th 、 I;et rn ngle ;/ 计算距离publics t cdu le距离( double x1 , doubl y , do le x2 , dou le2)retu n Math、qrt( ( x2 x1) (x 1) + (y2 -1) *( y2 y1 )) ;()在如图所示得支中导线 ,已知 A 点到 M 点得坐标方位角及每个左角, 求每条边得坐标方位角。using yste ;using Syste 、 Col ectio s、G ner ;usin System 、 Txt;n mesp

11、aceConol A p icat 1cl s A p i ationstatic oid Main ( t in args )Conso、 W i ( ”请输入 A点到点得坐标方位角=”) ;将 A点到 M点得坐标方位角换算为M点到 A点得坐标方位角,以便利用公式 ou e a0 = DEG( double 、 P e( Conso、 ReadLine () ) 0、0) ;if( 02 Ma h、 I)0 = 2*Ma、 P ;Lis du le 导线转角集合=new Lis ouble ();in i1;doCnso e、Wr t ( 请输入第 个转角得水平角 左角为正, 右角为负直接回

12、车结束输入=,i );stringst = C nsole 、 R dLine () ;if(str!)导线转角集合、dd( EG( duble 、 Parse( tr);else r a; whle ( ru ) ;i = ;or ch( oubleain导线转角集合)a0 += aMath、 I;if(a0 * ath 、 PI )a0 2 Ma、PI;elseif(a0 0、0)a0 += 2 *Math、 P;C nole 、 iteLine(第 0 条边得方位角为1 , i+ , DMS(a );/ 将弧度转为 dd、 mmss t t c publicdou l MS( doubl

13、e a g)ag= 1 、15;加上一个小量, 以保证进位in fuhag = o =( int ) (ang /Math、 Abs( ng)Mth 、Ab( ag);80、0/Mah、 I; t= (in )a g;a g=( ng d ) *60、;in m =( int ) ang;doubl s =( a g - m)*60、0; rn(d + m / 10、0 / 0000、0) * f ao;/ 将ddd、 m s转为弧度sta icpub c uble D( double n)ntf ao=(nt )( n /Math、Abs(ang );n= Math、( an);intd =

14、( int ) ang;intm =( in ) ( ng 100) -100;double s = ang * 1000 - m100 d 00 0;retu n ( ( d +m/0、 0 + s /36 0、 0) *fuhao )/180、0Math、PI;()在如图所示得支中导线,已知A 点与M 点得坐标及每个左角与每条边长,求每个点得坐标 .using S ste ;usingS te 、 ol ections、 Generic ;usSystem、T t;amspace Co s leAp icatin1c ass pp i aionstaticod Ma n( tr ng rg

15、s )Cons e、 ri e( ”请输入 M点得 x坐标 ”) ; ublex =do bl 、 Pr e( C ns l 、 Re Line( ) ) ;Cons l 、 Writ ( 请输入 M点得 y 坐标 =”);dob M = ouble 、 se( o s e、 ea ine()Console 、 ri ( ”请输入点得 x坐标 =”);do ble Ax = ubl 、 Pa se( Console 、 ReadLine () );C nsole 、W ite(”请输入 A点得 y坐标 =););doubl A do le 、 arse ( Conso、 ReadLi e();

16、 List d uble 导线转角集合 = ew ist double (); List ();i =;doCnsole 、 W te ( ”请输入第 个转角得水平角 左角为正,右角为负= ,i);stringif(stst =Conso e、 Re d ne(); ! = )导线转角集合、d( DEG( doule 、 arse (tr) ) );e ebeak; oso、W ite ( 请输入第 0条边长值 ,导线边长集合、Add( d bl 、 Parse( on le+) ;、 e dLine() ) );w i e( true ) ;/ 计算到 A得坐标方位角doub0 =方位角(

17、Mx, My, Ax, Ay);/ 计算每个点得坐标doublex0= Ax;d ub e y0 = y; r( int =0;j 导线转角集合、C nt; j +)a0 +=导线转角集合f( 0 2*j + a h、 I ;M t 、 I ) 0-=2 *Math、PI ;x0=x+ 导线边长集合 j Math、 Co (a0 ) ; = y0导线边长集合j Mth 、Sin ( 0) ;o le 、 Wri eLne( P0 点得坐标就是 :1 , ,j+2 , x0,y0); / 将 ddd、mmss转为弧度stati pub cdouble D G( uble a g)i t fuha

18、 = (nt )(an / ath 、 bs( ng);ag =Math、 Abs( a g);intd =( ) an;intm (( in ) (ang 10) d *1 0;doub = ng 10000m 0 10000 ;ret ( (d + m / 60、 + / 3600、 0) uha ) /80、 0 Math、PI ; / 计算方位角 , 返回弧度值pblic atic ou l 方位角 ( double x,dou e1, double x2, dou l 2) o leeltaX = x - x1 ; ulee Y = y2- ;dule angl = ath 、 PI

19、 0 、 ;i ( a、 bs( eltaX)0、00000001)ang e=Mat、Atan2 ( de taY ,d lta);if(angle0) le+ at 、P;(dlt Y Lst doubl 路线段长度集合路线段高差集合 new List new List d ub e();oul ( );inti = 1;Consol 、 Write ( 请输入第 0段长度 公里为单位 = ,i);st ings r= C s le 、 R ine( );( str! = )路线段长度集合、A d( doble 、P e( st ); lse reak ;Console 、 W i e(

20、请输入第 0 段高差 ,i+ );路线段高差集合、( double 、Parse ( Console 、ReaLne() );whi e ( t u );/ 计算水准路线闭合差ouble w =;doube 总长度 = 0 ;for(in j = 0; j 路线段长度集合、Cou;j +)w +=路线段高差集合j ;总长度+=路线段长度集合;= w-( b - Ha); / 闭合差doubl v =w /总长度 ;/ 每公里改正数/ 计算每个点得高程 oube H Ha; or( nt j = 0;路线段长度集合、unt;+)H路线段高差集合Consoe、 Wr teLin ( P0v 路线段

21、长度集合点得高程就是: ; ”, j+ , H);Console 、 W te ine(”最后一点就就是点! );(7)在如图所示得前方交会中角度 ,求 J 点得坐标 .,AB三点按逆时针方向排列,已知AB 两点得坐标与两个交会sing S ste ;u ing Syste 、 olections、 e e ic;us ng Sys e、 Tex;n espaceonso Application aAppliatiost ti voi Man( stringargs )Cons le 、 W t (请输入 A点得坐标); ub e Ax = double 、 a e( Consoe、 ReaL

22、i e();Con l 、Writ ( 请输入 A点得 y坐标 ”);doubl Ay = do b e、P rse (Cons l 、 ReadLine ( ) ); Console 、Writ ( 请输入 B点得坐标 ); l Bx doubl 、 arse( Cosol 、 R dLin (); Consol 、Write ( 请输入 B点得 y坐标 =”);doubl y =d ble 、 Pa se( Co sole 、ReadLine () ;Cnsole 、W i ( ”请输入 得角度值 =”) ;d b e DE( ouble 、 ar e(Cons le 、 eadL ne(

23、) )) ; on l 、Wite( 请输入 得角度值 = ) ;double=DEG(do e、Parse( Conole 、 eadLin ( ) ) ;/ 计算 A到B得坐标方位角dou le0= 方位角( A, Ay , x , y);/ 计算 A到得坐标方位角 0 ;/ 计算到 B得边长dou les =距离 (Ax , A, Bx , By );/ 计算 A到J得边长s s /ath 、 Sn( Mat、 I ) ath 、 Si ( );/ 计算 J得坐标du l do bleJx = A + s Ay + s *Math、 s ( a);Mah、 S n( 0);C nsol

24、、 Wri eLine( J点得坐标 = ,1 ”,Jx,Jy);/ 将 dd、mms转为弧度satic publ o ble ( dou le ang)in fuh =( in ) (ang/ Math、 Ab (ang ); g =ath 、 Abs( an );intd =(int)ang;intm= (( int) ( ang * 0 ) d 100;double = ang 10 00 m* 00 d 10000;r tu (d + / 60 、0 + s/ 3600 、 0) fuhao) / 180、 0 h、PI;/ 计算方位角,返回弧度值public taticdou e方位角( do l x1, doble y1, ouble x , dobley2)doubl del aX = x2 - 1; ube deltaY = y y1 ;doul ngle= Math、 P i (Mah、 b( de t )0 、 5; 、 00000 0)anle =Mat、 ta ( delt Y,del X);if( gle 多边形 Y坐标集 =newi t = ;Lis ( );Lst b e() ; oonole 、Wr e(”请输入第 0点得坐标string

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 科普知识


经营许可证编号:宁ICP备18001539号-1