• 大小: 6.75MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-10-12
  • 语言: 其他
  • 标签: GPS  

资源简介

在GPS 单点定位 代码编程的时候可以进行N文件o文件读取

资源截图

代码片段和文件信息

//#include “stdafx.h“
#include
#include“coordinate.h“
#include
#include
using namespace std;
#define M_PI 3.1415926
void DMS_RAD(double DMSdouble *Rad)
{
int DegMin;
double Sec;
Deg=(int)DMS;
Min=(int)((DMS-Deg)*100);
Sec=((DMS-Deg)*100-Min)*100;
*Rad=(Deg+Min/60.0+Sec/3600.0)/180.0*M_PI;

}

void RAD_DMS(double Raddouble *DMS)
{
int DegMin;
double Sec;
double ARAM;
AR=Rad;
if (Rad<0)
AR=-Rad;
AR=AR+1.0e-10;
AR=AR*180.0/M_PI;
Deg=(int)AR;
AM=(AR-Deg)*60.0;
Min=(int)AM;
Sec=(AM-Min)*60;
*DMS=Deg+Min/100.0+Sec/10000.0;
if(Rad<0)
*DMS=-*DMS;
}
bool CRDGEODETICtoCRDCARTESEAN(PCRDGEODETIC pcgPCRDCARTESIAN pccdouble dSemiMajorAxisdouble dFlatning)
{
double Ne;
e=sqrt(2*dFlatning-dFlatning*dFlatning);
N=dSemiMajorAxis/sqrt(1-e*e*sin(pcg->latitude)*sin(pcg->latitude));
pcc->x=(N+pcg->height)*cos(pcg->latitude)*cos(pcg->longitude);
pcc->y=(N+pcg->height)*cos(pcg->latitude)*sin(pcg->longitude);
pcc->z=((N*(1-e*e)+pcg->height))*sin(pcg->latitude);
return true;

}
bool CRDCARTESIANtoCRDGEODETIC(PCRDCARTESIAN pccPCRDGEODETIC pcgdouble dSemiMajorAxisdouble dFlatning)
{
/*double XYZb0bwrfN;
double e2=2*dFlatning-dFlatning*dFlatning;

X=pcc->x;
Y=pcc->y;
Z=pcc->z;
r=sqrt(X*X+Y*Y+Z*Z);
pcg->longitude=atan2(YX);
b0=atan2(Zsqrt(X*X+Y*Y));
b=b0;
f=b0;
do
{
b0=b;
 w=sqrt(1-e2*sin(b0)*sin(b0));
 b=atan(tan(b0)*(1+dSemiMajorAxis*e2*sin(b0)/(Z*w)));
}
while(fabs((b-b0)>1.0e-10));
w=sqrt(1-e2*sin(b)*sin(b));
N=dSemiMajorAxis/w;
pcg->latitude=b;
pcg->height=r*cos(f)/cos(b)-N;*/

double B0RN;
double B_L_;
double X=pcc->x;
double Y=pcc->y;
double Z=pcc->z;

R=sqrt(X*X+Y*Y);
B0=atan2(ZR);

while (1)
{
N=dSemiMajorAxis/sqrt(1.0-dFlatning*(2-dFlatning)*sin(B0)*sin(B0));
B_=atan2(Z+N*dFlatning*(2-dFlatning)*sin(B0)R);
if(fabs(B_-B0)<1.0e-10)
break;
B0=B_;
}
L_=atan2(YX);
pcg->height=R/cos(B_)-N;

RAD_DMS(B_&pcg->latitude);
RAD_DMS(L_&pcg->longitude);
return true;
}
bool CRDCARTESIANtoCRDTOPCENTRIC(PCRDCARTESIAN pccPCRDTOPCENTRIC pctPCRDCARTESIAN pccCenterdouble dSemiMajorAxisdouble dFlatning)
{
/*double dxdydz;
dx=pcc->x-pccCenter->x;
dy=pcc->y-pccCenter->y;
dz=pcc->z-pccCenter->z;
PCRDGEODETIC pcg=new CRDGEODETIC;
CRDCARTESIANtoCRDGEODETIC(pccCenterpcgdSemiMajorAxisdFlatning);
pct->northing=-sin(pcg->latitude)*cos(pcg->longitude)*dx-sin(pcg->latitude)*sin(pcg->longitude)*dy+cos(pcg->latitude)*dz;
pct->easting=-sin(pcg->longitude)*dx+cos(pcg->longitude)*dy;
pct->upping=cos(pcg->latitude)*cos(pcg->longitude)*dx+cos(pcg->latitude)*sin(pcg->longitude)*dy+sin(pcg->latitude)*dz;*/
double dXdYdZ;
dX=pcc->x-pccCenter->x;
dY=pcc->y-pccCenter->y;
dZ=pcc->z-pccCenter->z;

CRDGEODETIC Geodetic;
CRDCARTESIANtoCRDGEODETIC(pccCenter&GeodeticdSemiMajorAxisdFlatning);

double BLH;
DMS_RAD(Geodetic.latitude

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        545  2011-01-09 20:36  Ofile_read\Ofile_read.dsw

     文件      41984  2011-01-09 20:44  Ofile_read\Ofile_read.ncb

     文件      99328  2011-01-09 20:44  Ofile_read\Debug\vc60.idb

     文件     135168  2011-01-09 20:42  Ofile_read\Debug\vc60.pdb

     文件      19428  2011-01-09 20:39  Ofile_read\Debug\coordinate.obj

     文件    2102856  2011-01-09 20:39  Ofile_read\Debug\Ofile_read.pch

     文件      18214  2011-01-09 20:39  Ofile_read\Debug\time.obj

     文件    1172480  2011-01-09 20:42  Ofile_read\Debug\Ofile_read.pdb

     文件     589917  2011-01-09 20:42  Ofile_read\Debug\Ofile_read.exe

     文件     303907  2011-01-09 20:42  Ofile_read\Debug\Ofile_read.obj

     文件     843884  2011-01-09 20:42  Ofile_read\Debug\Ofile_read.ilk

     文件       1059  2010-05-24 20:34  Ofile_read\time.h

     文件       1150  2010-07-22 21:14  Ofile_read\coordinate.h

     文件       2783  2011-01-09 20:30  Ofile_read\time.cpp

     文件       3558  2011-01-09 20:29  Ofile_read\coordinate.cpp

     文件        254  2011-01-09 20:44  Ofile_read\Ofile_read.plg

     文件       8225  2011-01-09 20:42  Ofile_read\Ofile_read.cpp

     文件   20663863  2010-07-14 13:59  Ofile_read\base268q.05O

     文件      48640  2011-01-09 20:44  Ofile_read\Ofile_read.opt

     文件       4944  2011-01-09 20:44  Ofile_read\Ofile_read.dsp

     目录          0  2011-01-09 20:36  Ofile_read\Debug

     目录          0  2011-01-09 20:36  Ofile_read

----------- ---------  ---------- -----  ----

             26062187                    22


评论

共有 条评论