欢迎来到天天文库
浏览记录
ID:57277405
大小:65.50 KB
页数:17页
时间:2020-08-08
《高斯投影坐标正反算编程资料报告材料.doc》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、高斯投影坐标正反算编程报告1.编程思想进行高斯投影坐标正反算的编程需要牵涉到大量的公式,为了使程序条理更清楚,各块的数据复用性更强,这里采取了结构化的编程思想。程序由四大块组成。GeodesyHomework.cpp文件用于存放main()函数,是整个程序的入口。通过结构化的编程尽力使main()函数变得简单。MyFunction.h和MyFunction.cpp用于存放计算过程中进行角度弧度换算时所要用到的一些自定的转换函数。Zhengsuan.h和Zhengsuan.cpp用于存放Zhengsuan类,在Zhen
2、gsuan类中声明了高斯投影坐标正算所要用到的所有变量,在类的构造函数中进行成员变量的初始化及正算计算。通过get函数获得相应的正算结果。Fansuan.h和Fansuan.cpp用于存放Fansuan类,类似于Zhengsuan类,Fansuan类中声明了高斯投影坐标反算所要用到的所有变量,在类的构造函数中进行成员变量的初始化及反算计算。通过get函数获得相应的反算结果。2.计算模型高斯投影正算公式高斯投影反算公式1.程序框图2.计算结果3.附录:程序代码/////主函数入口GeodesyHomework.cpp#
3、include"MyFunction.h"#include"Zhengsuan.h"#include"Fansuan.h"#includeusingnamespacestd;voidfansuan();voidzhengsuan();voidmain(){zhengsuan();fansuan();printf("/nover!");}voidzhengsuan(){doublemyB,myL;cout<<"【正算】"<4、egree();cout<<"请输入经度L"<5、243953.4517"<>myX>>myY;FansuanmyFansuan1(myX,myY);myFansuan1.printLocation();}///自定功能函数库MyFunction.h#definePI3.1415926#includeusingnamespacestd;doubleangleToDegree(intdu,intfen,floatmiao);doubleangleToDegree();//将度分秒换算为度doubledegreeToRadian(6、doubledegree);doubledegreeToRadian();//将角度换算为弧度MyFunction.cpp#include"MyFunction.h"doubleangleToDegree(intdu,intfen,floatmiao){doubleresult=0;result=miao/3600.0+fen/60.0+du;returnresult;}doubleangleToDegree(){intdu,fen;floatmiao;doubleresult;cout<<"请输入度分秒。例如:307、2000"<>du>>fen>>miao;result=angleToDegree(du,fen,miao);returnresult;}doubledegreeToRadian(doubledegree){doubleresult=0;result=degree/57.2321;returnresult;}doubledegreeToRadian(){doubleresult,degree;degree=angleToDegree();result=degreeToRadian(degree);8、returnresult;}///正算类Zhengsuan.h//Zhengsuan.h:interfacefortheZhengsuanclass.////////////////////////////////////////////////////////////////////////#if!defined(AFX_ZHENGSUAN_
4、egree();cout<<"请输入经度L"<5、243953.4517"<>myX>>myY;FansuanmyFansuan1(myX,myY);myFansuan1.printLocation();}///自定功能函数库MyFunction.h#definePI3.1415926#includeusingnamespacestd;doubleangleToDegree(intdu,intfen,floatmiao);doubleangleToDegree();//将度分秒换算为度doubledegreeToRadian(6、doubledegree);doubledegreeToRadian();//将角度换算为弧度MyFunction.cpp#include"MyFunction.h"doubleangleToDegree(intdu,intfen,floatmiao){doubleresult=0;result=miao/3600.0+fen/60.0+du;returnresult;}doubleangleToDegree(){intdu,fen;floatmiao;doubleresult;cout<<"请输入度分秒。例如:307、2000"<>du>>fen>>miao;result=angleToDegree(du,fen,miao);returnresult;}doubledegreeToRadian(doubledegree){doubleresult=0;result=degree/57.2321;returnresult;}doubledegreeToRadian(){doubleresult,degree;degree=angleToDegree();result=degreeToRadian(degree);8、returnresult;}///正算类Zhengsuan.h//Zhengsuan.h:interfacefortheZhengsuanclass.////////////////////////////////////////////////////////////////////////#if!defined(AFX_ZHENGSUAN_
5、243953.4517"<>myX>>myY;FansuanmyFansuan1(myX,myY);myFansuan1.printLocation();}///自定功能函数库MyFunction.h#definePI3.1415926#includeusingnamespacestd;doubleangleToDegree(intdu,intfen,floatmiao);doubleangleToDegree();//将度分秒换算为度doubledegreeToRadian(
6、doubledegree);doubledegreeToRadian();//将角度换算为弧度MyFunction.cpp#include"MyFunction.h"doubleangleToDegree(intdu,intfen,floatmiao){doubleresult=0;result=miao/3600.0+fen/60.0+du;returnresult;}doubleangleToDegree(){intdu,fen;floatmiao;doubleresult;cout<<"请输入度分秒。例如:30
7、2000"<>du>>fen>>miao;result=angleToDegree(du,fen,miao);returnresult;}doubledegreeToRadian(doubledegree){doubleresult=0;result=degree/57.2321;returnresult;}doubledegreeToRadian(){doubleresult,degree;degree=angleToDegree();result=degreeToRadian(degree);
8、returnresult;}///正算类Zhengsuan.h//Zhengsuan.h:interfacefortheZhengsuanclass.////////////////////////////////////////////////////////////////////////#if!defined(AFX_ZHENGSUAN_
此文档下载收益归作者所有