资源预览内容
第1页 / 共32页
第2页 / 共32页
第3页 / 共32页
第4页 / 共32页
第5页 / 共32页
第6页 / 共32页
第7页 / 共32页
第8页 / 共32页
第9页 / 共32页
第10页 / 共32页
亲,该文档总共32页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
常用测量程序设计(1)用全站仪在A点观测了B点斜边和垂直角,求A到B的高差。(提示:,D-斜边,-垂直角,-仪器高,-反光镜高,-大气折光系数)using System;using System.Collections.Generic;using System.Text;namespace ConsoleApplication1 class Application static void Main(string args) Console.Write(请输入斜边=); double D = double.Parse(Console.ReadLine(); Console.Write(请输入垂直角ddd.mmss=); double a = DEG(double.Parse(Console.ReadLine(); Console.Write(请输入仪器高=); double i = double.Parse(Console.ReadLine(); Console.Write(请输入反光镜高=); double v = double.Parse(Console.ReadLine(); double h = D * Math.Sin(a) + (1 - 0.13) * D / 6371000.0 * D / 6371000.0 * Math.Cos(a) * Math.Cos(a) / 2.0 + i - v; Console.WriteLine(高差为0,h); /将ddd.mmss转为弧度 static public double 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; (2)如图所示,已知A点的坐标及A点到B点的边长及方位角,计算B点的坐标。using System;using System.Collections.Generic;using System.Text;namespace ConsoleApplication1 class Application static void Main(string args) Console.Write(请输入A点的X坐标=); double XA = double.Parse(Console.ReadLine(); Console.Write(请输入A点的Y坐标=); double YA = double.Parse(Console.ReadLine(); Console.Write(请输入A到B的方位角ddd.mmss=); double a = DEG(double.Parse(Console.ReadLine(); Console.Write(请输入A到B的水平距离=); double S = double.Parse(Console.ReadLine(); double XB = XA + S*Math.Cos(a); double YB = YA + S*Math.Sin(a); Console.WriteLine(B点的坐标(0,1),XB,YB); /将ddd.mmss转为弧度 static public double 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; (3)如图所示,已知A点和B点的坐标,计算A点到的边长及方位角。using System;using System.Collections.Generic;using System.Text;namespace ConsoleApplication1 class Application static void Main(string args) Console.Write(请输入A点的X坐标=); double XA = double.Parse(Console.ReadLine(); Console.Write(请输入A点的Y坐标=); double YA = double.Parse(Console.ReadLine(); Console.Write(请输入B点的X坐标=); double XB = double.Parse(Console.ReadLine(); Console.Write(请输入B点的Y坐标=); double YB = double.Parse(Console.ReadLine(); double S = 距离(XA, YA, XB, YB); double a = 方位角(XA, YA, XB, YB); Console.WriteLine(AB间的距离=0,从A到B的方位角=1,S,DMS(a); /将弧度转为ddd.mmss static public double DMS(double ang) ang += 1.0E-15;/加上一个小量,以保证进位 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 = (ang - m) * 60.0; return (d + m / 100.0 + s / 10000.0) * fuhao; /计算方位角,返回弧度值 public static double 方位角(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.PI; if (deltaY 2 * Math.PI) a0 -= 2 * Math.PI;
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号