From dcb4469507065cdd5dbbcaa670772301a31f3a54 Mon Sep 17 00:00:00 2001 From: Daniel Warner Date: Fri, 22 Apr 2011 12:33:24 +0100 Subject: [PATCH] Made SGP4 getter methods public and added OrbitNumber() --- SGP4.cpp | 3 + SGP4.h | 167 ++++++++++++++++++++++++++++--------------------------- 2 files changed, 89 insertions(+), 81 deletions(-) diff --git a/SGP4.cpp b/SGP4.cpp index 36f9530..552f397 100644 --- a/SGP4.cpp +++ b/SGP4.cpp @@ -67,6 +67,7 @@ void SGP4::SetTle(const Tle& tle) { mean_motion_ = tle.MeanMotion() * TWOPI / Globals::MIN_PER_DAY(); bstar_ = tle.BStar(); epoch_ = tle.Epoch(); + orbit_number_ = tle.OrbitNumber(); /* * error checks @@ -1287,4 +1288,6 @@ void SGP4::ResetGlobalVariables() { recovered_mean_motion_ = perigee_ = period_ = 0.0; epoch_ = Julian(); + + orbit_number_ = 0; } \ No newline at end of file diff --git a/SGP4.h b/SGP4.h index f14d89b..4a93419 100644 --- a/SGP4.h +++ b/SGP4.h @@ -13,6 +13,91 @@ public: void FindPosition(Eci& eci, double tsince) const; void FindPosition(Eci& eci, const Julian& date) const; + /* + * XMO + */ + double MeanAnomoly() const { + return mean_anomoly_; + } + + /* + * XNODEO + */ + double AscendingNode() const { + return ascending_node_; + } + + /* + * OMEGAO + */ + double ArgumentPerigee() const { + return argument_perigee_; + } + + /* + * EO + */ + double Eccentricity() const { + return eccentricity_; + } + + /* + * XINCL + */ + double Inclination() const { + return inclination_; + } + + /* + * XNO + */ + double MeanMotion() const { + return mean_motion_; + } + + /* + * BSTAR + */ + double BStar() const { + return bstar_; + } + + /* + * AODP + */ + double RecoveredSemiMajorAxis() const { + return recovered_semi_major_axis_; + } + + /* + * XNODP + */ + double RecoveredMeanMotion() const { + return recovered_mean_motion_; + } + + /* + * PERIGE + */ + double Perigee() const { + return perigee_; + } + + double Period() const { + return period_; + } + + /* + * EPOCH + */ + Julian Epoch() const { + return epoch_; + } + + unsigned int OrbitNumber() const { + return orbit_number_; + } + private: void Initialize(const double& theta2, const double& betao2, const double& betao, const double& eosq); void DeepSpaceInitialize(const double& eosq, const double& sinio, const double& cosio, const double& betao, @@ -166,87 +251,6 @@ private: mutable double d_xnddt_t_; mutable double d_xldot_t_; - /* - * XMO - */ - double MeanAnomoly() const { - return mean_anomoly_; - } - - /* - * XNODEO - */ - double AscendingNode() const { - return ascending_node_; - } - - /* - * OMEGAO - */ - double ArgumentPerigee() const { - return argument_perigee_; - } - - /* - * EO - */ - double Eccentricity() const { - return eccentricity_; - } - - /* - * XINCL - */ - double Inclination() const { - return inclination_; - } - - /* - * XNO - */ - double MeanMotion() const { - return mean_motion_; - } - - /* - * BSTAR - */ - double BStar() const { - return bstar_; - } - - /* - * AODP - */ - double RecoveredSemiMajorAxis() const { - return recovered_semi_major_axis_; - } - - /* - * XNODP - */ - double RecoveredMeanMotion() const { - return recovered_mean_motion_; - } - - /* - * PERIGE - */ - double Perigee() const { - return perigee_; - } - - double Period() const { - return period_; - } - - /* - * EPOCH - */ - Julian Epoch() const { - return epoch_; - } - /* * these variables are set at the very start * and should not be changed after that @@ -263,6 +267,7 @@ private: double perigee_; double period_; Julian epoch_; + unsigned int orbit_number_; }; #endif