如果您无法下载资料,请参考说明:
1、部分资料下载需要金币,请确保您的账户上有足够的金币
2、已购买过的文档,再次下载不重复扣费
3、资料包下载后请先用软件解压,在使用对应软件打开
高斯投影正反算程序设计一.程序设计流程本程序的设计思路如下:(1),程序采用VS08版本作为开发平台,并采用C#语言作为开发语言,设计为WindowsForm窗体程序形式。(2),程序主要的算法来自于教材。但是本程序为了更加实用,添加了更多的解算基准,包括:WGS-84,国际椭球1975,克氏椭球,和2000国家大地坐标系。(3),程序为了更方便的读取数据和输出数据,故需要自己定义了固定的数据输入格式和数据输出格式或形式,请老师注意查看。二.代码usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Text;usingSystem.Windows.Forms;namespaceGauss{publicpartialclassForm1:Form{//大地坐标//GeodeticCoordinatepublicstructCRDGEODETIC{publicdoubledLongitude;publicdoubledLatitude;publicdoubledHeight;}//笛卡尔坐标//CartesianCoordinatepublicstructCRDCARTESIAN{publicdoublex;publicdoubley;publicdoublez;}publicForm1(){InitializeComponent();}privatevoidbutton1_Click(objectsender,EventArgse){doubleee=0;doublea=0;stringtt;try{tt=this.comboBox1.Items[this.comboBox1.SelectedIndex].ToString();}catch{MessageBox.Show("GaussInverse:Choosedatumerror!");return;}if(tt.CompareTo("克氏椭球")==0){a=6378245.00;ee=Math.Sqrt(0.006693421622);}if(tt.CompareTo("WGS-84")==0){a=6378137.00;ee=Math.Sqrt(0.00669437999013);}if(tt.CompareTo("1975国际椭球")==0){a=6378140.00;ee=Math.Sqrt(0.006694384999588);}if(tt.CompareTo("2000国家大地坐标系")==0){a=6378137.0;ee=Math.Sqrt(0.0066943802290);}constdoublepai=3.1415926;doubleb=Math.Sqrt(a*a*(1-ee*ee));doublec=a*a/b;doubleepp=Math.Sqrt((a*a-b*b)/b/b);CRDGEODETICpcrdGeo;CRDCARTESIANpcrdCar;doublemidlong;//求纬度string[]temp;temp=textBox1.Text.Split('');double[]tempradius=newdouble[3];for(inti=0;i<3;i++){tempradius[i]=Convert.ToDouble(temp[i]);}pcrdGeo.dLatitude=tempradius[0]/180.0*pai+tempradius[1]/180.0/60.0*pai+tempradius[2]/180/60.0/60*pai;//求经度temp=textBox2.Text.Split('');for(inti=0;i<3;i++){tempradius[i]=Convert.ToDouble(temp[i]);}pcrdGeo.dLongitude=tempradius[0]/180.0*p