99 lines
4.4 KiB
C
99 lines
4.4 KiB
C
|
|
//
|
|||
|
|
// TyxkDynamics.h
|
|||
|
|
//
|
|||
|
|
// 目的:
|
|||
|
|
//
|
|||
|
|
//
|
|||
|
|
#pragma once
|
|||
|
|
#ifndef INC_TyxkDynamics_H
|
|||
|
|
#define INC_TyxkDynamics_H
|
|||
|
|
|
|||
|
|
#include <iostream>
|
|||
|
|
#include <string>
|
|||
|
|
#include <vector>
|
|||
|
|
namespace Dynamics
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
//简约儒略日转日历
|
|||
|
|
void MJD_UTC(double mjd, int &year, int &mon, int &day, int &hour, int &min, double &sec);
|
|||
|
|
//日历转简约儒略日
|
|||
|
|
void UTC_MJD(int year, int mon, int day, int hour, int min, double sec, double &mjd);
|
|||
|
|
//简约儒略日转北京时
|
|||
|
|
void MJD_BJT(double mjd, int &year, int &mon, int &day, int &hour, int &min, double &sec);
|
|||
|
|
//北京时转简约儒略日
|
|||
|
|
void BJT_MJD(int year, int mon, int day, int hour, int min, double sec, double &mjd);
|
|||
|
|
//日历转北京时
|
|||
|
|
void UTC_BJT(int UTC_year, int UTC_mon, int UTC_day, int UTC_hour, int UTC_min, double UTC_sec, int &BJT_year, int &BJT_mon, int &BJT_day, int &BJT_hour, int &BJT_min, double &BJT_sec);
|
|||
|
|
//北京时转日历
|
|||
|
|
void BJT_UTC(int BJT_year, int BJT_mon, int BJT_day, int BJT_hour, int BJT_min, double BJT_sec, int &UTC_year, int &UTC_mon, int &UTC_day, int &UTC_hour, int &UTC_min, double &UTC_sec);
|
|||
|
|
//日历比较
|
|||
|
|
bool UTCCompare(int UTC1_year, int UTC1_mon, int UTC1_day, int UTC1_hour, int UTC1_min, double UTC1_sec, int UTC2_year, int UTC2_mon, int UTC2_day, int UTC2_hour, int UTC2_min, double UTC2_sec);
|
|||
|
|
//日历加计算
|
|||
|
|
void UTC_add_sec(int year, int mon, int day, int hour, int min, double sec, double addSecs, int &out_year, int &out_mon, int &out_day, int &out_hour, int &out_min, double &out_sec);
|
|||
|
|
//日历减计算
|
|||
|
|
void UTC_sub_sec(int year, int mon, int day, int hour, int min, double sec, double subSecs, int &out_year, int &out_mon, int &out_day, int &out_hour, int &out_min, double &out_sec);
|
|||
|
|
|
|||
|
|
|
|||
|
|
//J2000直角坐标转WGS84直角坐标
|
|||
|
|
void J2000_WGS84(double mjd, double eci[6], double ecf[6]);
|
|||
|
|
//WGS84直角坐标转J2000直角坐标
|
|||
|
|
void WGS84_J2000(double mjd, double ecf[6], double eci[6]);
|
|||
|
|
//WGS84直角坐标转大地坐标
|
|||
|
|
void Pos_LLA(double Pos[3], double LLA[3]);
|
|||
|
|
//WGS84大地坐标转直角坐标
|
|||
|
|
void LLA_Pos(double LLA[3], double Pos[3]);
|
|||
|
|
//J2000坐标系下,位置速度转经典六根数
|
|||
|
|
void PosVel_Orb(double eci[6], double orb[6]);
|
|||
|
|
//J2000坐标系下,经典六根数转位置速度
|
|||
|
|
void Orb_PosVel(double orb[6], double eci[6]);
|
|||
|
|
//真近点角转平近点角
|
|||
|
|
void TrueAno_MeanAno(double f, double e, double &M);
|
|||
|
|
//平近点角转真近点角
|
|||
|
|
void MeanAno_TrueAno(double M, double e, double &f);
|
|||
|
|
//两行根数转经典六根数
|
|||
|
|
void TLE_ELEM(const std::string &line1,const std::string &line2, double kep[6]);
|
|||
|
|
//TEME坐标系直角坐标转J2000坐标系
|
|||
|
|
void TEME_J2000(double mjd, double teme[6], double eci[6]);
|
|||
|
|
//J2000直角坐标系直角坐标转TEME坐标系直角坐标
|
|||
|
|
void J2000_TEME(double mjd, double eci[6], double teme[6]);
|
|||
|
|
|
|||
|
|
|
|||
|
|
//单点二体外推
|
|||
|
|
void Twobody(double mjd0, double orb0[6] , double mjd , double orb[6]);
|
|||
|
|
//二体外推
|
|||
|
|
void Twobody(double orb0[6] , double dt, double orb[6]);
|
|||
|
|
//单点J2外推
|
|||
|
|
void J2_propagator(double mjd0, double orb0[6] , double mjd , double orb[6]);
|
|||
|
|
//J2外推
|
|||
|
|
void J2_propagator (double orb0[6] , double dt, double orb[6]);
|
|||
|
|
//单点J2外推
|
|||
|
|
void J4_propagator(double mjd0, double orb0[6] , double mjd , double orb[6]);
|
|||
|
|
//J4外推
|
|||
|
|
void J4_propagator (double orb0[6] , double dt, double orb[6]);
|
|||
|
|
//HPOP单点外推
|
|||
|
|
void HPOP(double mjd0, double pv0[6] ,int nEarth , bool bSunMoon, bool bSolarRad,
|
|||
|
|
bool bDrag, double area,double mass, double CR, double CD, double mjd , double pv[6]);
|
|||
|
|
//HPOP外推
|
|||
|
|
void HPOP(double mjd0, double pv0[6] ,int nEarth , bool bSunMoon, bool bSolarRad,
|
|||
|
|
bool bDrag, double aera,double mass, double CR, double CD, double mjd_b, double mjd_e, double step, std::vector< std::vector<double> > &pvlist);
|
|||
|
|
//SGP4单点外推
|
|||
|
|
void SGP4_PV(const std::string &line1,const std::string &line2, double mjd , double pv[6]);
|
|||
|
|
//SGP4多点外推
|
|||
|
|
void SGP4_PV(const std::string &line1,const std::string &line2, double mjd_b, double mjd_e, double step, std::vector< std::vector<double> > &pvlist);
|
|||
|
|
//计算太阳位置
|
|||
|
|
void Sun(double mjd, double r[3]);
|
|||
|
|
//计算月球位置
|
|||
|
|
void Moon(double mjd, double r[3]);
|
|||
|
|
|
|||
|
|
const double pi = 3.14159265358979324;
|
|||
|
|
const double pi2 = 2.0*pi; // 2pi
|
|||
|
|
const double Rad = pi / 180.0; // Radians per degree
|
|||
|
|
const double Deg = 180.0 / pi; // Degrees per radian
|
|||
|
|
const double Arcs = 3600.0*180.0/pi; // Arcseconds per radian
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
|