-
大小: 117KB文件類型: .zip金幣: 1下載: 0 次發(fā)布日期: 2021-06-02
- 語言: C#
- 標簽: C#??坐標轉(zhuǎn)換??高斯坐標??大地坐標??
資源簡介
本程序是基于C#語言開發(fā)的Windows桌面程序,功能為實現(xiàn)高斯平面坐標與大地坐標之間的轉(zhuǎn)換,即高斯正反算。并附錄相關(guān)的計算實例及數(shù)據(jù)。
代碼片段和文件信息
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;
using?System.IO;
namespace?高斯正反算
{
????public?partial?class?Form1?:?Form
????{
????????public?Form1()
????????{
????????????InitializeComponent();
????????}
????????//定義全局變量
????????public?static?double?a;?????????//橢球的長半軸
????????public?static?double?b;?????????//橢球的短半軸
????????public?static?double?e1;????????//橢球的第一偏心率
????????public?static?double?e2;????????//橢球的第二偏心率
????????public?static?double?f;?????????//橢球的扁率
????????public?static?double?L0;
????????public?static?double?M;?????????//帶號
????????public?static?double?L_;
????????//將TXT文檔轉(zhuǎn)換成數(shù)組
????????public?static?double[]?TxtToArray(string?path)
????????{
????????????StreamReader?sr?=?new?StreamReader(@path?);
????????????//獲取數(shù)組的行和列
????????????int?row?=?0?col?=?0;
????????????string?line;
????????????while?(!string.IsNullOrEmpty(line?=?sr.ReadLine()))
????????????{
????????????????++row;
????????????????string[]?s?=?line.Split(‘‘);
????????????????col?=?s.Length;
????????????}
????????????double?[]data=new?double?[row?col?];
????????????using?(StreamReader?SR?=?new?StreamReader(@path))
????????????{
????????????????for?(int?i?=?0;?i?????????????????{
????????????????????string?ss?=?SR.ReadLine();
????????????????????string[]?sdata?=?ss.Split(‘‘);
????????????????????for?(int?j?=?0;?j?????????????????????{
????????????????????????data[i?j]?=?double?.Parse?(?sdata[j]);
????????????????????}
????????????????}
??????????
????????????}
????????????return?data;????
????????}
????????//弧度轉(zhuǎn)換為度分秒的的方法
????????public?static?double[]?RadToDMS(double?rad)
????????{
????????????double?deg?=?rad?/?Math.PI?*?180;
????????????int?d?=?(int)deg;
????????????double?ms?=?deg?-?d;
????????????int?m?=?(int)(ms?*?60);
????????????double?s?=?Math.Round((ms?*?60?-?m)?*?60?3);
????????????if?(deg?0)
????????????{
????????????????ms?=?ms?*?(-1);
????????????????m?=?m?*?(-1);
????????????}
????????????if?(s?==?60)
????????????{
????????????????m?+=?1;
????????????????s?=?0;
????????????}
????????????
????????????double[]?result?=?new?double[3];
????????????result[0]?=?d;
????????????result[1]?=?m;
????????????result[2]?=?s;
????????????return?result;
????????}
????????//度轉(zhuǎn)換成弧度
????????public?static?double?DegToRad(double?d)
????????{
????????????double?rad?=?d?/?180?*?Math.PI;
????????????return?rad;
????????}
????????//弧度轉(zhuǎn)換成度方法
????????public?static?double?RadToDeg(double?rad)
????????{
????????????double?deg?=?rad?/?Math.PI?*?180;
????????????return?deg;
????????}
????????//計算子午線弧長的方法(其中B為緯度,A為橢球長半軸,E為橢球第一偏心率)
????????public?static?double?HuChang(double?B?double?A?double?E)
????????{
????????????double?m0?m2?m4?m6?m8?a0?a2?a4?a6?a8;
????????????m0?
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????1014??2018-03-31?09:07??高斯正反算\高斯正反算.sln
?????文件???????41472??2018-06-11?08:59??高斯正反算\高斯正反算.v12.suo
?????目錄???????????0??2018-05-20?20:36??高斯正反算\高斯正反算\
?????文件?????????187??2018-03-31?09:07??高斯正反算\高斯正反算\App.config
?????目錄???????????0??2018-03-31?15:50??高斯正反算\高斯正反算\bin\
?????目錄???????????0??2018-03-31?15:50??高斯正反算\高斯正反算\bin\Debug\
?????文件???????41472??2018-05-20?20:36??高斯正反算\高斯正反算\bin\Debug\高斯正反算.exe
?????文件?????????187??2018-03-31?09:07??高斯正反算\高斯正反算\bin\Debug\高斯正反算.exe.config
?????文件???????79360??2018-05-20?20:36??高斯正反算\高斯正反算\bin\Debug\高斯正反算.pdb
?????文件???????24224??2018-07-01?11:48??高斯正反算\高斯正反算\bin\Debug\高斯正反算.vshost.exe
?????文件?????????187??2018-03-31?09:07??高斯正反算\高斯正反算\bin\Debug\高斯正反算.vshost.exe.config
?????文件?????????490??2018-04-12?07:35??高斯正反算\高斯正反算\bin\Debug\高斯正反算.vshost.exe.manifest
?????文件???????26564??2018-05-20?20:36??高斯正反算\高斯正反算\Form1.cs
?????文件???????47431??2018-05-17?18:24??高斯正反算\高斯正反算\Form1.Designer.cs
?????文件????????6596??2018-05-17?18:24??高斯正反算\高斯正反算\Form1.resx
?????文件????????1284??2018-05-20?16:41??高斯正反算\高斯正反算\Form2.cs
?????文件????????8812??2018-05-20?16:39??高斯正反算\高斯正反算\Form2.Designer.cs
?????文件????????5817??2018-05-20?16:39??高斯正反算\高斯正反算\Form2.resx
?????文件????????1149??2018-05-10?23:07??高斯正反算\高斯正反算\Form3.cs
?????文件????????8531??2018-05-10?22:58??高斯正反算\高斯正反算\Form3.Designer.cs
?????文件????????5817??2018-05-10?22:58??高斯正反算\高斯正反算\Form3.resx
?????目錄???????????0??2018-03-31?15:50??高斯正反算\高斯正反算\obj\
?????目錄???????????0??2018-05-20?20:36??高斯正反算\高斯正反算\obj\Debug\
?????文件????????1453??2018-03-31?15:40??高斯正反算\高斯正反算\obj\Debug\DesignTimeResolveAssemblyReferences.cache
?????文件????????6959??2018-04-23?18:04??高斯正反算\高斯正反算\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
?????文件???????????0??2018-03-31?09:07??高斯正反算\高斯正反算\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
?????文件???????????0??2018-03-31?09:07??高斯正反算\高斯正反算\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
?????文件???????????0??2018-03-31?09:07??高斯正反算\高斯正反算\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
?????目錄???????????0??2018-03-31?09:07??高斯正反算\高斯正反算\obj\Debug\TempPE\
?????文件????????2697??2018-07-01?11:48??高斯正反算\高斯正反算\obj\Debug\高斯正反算.csproj.FileListAbsolute.txt
?????文件????????1093??2018-05-20?16:39??高斯正反算\高斯正反算\obj\Debug\高斯正反算.csproj.GenerateResource.Cache
............此處省略18個文件信息
評論
共有 條評論