📄 wyhjingduweidu.cpp
字号:
#include<math.h>
#include<fstream.h>
#include<stdlib.h>
#include<iostream.h>
#include <string.h>
#define su 11
void main()
{
//int t;
long double xo,yo,zo,x1,y1,z1,x,y,z,N0,E0,N1,E1,h0,h1,R,r0,r1;//x,y,z shi zhongxinzhan zuobiaoxi gezhan zuobiao
//N0,E0,shi zhongxinzhan weidujiao he jingdujiao
//N1,E1,shi gezhan jingweidu
//h0,shi zhongxinzhan haiba ,h1 shi gezhan haiba
//r0,r1,shi zhongxinzhan dixinju he gezhan dixinju
//R di qiu ban jing
long double a[su][4],b[su][4];
fstream infile;
infile.open("JWD.txt",ios::in);
for(int i=0;i<su;i++)
{
for (int j=0;j<4;j++)
infile>>a[i][j];
}
infile.close();
for(i=0;i<su;i++)
{
R=6371229.00;
N0=(90.0-a[0][2])*3.14159265359/180.0;
N1=(90.0-a[i][2])*3.14159265359/180.0;
E0=(a[0][1]-a[0][1])*3.14159265359/180.0;
E1=(a[i][1]-a[0][1])*3.14159265359/180.0;//qi dian shi zhongxinzhan jingdu
h0=a[0][3];
h1=a[i][3];
r1=R+h1;
r0=R+h0;
long double A=sin(N1);
xo=(r1*sin(N1)*cos(E1)-r0*sin(N0)*cos(E0));//qiu xin zuo biao xi
yo=(r1*sin(N1)*sin(E1)-r0*sin(N0)*sin(E0));
zo=(r1*cos(N1)-r0*cos(N0));
x1=xo*cos(E0)+yo*sin(E0); //yan jingdu xuanzhuan
y1=-xo*sin(E0)+yo*cos(E0);
z1=zo;
x=y1;
y=zo*sin(N0)+xo*cos(N0); //yan weidu xuanzhuan
z=zo*cos(N0)+xo*sin(N0);
b[i][0]=a[i][0];
b[i][1]=x;
b[i][2]=y;
b[i][3]=z;
//printf("x%d=%4.20Lf y%d=%4.20Lf z%d=%4.20Lf\n",t,x,t,y,t,z);
cout<<"A="<<r1<<endl;
cout<<"x="<<x<<endl;
cout<<"y="<<y<<endl;
cout<<"z="<<z<<endl;
cout<<" "<<endl;
fstream outfile;
outfile.open("XYZ.TXT",ios::out);
for(int m=0;m<su;m++)
{
for(int n=0;n<4;n++)
{
outfile<<b[m][n]<<" ";
}
outfile<<endl;
// L[m]=sqrt(b[m][1]*b[m][1]+b[m][2]*b[m][2]+b[m][3]*b[m][3]);
//outfile<<L[m]<<endl;
}
outfile.close();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -