資源簡介
武漢大學(xué)測繪學(xué)院大地測量學(xué)編程--大地主題解算-高斯投影算C++源碼
代碼片段和文件信息
//?Gauss.cpp?:?Defines?the?entry?point?for?the?console?application.
//Gauss正反算
//武漢大學(xué)測繪學(xué)院測繪工程0609班?學(xué)號(hào)?200631610370?劉浩?
#include?“stdafx.h“
#include?
#include?
#include?
#include? //setprecision()函數(shù)的頭文件?用于控制小數(shù)的位數(shù)
#define??M?8
#define?PI?3.141592653589793
void?OuDegree(double?); //聲明按°′″格式輸出函數(shù)
int?i;
void?main(void)
{
cout<<“請(qǐng)選擇你要進(jìn)行的運(yùn)算:\n【高斯投影正算?1】【高斯投影反算?2】“< cin>>i;
if(i==1)
{
cout<<“您選擇了高斯投影正算正算的結(jié)果為:“< //定義3個(gè)數(shù)組,第一個(gè)存放°,第二個(gè)存放′,第三個(gè)存放″
double??degree[M]={51 ?111 0}
minute[M]={38 ??2 0}
second[M]={43.9023 13.1360 0};
//將?B?L?化成弧度
double??B=(degree[0]+minute[0]/60+second[0]/3600)*PI/180;
double??L=(degree[1]+minute[1]/60+second[1]/3600)*PI/180;
int N?L0;
double??l?NN?a0 a4 a6 a3 a5?x y;
N=(int)(degree[1]+minute[1]/60+second[1]/3600)/6+1;
L0=6*N-3;
l=((degree[1]+minute[1]/60+second[1]/3600)-L0)*PI/180;
NN=6399698.902-(21562.267-(108.973-0.612*cos(B)*cos(B))*cos(B)*cos(B))*cos(B)*cos(B);
a0=32140.404-(135.3302-(0.7092-0.0040*cos(B)*cos(B))*cos(B)*cos(B))*cos(B)*cos(B);
a4=(0.25+0.00252*cos(B)*cos(B))*cos(B)*cos(B)-0.04166;
a6=(0.166*cos(B)*cos(B)-0.084)*cos(B)*cos(B);
a3=(0.3333333+0.001123*cos(B)*cos(B))*cos(B)*cos(B)-0.166667;
a5=0.0083-(0.1667-(0.1968+0.0040*cos(B)*cos(B))*cos(B)*cos(B))*cos(B)*cos(B);
x=6367558.4969*B-(a0-(0.5+(a4+a6*l*l)*l*l)*l*l*NN)*sin(B)*cos(B);
y=(1+(a3+a5*l*l)*l*l)*l*NN*cos(B);
y=y+500000.0;
//輸出計(jì)算成果
cout<<“B=“< cout<<“sin(B)=“< cout<<“cos(B)=“< cout<<“l(fā)=“< cout<<“L0=“< cout<<“NN=“< cout<<“a0=“< cout<<“a4=“< cout<<“a6=“< cout<<“a3=“< cout<<“a5=“< cout<<“N=“< cout<<“x=“< cout<<“y=“< }
//反算
if(i==2)
{
cout<<“您選擇了高斯投影反算反算的結(jié)果為:“< double?x=5724004.82174 y=19502559.91994;
double?bBfZNfb2b3b4b5BlLL0Ny0;
N=(int)y/1000000; //計(jì)算帶數(shù)
L0=(6*N-3)*PI/180; //計(jì)算子午線的弧度
y0=y-N*1e6-500000; //計(jì)算y的實(shí)際值
b=x/6367558.4969;
Bf=b+(50221746+(293622+(2350+22*cos(b)*cos(b))*cos(b)*cos(b))*cos(b)*cos(b))*1e-10*sin(b)*cos(b);
Nf=6399698.902-(21562.267-(108.973-0.612*cos(Bf)*cos(Bf))*cos(Bf)*cos(Bf))*cos(Bf)*cos(Bf);
Z=y0/(Nf*cos(Bf));
b2=(0.5+0.003369*cos(Bf)*cos(Bf))*sin(Bf)*cos(Bf);
b3=0.333333-(0.166667-0.001123*cos(Bf)*cos(Bf))*cos(Bf)*cos(Bf);
b4=0.25+(0.16161+0.00562*cos(Bf)*cos(Bf))*cos(Bf)*cos(Bf);
b5=0.2-(0.1667-0.0088*cos(Bf)*cos(Bf))*cos(Bf)*cos(Bf);
B=Bf-(1-(b4-0.12*Z*Z)*Z*Z)*Z*Z*b2;
l=(1-(b3-b5*Z*Z)*Z*Z)*Z;
L=L0+l;
cout<<“N的值為:“< cout<<“β的值為:“< cout<<“cos(β)的值為:“< cout<<“sin(β)的值為:“< cout<<“Bf的值為:“< cout<<“Z的值為:“< cout<<“Nf的值為:“< cout<<“b2的值為:“< cout<<“b3的值為:“< cout<<“b4的值為:“< cout<<“b5的值為:“<
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件??????48640??2008-10-19?12:22??Gauss_ty\Gauss.opt
?????文件???????3610??2008-10-19?12:21??Gauss_ty\Gauss.cpp
?????文件????????769??2008-10-16?20:31??Gauss_ty\StdAfx.h
?????文件????????292??2008-10-16?20:31??Gauss_ty\StdAfx.cpp
?????文件???????1202??2008-10-16?20:31??Gauss_ty\ReadMe.txt
?????文件???????4524??2008-10-16?20:31??Gauss_ty\Gauss.dsp
?????文件????????535??2008-10-16?20:31??Gauss_ty\Gauss.dsw
?????文件??????50176??2008-10-19?12:22??Gauss_ty\Gauss.ncb
?????文件??????58368??2008-10-19?12:21??Gauss_ty\Debug\vc60.idb
?????文件?????203736??2008-10-16?20:31??Gauss_ty\Debug\Gauss.pch
?????文件?????102400??2008-10-19?12:21??Gauss_ty\Debug\vc60.pdb
?????文件???????1765??2008-10-16?20:31??Gauss_ty\Debug\StdAfx.obj
?????文件?????406620??2008-10-19?12:21??Gauss_ty\Debug\Gauss.ilk
?????文件?????225325??2008-10-19?12:21??Gauss_ty\Debug\Gauss.exe
?????文件?????549888??2008-10-19?12:21??Gauss_ty\Debug\Gauss.pdb
?????文件??????30283??2008-10-19?12:21??Gauss_ty\Debug\Gauss.obj
?????文件???????1494??2008-10-19?12:21??Gauss_ty\Gauss.plg
?????目錄??????????0??2008-10-16?20:31??Gauss_ty\Debug
?????目錄??????????0??2008-10-16?20:31??Gauss_ty
-----------?---------??----------?-----??----
??????????????1689627????????????????????19
評(píng)論
共有 條評(píng)論