高斯投影坐標(biāo)正反算編程報(bào)告參考模板_第1頁(yè)
高斯投影坐標(biāo)正反算編程報(bào)告參考模板_第2頁(yè)
高斯投影坐標(biāo)正反算編程報(bào)告參考模板_第3頁(yè)
高斯投影坐標(biāo)正反算編程報(bào)告參考模板_第4頁(yè)
高斯投影坐標(biāo)正反算編程報(bào)告參考模板_第5頁(yè)
已閱讀5頁(yè),還剩7頁(yè)未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、高斯投影坐標(biāo)正反算編程報(bào)告1. 編程思想進(jìn)行高斯投影坐標(biāo)正反算的編程需要牽涉到大量的公式,為了使程序條理更清楚,各塊的數(shù)據(jù)復(fù)用性更強(qiáng),這里采取了結(jié)構(gòu)化的編程思想。程序由四大塊組成。GeodesyHomework.cpp文件用于存放main()函數(shù),是整個(gè)程序的入口。通過(guò)結(jié)構(gòu)化的編程盡力使main()函數(shù)變得簡(jiǎn)單。MyFunction.h和MyFunction.cpp用于存放計(jì)算過(guò)程中進(jìn)行角度弧度換算時(shí)所要用到的一些自定的轉(zhuǎn)換函數(shù)。Zhengsuan.h和Zhengsuan.cpp用于存放Zhengsuan類,在Zhengsuan類中聲明了高斯投影坐標(biāo)正算所要用到的所有變量,在類的構(gòu)造函數(shù)中進(jìn)行

2、成員變量的初始化及正算計(jì)算。通過(guò)get函數(shù)獲得相應(yīng)的正算結(jié)果。Fansuan.h和Fansuan.cpp用于存放Fansuan類,類似于Zhengsuan類,F(xiàn)ansuan類中聲明了高斯投影坐標(biāo)反算所要用到的所有變量,在類的構(gòu)造函數(shù)中進(jìn)行成員變量的初始化及反算計(jì)算。通過(guò)get函數(shù)獲得相應(yīng)的反算結(jié)果。2. 計(jì)算模型 高斯投影正算公式 高斯投影反算公式 3. 程序框圖1 / 12開始輸入B,L求定帶號(hào)N,中央緯度L0,緯度差l按照實(shí)用公式計(jì)算x,y換算為國(guó)家統(tǒng)一坐標(biāo)X,Y輸出X,Y輸入國(guó)家統(tǒng)一坐標(biāo)X,Y由Y取定帶號(hào)N,并換算出x,y求出中央經(jīng)線L0按照實(shí)用公式計(jì)算B,lL=L0+l求出大地經(jīng)度L輸

3、出B,L結(jié)束正算反算4. 計(jì)算結(jié)果5. 附錄:程序代碼/主函數(shù)入口GeodesyHomework.cpp#include "MyFunction.h"#include "Zhengsuan.h"#include "Fansuan.h"#include <iostream>using namespace std;void fansuan();void zhengsuan();void main()zhengsuan();fansuan();printf("/n over!");void zhengsuan

4、()double myB,myL;cout<<"【正算】"<<endl;cout<<"請(qǐng)輸入大地緯度B"<<endl;myB=angleToDegree();cout<<"請(qǐng)輸入大地經(jīng)度L"<<endl;myL=angleToDegree();Zhengsuan myZhengsuan1(myB,myL);printf("Radian B=%f L=%f n",myZhengsuan1.getrB(),myZhengsuan1.getrL();

5、myZhengsuan1.printLocation();void fansuan()double myX,myY;cout<<"【反算】"<<endl;cout<<"請(qǐng)輸入國(guó)家統(tǒng)一坐標(biāo) X Y。例如 3378627.1819 20243953.4517"<<endl;cin>>myX>>myY;Fansuan myFansuan1(myX,myY);myFansuan1.printLocation();/自定功能函數(shù)庫(kù)MyFunction.h#define PI 3.1415926

6、#include <iostream>using namespace std;double angleToDegree(int du,int fen,float miao);double angleToDegree();/將度分秒換算為度double degreeToRadian(double degree);double degreeToRadian();/將角度換算為弧度MyFunction.cpp#include "MyFunction.h"double angleToDegree(int du,int fen,float miao)double resu

7、lt=0;result=miao/3600.0+fen/60.0+du;return result;double angleToDegree()int du,fen;float miao;double result;cout<<"請(qǐng)輸入度 分 秒。例如:30 20 00"<<endl;cin>>du>>fen>>miao;result=angleToDegree(du,fen,miao);return result;double degreeToRadian(double degree)double result=

8、0;result=degree/57.295779513082321;return result;double degreeToRadian()double result,degree;degree=angleToDegree();result=degreeToRadian(degree);return result;/正算類Zhengsuan.h/ Zhengsuan.h: interface for the Zhengsuan class./#if !defined(AFX_ZHENGSUAN_H_2655EA28_E810_44A3_8F14_56421A7B4466_INCLUDED_

9、)#define AFX_ZHENGSUAN_H_2655EA28_E810_44A3_8F14_56421A7B4466_INCLUDED_#if _MSC_VER > 1000#pragma once#endif / _MSC_VER > 1000#define rouSecond 206264.806247096355#include "MyFunction.h"#include <iostream>#include <math.h>using namespace std;class Zhengsuan public:Zhengsu

10、an();Zhengsuan(double fB,double fL);double getX();double getY();double getrB();double getrL();void printLocation();virtual Zhengsuan();private:double x;double y;/大地坐標(biāo)double X;double Y;/國(guó)家統(tǒng)一坐標(biāo)double B;double rB;int Bsecond;double L;double rL;/輸入的大地緯度B,大地經(jīng)度L,rB,rL為對(duì)應(yīng)弧度表示值,Bsecond為換算成秒數(shù)值int n;/帶號(hào)ndoubl

11、e L0;/中央經(jīng)線緯度L0double LDot;/緯度差L-L0int LDotSecond;/換算成秒的緯度差double l;double N;double a0;double a3;double a4;double a5;double a6;/七個(gè)計(jì)算參數(shù);#endif / !defined(AFX_ZHENGSUAN_H_2655EA28_E810_44A3_8F14_56421A7B4466_INCLUDED_)Zhengsuan.cpp/ Zhengsuan.cpp: implementation of the Zhengsuan class./#include "Z

12、hengsuan.h"/ Construction/Destruction/Zhengsuan:Zhengsuan()Zhengsuan:Zhengsuan(double fB,double fL)B=fB;rB=degreeToRadian(fB);L=fL;rL=degreeToRadian(fL);Bsecond=B*3600;/初始化大地經(jīng)度L,大地緯度B,Bsecond,按弧度的大地緯度rBn=(int)(L/6+1);/初始化帶號(hào)nL0=6*n-3;/中央經(jīng)線經(jīng)度,角度單位LDot=L-L0;/經(jīng)度差LDotSecond=LDot*3600;l=(LDot)*3600/r

13、ouSecond;/計(jì)算參數(shù)lN=6399698.902-(21562.267-(108.973-0.612*cos(rB)*cos(rB)*cos(rB)*cos(rB)*cos(rB)*cos(rB);/計(jì)算參數(shù)Na0=32140.404-(135.3302-(0.7092-0.004*cos(rB)*cos(rB)*cos(rB)*cos(rB)*cos(rB)*cos(rB);/計(jì)算參數(shù)a0a4=(0.25+0.00252*cos(rB)*cos(rB)*cos(rB)*cos(rB)-0.04166;/計(jì)算參數(shù)a4a6=(0.166*cos(rB)*cos(rB)-0.084)*co

14、s(rB)*cos(rB);/計(jì)算參數(shù)a6a3=(0.3333333+0.001123*cos(rB)*cos(rB)*cos(rB)*cos(rB)-0.1666667;/計(jì)算參數(shù)a3a5=0.0083-(0.1667-(0.1968+0.004*cos(rB)*cos(rB)*cos(rB)*cos(rB)*cos(rB)*cos(rB);/計(jì)算參數(shù)a5x=6367558.4969*Bsecond/rouSecond-(a0-(0.5+(a4+a6*l*l)*l*l)*l*l*N)*sin(rB)*cos(rB);/正算xy=(1+(a3+a5*l*l)*l*l)*l*N*cos(rB);

15、/正算yX=x;Y=n*1000000+y+500000;/國(guó)家統(tǒng)一坐標(biāo)Zhengsuan:Zhengsuan()double Zhengsuan:getX()return X;double Zhengsuan:getY()return Y;void Zhengsuan:printLocation()printf("正算得國(guó)家統(tǒng)一坐標(biāo)為: X= %8.8f Y=%8.8f n",X,Y);double Zhengsuan:getrB()return rB;double Zhengsuan:getrL()return rL;/反算類Fansuan.h/ Fansuan.h:

16、interface for the Fansuan class./#if !defined(AFX_FANSUAN_H_5B5E4668_EE81_463F_8D65_FFE2AEACE745_INCLUDED_)#define AFX_FANSUAN_H_5B5E4668_EE81_463F_8D65_FFE2AEACE745_INCLUDED_#if _MSC_VER > 1000#pragma once#endif / _MSC_VER > 1000#define rouSecond 206264.806247096355#include <math.h>#inc

17、lude "MyFunction.h"#include <iostream>using namespace std;class Fansuan public:Fansuan();Fansuan(double X,double Y);double getB();double getL();void printLocation();virtual Fansuan();private:double x;double y;/高斯投影坐標(biāo)double X;double Y;int N;/國(guó)家統(tǒng)一坐標(biāo),N為帶號(hào)double B,Bsecond;double L;/最后反算得

18、到B、Ldouble L0;/中央經(jīng)線經(jīng)度double l,lsecond;/L=L0+l,L0=6*N-3double Bf,BfSecond,BfDegree;double beta,betaSecond,betaDegree;double Z;double Nf;double b2;double b3;double b4;double b5;/計(jì)算的8個(gè)參數(shù);#endif / !defined(AFX_FANSUAN_H_5B5E4668_EE81_463F_8D65_FFE2AEACE745_INCLUDED_)Fansuan.cpp/ Fansuan.cpp: implementat

19、ion of the Fansuan class./#include "Fansuan.h"/ Construction/Destruction/Fansuan:Fansuan()Fansuan:Fansuan(double X,double Y)this->X=X;this->Y=Y;/初始化x,yN=(int)(Y/1000000);/取出帶號(hào)L0=6*N-3;/初始化該帶號(hào)的中央經(jīng)線經(jīng)度x=X;y=Y-1000000*N-500000;beta=x/6367558.4969;/初始化beta,弧度單位betaSecond=beta*rouSecond;/初始化beta,秒單位betaDegree=betaSecond/3600;/初始化beta,整度數(shù)單位Bf=beta+(50221746+(293622+(2350+22*cos(beta)*cos(beta)*cos(beta)*cos(beta)*cos(beta)*cos(beta)*(1e-10)*sin(beta)*cos(beta);/初始化Bf,弧度單位BfSecond=Bf*rouSecond;/初始化Bf,秒單位BfDegree=BfSecond/3600;/初始化Bf,整度數(shù)單位Nf=6399698.902-(215

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論