24#include "AstCore/Vector.hpp"
25#include "AstCore/OrbitParam.hpp"
26#include "AstCore/TimePoint.hpp"
27#include "AstUtil/Constants.hpp"
48#if defined(A_GCC) || defined(A_CLANG)
49# pragma GCC diagnostic push
50# pragma GCC diagnostic ignored "-Weffc++"
62 A_DEF_POD_ITERABLE(
double)
66 const Vector3d& pos()
const {
return pos_;}
67 Vector3d& pos() {
return pos_;}
68 const Vector3d& position()
const {
return pos_;}
69 Vector3d& position() {
return pos_;}
73 const Vector3d&
vel()
const {
return vel_;}
74 Vector3d& vel() {
return vel_;}
75 const Vector3d& velocity()
const {
return vel_;}
76 Vector3d& velocity() {
return vel_;}
78 double& x() {
return pos_.x();}
79 double& y() {
return pos_.y();}
80 double& z() {
return pos_.z();}
81 double& vx() {
return vel_.x();}
82 double& vy() {
return vel_.y();}
83 double& vz() {
return vel_.z();}
85 double x()
const {
return pos_.x();}
86 double y()
const {
return pos_.y();}
87 double z()
const {
return pos_.z();}
88 double vx()
const {
return vel_.x();}
89 double vy()
const {
return vel_.y();}
90 double vz()
const {
return vel_.z();}
94 std::string toString()
const;
99 if (!std::isfinite(val))
104#if defined(A_GCC) || defined(A_CLANG)
105# pragma GCC diagnostic pop
124 double getSMA()
const {
return a_;}
126 double getA()
const {
return a_;}
128 double getE()
const {
return e_;}
130 double getI()
const {
return i_;}
132 double getRAAN()
const {
return raan_;}
134 double getArgPer()
const {
return argper_;}
136 double getTrueA()
const {
return trueA_;}
140 std::string toString()
const;
142 A_DEF_POD_ITERABLE(
double)
143 AST_DEF_ACCESS_METHOD(
double, a)
144 AST_DEF_ACCESS_METHOD(
double, e)
145 AST_DEF_ACCESS_METHOD(
double, i)
146 AST_DEF_ACCESS_METHOD(
double, raan)
147 AST_DEF_ACCESS_METHOD(
double, argper)
148 AST_DEF_ACCESS_METHOD(
double, trueA)
165 double getSMA()
const {
return rp_ / (1 - e_);}
183 double getPeriAlt(
double bodyRadius)
const{
return getPeriRad() - bodyRadius;}
224 return stateEpoch - getTimePastAscNode(gm);
230 return aRAANToLAN(getRAAN(), inertialAxes, timeOfAscNodePassage, bodyFixedAxes);
235 double getA()
const {
return getSMA();}
238 double getP()
const {
return rp_ * (1 + e_);}
240 double getE()
const {
return getEcc();}
242 double getI()
const {
return getInc();}
244 double getArgPer()
const {
return getArgPeri();}
246 double getTrueA()
const {
return getTrueAnomaly();}
250 std::string toString()
const;
252 A_DEF_POD_ITERABLE(
double)
253 AST_DEF_ACCESS_METHOD(
double, rp)
254 AST_DEF_ACCESS_METHOD(
double, e)
255 AST_DEF_ACCESS_METHOD(
double, i)
256 AST_DEF_ACCESS_METHOD(
double, raan)
257 AST_DEF_ACCESS_METHOD(
double, argper)
258 AST_DEF_ACCESS_METHOD(
double, trueA)
277 A_DEF_POD_ITERABLE(
double)
278 AST_DEF_ACCESS_METHOD(
double, a)
279 AST_DEF_ACCESS_METHOD(
double, h)
280 AST_DEF_ACCESS_METHOD(
double, k)
281 AST_DEF_ACCESS_METHOD(
double, p)
282 AST_DEF_ACCESS_METHOD(
double, q)
283 AST_DEF_ACCESS_METHOD(
double, lambda)
301 A_DEF_POD_ITERABLE(
double)
302 AST_DEF_ACCESS_METHOD(
double, p)
303 AST_DEF_ACCESS_METHOD(
double, f)
304 AST_DEF_ACCESS_METHOD(
double, g)
305 AST_DEF_ACCESS_METHOD(
double, h)
306 AST_DEF_ACCESS_METHOD(
double, k)
307 AST_DEF_ACCESS_METHOD(
double, L)
331 A_DEF_POD_ITERABLE(
double)
332 AST_DEF_ACCESS_METHOD(
double,
L)
333 AST_DEF_ACCESS_METHOD(
double, G)
334 AST_DEF_ACCESS_METHOD(
double, H)
335 AST_DEF_ACCESS_METHOD(
double, l)
336 AST_DEF_ACCESS_METHOD(
double,
g)
337 AST_DEF_ACCESS_METHOD(
double,
h)
361 std::string toString()
const;
363 A_DEF_POD_ITERABLE(
double)
364 AST_DEF_ACCESS_METHOD(
double, ra)
365 AST_DEF_ACCESS_METHOD(
double, dec)
366 AST_DEF_ACCESS_METHOD(
double, bDotR)
367 AST_DEF_ACCESS_METHOD(
double, bDotT)
368 AST_DEF_ACCESS_METHOD(
double, c3)
369 AST_DEF_ACCESS_METHOD(
double, trueA)
416 std::string toString()
const;
418 A_DEF_POD_ITERABLE(
double)
419 AST_DEF_ACCESS_METHOD(
double, ra)
420 AST_DEF_ACCESS_METHOD(
double, dec)
421 AST_DEF_ACCESS_METHOD(
double, r)
422 AST_DEF_ACCESS_METHOD(
double, fpa)
423 AST_DEF_ACCESS_METHOD(
double, azi)
424 AST_DEF_ACCESS_METHOD(
double, v)
475 std::string toString()
const;
477 A_DEF_POD_ITERABLE(
double)
478 AST_DEF_ACCESS_METHOD(
double, lon)
479 AST_DEF_ACCESS_METHOD(
double, lat)
480 AST_DEF_ACCESS_METHOD(
double, alt)
481 AST_DEF_ACCESS_METHOD(
double, fpa)
482 AST_DEF_ACCESS_METHOD(
double, azi)
483 AST_DEF_ACCESS_METHOD(
double, v)
534 std::string toString()
const;
536 A_DEF_POD_ITERABLE(
double)
537 AST_DEF_ACCESS_METHOD(
double, lon)
538 AST_DEF_ACCESS_METHOD(
double, lat)
539 AST_DEF_ACCESS_METHOD(
double, alt)
540 AST_DEF_ACCESS_METHOD(
double, lonRate)
541 AST_DEF_ACCESS_METHOD(
double, latRate)
542 AST_DEF_ACCESS_METHOD(
double, altRate)
552AST_CORE_API errc_t aCartToSpherical(
565AST_CORE_API errc_t aSphericalToCart(
566 const SphericalElem& sph,
582AST_CORE_API errc_t aCartToMixedSpherical(
585 const Rotation& framelToFixed,
586 const BodyShape& shape,
587 MixedSphericalElem& mixedSph
599AST_CORE_API errc_t aMixedSphericalToCart(
600 const MixedSphericalElem& mixedSph,
601 const Rotation& fixedToframe,
602 const BodyShape& shape,
618AST_CORE_API errc_t aCartToGeodetic(
621 const BodyShape& shape,
622 GeodeticElem& geodetic
635AST_CORE_API errc_t aGeodeticToCart(
636 const GeodeticElem& geodetic,
637 const BodyShape& shape,
649AST_CORE_CAPI errc_t coe2rv(
const double* coe,
double gm,
double* pos,
double* vel);
655AST_CORE_CAPI errc_t coe2mee(
const double* coe,
double* mee);
662AST_CORE_CAPI
void ee2rv(
const double* ee,
double gm,
double* pos,
double* vel);
669AST_CORE_CAPI
void mee2rv(
const double* mee,
double gm,
double* pos,
double* vel);
677AST_CORE_CAPI errc_t rv2mee(
const double* pos,
const double* vel,
double gm,
double* mee);
683AST_CORE_CAPI errc_t mee2coe(
const double* mee,
double* coe);
690AST_CORE_CAPI
void rv2ee(
const double* pos,
const double* vel,
double gm,
double* ee);
698AST_CORE_CAPI errc_t rv2moe(
const double* pos,
const double* vel,
double gm,
double* moe);
706AST_CORE_CAPI errc_t rv2coe(
const double* pos,
const double* vel,
double gm,
double* coe);
712AST_CORE_CAPI errc_t ee2moe(
const double* ee,
double* moe);
718AST_CORE_CAPI errc_t moe2ee(
const double* moe,
double* ee);
723AST_CORE_CAPI errc_t moe2coe(
const double* moe,
double* coe);
728AST_CORE_CAPI
void coe2moe(
const double* coe,
double* moe);
735AST_CORE_CAPI errc_t moe2rv(
const double* moe,
double gm,
double* pos,
double* vel);
740AST_CORE_CAPI
void moe2mee(
const double* moe,
double* mee);
745AST_CORE_CAPI
void coe2ee(
const double* coe,
double* ee);
750AST_CORE_CAPI
void ee2coe(
const double* ee,
double* coe);
755AST_CORE_CAPI
void ee2mee(
const double* ee,
double* mee);
760AST_CORE_CAPI
void mee2ee(
const double* mee,
double* ee);
765AST_CORE_CAPI
void mee2moe(
const double* mee,
double* moe);
772AST_CORE_CAPI errc_t coe2dela(
const double* coe,
double gm,
double* dela);
778AST_CORE_CAPI errc_t dela2coe(
const double* dela,
double gm,
double* coe);
786AST_CORE_CAPI
void aModEquinElemToCart(
787 const ModEquinElem& mee,
799AST_CORE_CAPI errc_t aCartToModEquinElem(
810AST_CORE_CAPI errc_t aOrbElemToModEquinElem(
819AST_CORE_CAPI errc_t aModEquinElemToOrbElem(
820 const ModEquinElem& mee,
830AST_CORE_CAPI errc_t aCartToModOrbElem(
843errc_t aCartToOrbElem (
854errc_t aEquinElemToModOrb (
855 const EquinElem& equinElem,
863errc_t aModOrbToEquinElem (
864 const ModOrbElem& modOrb,
865 EquinElem& equinElem);
873errc_t aModOrbElemToCart (
874 const ModOrbElem& modOrb,
886errc_t aOrbElemToCart (
898void aCartToEquinElem(
902 EquinElem& equinElem);
910void aEquinElemToCart(
911 const EquinElem& equinElem,
922errc_t aOrbElemToDelaunay(
925 DelaunayElem& delaunay);
933errc_t aDelaunayToOrbElem(
934 const DelaunayElem& delaunay,
977AST_CORE_CAPI errc_t aCartToBPlane(
981 const Vector3d& refVector,
993AST_CORE_CAPI errc_t aBPlaneToCart(
994 const BPlaneElem& bPlane,
996 const Vector3d& refVector,
1007AST_DECL_TYPE_ALIAS(CartState)
B平面根数
定义 OrbitElement.hpp:349
double ra_
入渐近线赤经(B平面法向量的赤经) [rad]
定义 OrbitElement.hpp:352
double bDotR_
B矢量在R轴上的分量 B·R [m]
定义 OrbitElement.hpp:354
double trueA_
真近点角 [rad]
定义 OrbitElement.hpp:357
double dec_
入渐近线赤纬(B平面法向量的赤纬) [rad]
定义 OrbitElement.hpp:353
double c3_
特征能量 C3 = v^2 - 2*gm/r [m^2/s^2]
定义 OrbitElement.hpp:356
double bDotT_
B矢量在T轴上的分量 B·T [m]
定义 OrbitElement.hpp:355
直角坐标
定义 OrbitElement.hpp:53
bool isFinite() const
判断状态分量是否全部为有限值
定义 OrbitElement.hpp:97
Vector3d vel_
速度
定义 OrbitElement.hpp:56
Vector3d pos_
位置
定义 OrbitElement.hpp:55
const Vector3d & vel() const
获取速度
定义 OrbitElement.hpp:73
static CartState Zero()
获取零状态
定义 OrbitElement.hpp:60
德洛奈根数
定义 OrbitElement.hpp:321
春分点根数
定义 OrbitElement.hpp:264
double lambda_
mean longitude = M + RAAN + argper (平经度)
定义 OrbitElement.hpp:272
double k_
e*cos(argper + RAAN)
定义 OrbitElement.hpp:269
double q_
tan(i/2)*cos(RAAN)
定义 OrbitElement.hpp:271
double meanLongitude() const
平经度
定义 OrbitElement.hpp:275
double a_
semimajor axis length (半长轴)
定义 OrbitElement.hpp:267
double p_
tan(i/2)*sin(RAAN)
定义 OrbitElement.hpp:270
double h_
e*sin(argper + RAAN) omegabar=argper + RAAN
定义 OrbitElement.hpp:268
大地坐标根数
定义 OrbitElement.hpp:504
double lon_
大地经度 [rad] (天体固连系)
定义 OrbitElement.hpp:508
double lonRate_
大地经度变化率 [rad/s] (天体固连系)
定义 OrbitElement.hpp:511
double getLat() const
获取大地纬度
定义 OrbitElement.hpp:518
double getLatRate() const
获取大地纬度变化率
定义 OrbitElement.hpp:527
double getAlt() const
获取高度
定义 OrbitElement.hpp:521
double alt_
高度 [m] (相对参考椭球, 沿椭球法线)
定义 OrbitElement.hpp:509
double lat_
大地纬度 [rad] (天体固连系)
定义 OrbitElement.hpp:507
double altRate_
高度变化率 [m/s] (天体固连系)
定义 OrbitElement.hpp:512
double getLon() const
获取大地经度
定义 OrbitElement.hpp:515
double latRate_
大地纬度变化率 [rad/s] (天体固连系)
定义 OrbitElement.hpp:510
double getLonRate() const
获取大地经度变化率
定义 OrbitElement.hpp:524
double getAltRate() const
获取高度变化率
定义 OrbitElement.hpp:530
混合球坐标轨道根数
定义 OrbitElement.hpp:442
double azi_
航迹方位角 [rad]
定义 OrbitElement.hpp:449
double getLon() const
获取大地经度
定义 OrbitElement.hpp:453
double getVel() const
获取速度大小
定义 OrbitElement.hpp:471
double getVertFltPathAng() const
获取垂直飞行航迹角(水平飞行航迹角的余角)
定义 OrbitElement.hpp:465
double getAlt() const
获取高度
定义 OrbitElement.hpp:459
double getFltPathAzi() const
获取航迹方位角
定义 OrbitElement.hpp:468
double lat_
大地纬度 [rad] (天体固连系)
定义 OrbitElement.hpp:446
double fpa_
水平航迹角 [rad]
定义 OrbitElement.hpp:448
double alt_
高度 [m] (相对参考椭球, 沿椭球法线)
定义 OrbitElement.hpp:447
double getFltPathAng() const
获取飞行航迹角(水平飞行航迹角)
定义 OrbitElement.hpp:462
double lon_
大地经度 [rad] (天体固连系)
定义 OrbitElement.hpp:445
double v_
惯性速度大小 [m/s]
定义 OrbitElement.hpp:450
double getLat() const
获取大地纬度
定义 OrbitElement.hpp:456
改进春分点轨道根数, 180度奇异
定义 OrbitElement.hpp:288
double h_
h = tan(i/2)*cos(RAAN)
定义 OrbitElement.hpp:294
double k_
k = tan(i/2)*sin(RAAN)
定义 OrbitElement.hpp:295
double trueLongitude() const
真经度
定义 OrbitElement.hpp:299
double L_
L = RAAN + argper + trueA (真经度)
定义 OrbitElement.hpp:296
double g_
g = e*sin(argper + RAAN)
定义 OrbitElement.hpp:293
double f_
f = e*cos(argper + RAAN)
定义 OrbitElement.hpp:292
double p_
p = a(1-e^2) 半通径
定义 OrbitElement.hpp:291
修正轨道根数
定义 OrbitElement.hpp:154
double rp_
近拱点半径
定义 OrbitElement.hpp:157
double getMeanMotion(double gm) const
计算平均角速度
定义 OrbitElement.hpp:168
double getA() const
计算半长轴
定义 OrbitElement.hpp:235
double getLAN(Axes *inertialAxes, const TimePoint &timeOfAscNodePassage, Axes *bodyFixedAxes) const
计算升交点经度
定义 OrbitElement.hpp:228
double trueA_
真近点角
定义 OrbitElement.hpp:162
double getSMA() const
计算半长轴
定义 OrbitElement.hpp:165
double getMeanLongitude() const
计算平均经度
定义 OrbitElement.hpp:213
double getArgLat() const
计算纬度幅角
定义 OrbitElement.hpp:207
double getLongitudeOfPeri() const
计算近拱点经度
定义 OrbitElement.hpp:210
double getEccAnomaly() const
计算偏近点角
定义 OrbitElement.hpp:204
double getRAAN() const
计算升交点赤经
定义 OrbitElement.hpp:192
double getTimePastAscNode(double gm) const
计算过升交点后经过的时间
定义 OrbitElement.hpp:219
double getPeriAlt(double bodyRadius) const
计算近拱点高度
定义 OrbitElement.hpp:183
double getP() const
计算半通径
定义 OrbitElement.hpp:238
double getPeriod(double gm) const
计算周期
定义 OrbitElement.hpp:171
double e_
偏心率
定义 OrbitElement.hpp:158
double getApoRad() const
计算远拱点半径
定义 OrbitElement.hpp:174
double argper_
近拱点角
定义 OrbitElement.hpp:161
double getTimePastPeri(double gm) const
计算过近地点后经过的时间
定义 OrbitElement.hpp:216
double getMeanAnomaly() const
计算平近点角
定义 OrbitElement.hpp:201
double getPeriRad() const
计算近拱点半径
定义 OrbitElement.hpp:180
double getApoAlt(double bodyRadius) const
计算远拱点高度
定义 OrbitElement.hpp:177
double raan_
升交点赤经
定义 OrbitElement.hpp:160
double getEcc() const
计算偏心率
定义 OrbitElement.hpp:186
double getArgPeri() const
计算近拱点幅角
定义 OrbitElement.hpp:195
double getInc() const
计算轨道倾角
定义 OrbitElement.hpp:189
double i_
轨道倾角
定义 OrbitElement.hpp:159
TimePoint getTimeOfAscNodePassage(const TimePoint &stateEpoch, double gm) const
计算过升交点时刻
定义 OrbitElement.hpp:222
double getTrueAnomaly() const
计算真近点角
定义 OrbitElement.hpp:198
经典轨道根数
定义 OrbitElement.hpp:111
double a_
长半轴
定义 OrbitElement.hpp:114
double argper_
近拱点角
定义 OrbitElement.hpp:118
double trueA_
真近点角
定义 OrbitElement.hpp:119
double raan_
升交点赤经
定义 OrbitElement.hpp:117
double i_
轨道倾角
定义 OrbitElement.hpp:116
double getMeanMotion(double gm) const
计算平均角速度变化率
定义 OrbitElement.hpp:122
double e_
偏心率
定义 OrbitElement.hpp:115
球坐标轨道根数
定义 OrbitElement.hpp:386
double getFltPathAzi() const
获取航迹方位角
定义 OrbitElement.hpp:409
double v_
速度大小 [m/s]
定义 OrbitElement.hpp:394
double azi_
航迹方位角 [rad]
定义 OrbitElement.hpp:393
double dec_
赤纬 [rad]
定义 OrbitElement.hpp:390
double getFltPathAng() const
获取飞行航迹角(水平飞行航迹角)
定义 OrbitElement.hpp:406
double r_
地心距 [m]
定义 OrbitElement.hpp:391
double getRadius() const
获取地心距
定义 OrbitElement.hpp:403
double getRA() const
获取赤经
定义 OrbitElement.hpp:397
double ra_
赤经 [rad]
定义 OrbitElement.hpp:389
double getVel() const
获取速度大小
定义 OrbitElement.hpp:412
double getDec() const
获取赤纬
定义 OrbitElement.hpp:400
double fpa_
航迹角 [rad]
定义 OrbitElement.hpp:392
绝对时间点
定义 TimePoint.hpp:108
double aPeriRadToApoRad(double perigeeRad, double eccentricity)
近地点半径转换为远地点半径
定义 OrbitParam.cpp:316
double aPeriRadToMeanMotion(double perigeeRad, double eccentricity, double gm)
近地点半径转换为平均角速度
定义 OrbitParam.cpp:321
double aRAANToLAN(double raan, Axes *inertialAxes, const TimePoint &timeOfAscNodePassage, Axes *bodyFixedAxes)
升交点赤经转换为升交点经度
定义 OrbitParam.cpp:505
double aSMAToMeanMotion(double semiMajorAxis, double gm)
长半轴转换为平均角速度
定义 OrbitParam.cpp:384
double aTrueToMean(double trueAnomaly, double eccentricity)
真近点角转换为平近点角
定义 OrbitParam.cpp:487
A_ALWAYS_INLINE double aArgPeriToLongPeri(double argPeri, double raan)
近地点幅角转换为近地点经度
定义 OrbitParam.hpp:593
double aTrueToTimePastAscNode(double trueAnomaly, double argPeri, double semiMajorAxis, double eccentricity, double gm)
真近点角转换为过升交点后时间
定义 OrbitParam.cpp:492
errc_t aCartToModOrbElem(const Vector3d &pos, const Vector3d &vel, double gm, ModOrbElem &modOrb)
直角坐标转换为修正轨道根数(类引用版本)
定义 OrbitElement.cpp:1071
double aTrueToEcc(double f, double e)
真近点角转换为偏近点角
定义 OrbitParam.cpp:457
double aTrueToArgLat(double trueAnomaly, double argPeri)
真近点角转换为纬度幅角
定义 OrbitParam.hpp:653
EBPlaneRefVector
B平面参考向量类型
定义 OrbitElement.hpp:957
double aTrueToTimePastPeri(double trueAnomaly, double semiMajorAxis, double eccentricity, double gm)
真近点角转换为过近心点后时间
定义 OrbitParam.cpp:497
double aPeriRadToApoAlt(double perigeeRad, double eccentricity, double bodyRadius)
近地点半径转换为远地点高度
定义 OrbitParam.cpp:312
@ eBodyOrbitNormal
天体绕其父天体运动的轨道法向
@ eSpacecraftOrbitNormal
航天器自身的轨道法向
constexpr double kTwoPI
2*PI
定义 Constants.hpp:55
constexpr double kHalfPI
0.5*kAsPI
定义 Constants.hpp:57