#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <ctype.h>
#define RE_WGS84 6378137.0 /* earth semimajor axis (WGS84) (m) */
#define FE_WGS84 (1.0 / 298.257223563) /* earth flattening (WGS84) */
#define PI 3.1415926535897932 /* pi */
#define DEG2RAD 0.017453292519943295
#define RAD2DEG 57.29577951308232087
#define _CRT_SECURE_NO_DEPRECATE
#define _CRT_SECURE_NO_WARNINGS
void ecef2pos(const double* r, double* pos);
void pos2ecef(const double* pos, double* r);
void ecef2enu(const double* pos, const double* r, double* e);
extern void xStrMid(char* szDest, const int nPos, const int nCount, char* szSrc);
int main()
{
double pos[3] = {
'\0' }, r[3] = {
'\0' }, e[3] = {
'\0' }, xyz[3] = {
'\0' };
FILE* fpRead = NULL;FILE* fpWrite = NULL;
xyz[0] = 123652.3247, xyz[1] = 5478178.6894, xyz[2] = 3262408.5345; //需要修改,起始点xyz坐标
ecef2pos(xyz, pos); //xyz转blh
printf("pos: %.9f, %.9f, %.9f \n", pos[0], pos[1], pos[2]);
/* 输入文件*/
if ((fpRead = fopen("C:\\Users\\86183\\Desktop\\name2xiaoxie\\input\\XZSZ_float.txt", "r")) == NULL) {
printf("*** ERROR: open configure file failed, please check it!\n");
return 0;
}
/* 输出文件*/
if ((fpWrite = fopen("C:\\Users\\86183\\Desktop\\name2xiaoxie\\output\\XZSZ.txt", "a")) == NULL) {
printf("*** ERROR: open configure file failed, please check it!\n");
return 0;
}
char *StrLine[1024]= {
0 }; //每行最大读取的字符数
double degBLH[3] = {
坐标转换:XYZ2ENU
最新推荐文章于 2024-02-29 21:50:00 发布