没有合适的资源?快使用搜索试试~ 我知道了~
测绘类C#程序代码.docx
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 104 浏览量
2023-04-10
19:17:26
上传
评论
收藏 481KB DOCX 举报
温馨提示
试读
32页
。
资源推荐
资源详情
资源评论
常用测量程序设计代码
1 用全站仪在 A 点观测了 B 点斜边和垂直角;求 A 到 B 的高差..
D
2
Dsin a (1 k)
cos a i v
a
v
提示: h
;D--斜边; --垂直角 ; --仪器高 ; --反光镜
2
i
2R
AB
高; --大气折光系数
k
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
class Application
{
static void Mainstring args
{
Console.Write"请输入斜边=";
double D = double.ParseConsole.ReadLine;
Console.Write"请输入垂直角ddd.mmss=";
double a = DEGdouble.ParseConsole.ReadLine;
Console.Write"请输入仪器高=";
double i = double.ParseConsole.ReadLine;
Console.Write"请输入反光镜高=";
double v = double.ParseConsole.ReadLine;
double h = D * Math.Sina + 1 - 0.13 * D / 6371000.0 * D / 6371000.0 * Math.Cosa *
Math.Cosa / 2.0 + i - v;
Console.WriteLine"高差为{0}";h;
}
//将ddd.mmss转为弧度
static public double DEGdouble ang
{
int fuhao = intang / Math.Absang;
ang = Math.Absang;
int d = intang;
int m = intang * 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 Mainstring args
{
Console.Write"请输入A点的X坐标=";
double XA = double.ParseConsole.ReadLine;
Console.Write"请输入A点的Y坐标=";
double YA = double.ParseConsole.ReadLine;
Console.Write"请输入A到B的方位角ddd.mmss=";
double a = DEGdouble.ParseConsole.ReadLine;
Console.Write"请输入A到B的水平距离=";
double S = double.ParseConsole.ReadLine;
double XB = XA + S*Math.Cosa;
double YB = YA + S*Math.Sina;
Console.WriteLine"B点的坐标{0};{1}";XB;YB;
}
//将ddd.mmss转为弧度
static public double DEGdouble ang
{
int fuhao = intang / Math.Absang;
ang = Math.Absang;
int d = intang;
int m = intang * 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 Mainstring args
{
Console.Write"请输入A点的X坐标=";
double XA = double.ParseConsole.ReadLine;
Console.Write"请输入A点的Y坐标=";
double YA = double.ParseConsole.ReadLine;
Console.Write"请输入B点的X坐标=";
double XB = double.ParseConsole.ReadLine;
Console.Write"请输入B点的Y坐标=";
double YB = double.ParseConsole.ReadLine;
double S = 距离XA; YA; XB; YB;
double a = 方位角XA; YA; XB; YB;
Console.WriteLine"AB间的距离={0};从A到B的方位角={1}";S;DMSa;
}
//将弧度转为ddd.mmss
static public double DMSdouble ang
{
ang += 1.0E-15;//加上一个小量;以保证进位
int fuhao = intang / Math.Absang;
ang = Math.Absang * 180.0 / Math.PI;
int d = intang;
ang = ang - d * 60.0;
int m = intang;
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.AbsdeltaX > 0.000000001
{
angle = Math.Atan2deltaY; deltaX;
}
if angle < 0
{
angle += Math.PI;
}
if deltaY < 0.0
{
angle += Math.PI;
}
return angle;
}
//计算距离
public static double 距离double x1; double y1; double x2; double y2
{
return Math.Sqrtx2 - x1 * x2 - x1 + y2 - y1 * y2 - y1;
}
}
}
4 在如图所示的支中导线;已知 A 点到M 点的坐标方位角a 及每个左角;求每条边的坐标方位
0
角..
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
class Application
{
static void Mainstring args
{
Console.Write"请输入A点到M点的坐标方位角=";
//将A点到M点的坐标方位角换算为M点到A点的坐标方位角;以便利用公式
double a0 = DEGdouble.ParseConsole.ReadLine +180.0;
if a0 > 2 * Math.PI
{
a0 -= 2 * Math.PI;
}
List<double> 导线转角集合 = new List<double>;
int i = 1;
do
{
Console.Write"请输入第{0}个转角的水平角左角为正;右角为负 <直接回车结束输
入>=";i++;
string str = Console.ReadLine;
if str = ""
{
导线转角集合.AddDEGdouble.Parsestr;
}
else
{
break;
}
} while true;
i = 1;
foreach double a in 导线转角集合
{
a0 += a + Math.PI;
if a0 > 2 * Math.PI
{
a0 -= 2 * Math.PI;
}
else if a0 < 0.0
{
a0 += 2 * Math.PI;
}
Console.WriteLine"第{0}条边的方位角为{1}";i++;DMSa0;
}
}
//将弧度转为ddd.mmss
static public double DMSdouble ang
{
ang += 1.0E-15;//加上一个小量;以保证进位
int fuhao = intang / Math.Absang;
ang = Math.Absang * 180.0 / Math.PI;
int d = intang;
ang = ang - d * 60.0;
int m = intang;
double s = ang - m * 60.0;
return d + m / 100.0 + s / 10000.0 * fuhao;
}
//将ddd.mmss转为弧度
static public double DEGdouble ang
{
int fuhao = intang / Math.Absang;
ang = Math.Absang;
int d = intang;
int m = intang * 100 - d * 100;
double s = ang * 10000 - m * 100 - d * 10000;
剩余31页未读,继续阅读
资源评论
若♡
- 粉丝: 6176
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功