大地坐标与平面坐标的相互转换
部分代码(弧度与角度的转化) using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace _416126030207史新祺第一次作业 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } double a = 0; double e2 = 0; double DD2RAD(double B) { double DD; double MM; double SS; DD = Math.Floor(B); MM = Math.Floor((B - DD) * 100); SS = ((B - DD) * 100 - MM) * 100; B = (DD + MM / 60.0 + SS / 3600.0) * Math.PI / 180.0; return B; } double D2RAD(double L) { double D; double M; double S; D = Math.Floor(L); M = Math.Floor((L - D) * 100); S = ((L - D) * 100 - M)*100; L = (D +M / 60.0 + S / 3600.0 ) * Math.PI / 180.0; return L; } double RAD2DD(double n) { double DD, FF, MM; double rad = n * 180.0 / Math.PI; DD = Math.Floor(rad); FF = Math.Floor((rad - DD) * 60); MM = ((rad - DD) * 60 - FF) * 60; n = DD + FF / 100 + MM / 10000; return n; } { InitializeComponent(); } double a = 0; double e2 = 0; double DD2RAD(double B) { double DD; double MM; double SS; DD = Math.Floor(B); MM = Math.Floor((B - DD) * 100); SS = ((B - DD) * 100 - MM) * 100; B = (DD + MM / 60.0 + SS / 3600.0) * Math.PI / 180.0; return B; } double D2RAD(double L) { double D; double M; double S; D = Math.Floor(L); M = Math.Floor((L - D) * 100); S = ((L - D) * 100 - M)*100; L = (D +M / 60.0 + S / 3600.0 ) * Math.PI / 180.0; return L; } double RAD2DD(double n) { double DD, FF, MM; double rad = n * 180.0 / Math.PI; DD = Math.Floor(rad); FF = Math.Floor((rad - DD) * 60); MM = ((rad - DD) * 60 - FF) * 60; n = DD + FF / 100 + MM / 10000; return n; }
暂无评论