通用测绘C#程序设计源代码
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
*-
常用测量程序设计
(1)用全站仪在A点观测了B点斜边和垂直角,求A到B的高差。
2D2a?i?v?(1?k)h cos?D sin aavi--反--(提示:D--斜边,仪器高,--垂直角,,AB2R光镜高,--大气折光系数)k 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(请输入垂直角摛摤洮獭嵳尽);
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(高差为ほ屽,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;
}
}
}
*-
B点的坐标。点到B点的边长及方位角,计算(2)如图所示,已知A点的坐标及A
System;
using System.Collections.Generic; using System.Text;
using ConsoleApplication1 namespace{
Application class
{
[] args) void Main(string static
{
);
坐标尽X.Write(请输入A点的Console.ReadLine()); .Parse(Console double XA = double); 坐标尽请输入A点的Y Console.Write(.ReadLine()); .Parse(Console double YA = double); 摛摤洮獭嵳尽A到B的方位角Console.Write(请输入.ReadLine())); Console double a =
DEG(double.Parse(
); 尽到B的水平距离Console .Write(请输入A.ReadLine()); Console S =
double.Parse( double.Cos(a); double XB = XA + S*Math
.Sin(a);
double YB = YA + S*Math
,XB,YB); )Console.WriteLine(B点的坐标( }
转为弧度将ddd.mmss// ang) DEG(double static publicdouble
{
.Abs(ang)); )(ang / Math int fuhao = (int.Abs(ang); ang = Math)ang;
int int d = ()(ang * 100)) - d * 100;
int int m = (( s = ang * 10000 - m * 100 - d * 10000;
double
.PI; Math return ((d + m / 60.0 + s / 3600.0) * fuhao) / 180.0 *
}
}
}
点到的边长及方位角。点的坐标,计算AB3()如图所示,已知A点和 System; using System.Collections.Generic; using
System.Text;
using ConsoleApplication1 namespace{
Application class
{
*-
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的方位角笽紱,S,DMS(a));