From cbb1f894cf23e3d686243efdce7c48bc027fc694 Mon Sep 17 00:00:00 2001 From: Daniel Warner Date: Sun, 3 Apr 2011 12:41:05 +0100 Subject: [PATCH] Moved sing/cosg from common init to deep space init --- SGDP4.cpp | 6 +++--- SGDP4.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/SGDP4.cpp b/SGDP4.cpp index 77d12c8..314acbd 100644 --- a/SGDP4.cpp +++ b/SGDP4.cpp @@ -174,12 +174,10 @@ void SGDP4::Initialize(const double& theta2, const double& betao2, const double& if (i_use_deep_space_) { - const double sing = sin(ArgumentPerigee()); - const double cosg = cos(ArgumentPerigee()); d_gsto_ = Epoch().ToGreenwichSiderealTime(); DeepSpaceInitialize(eosq, i_sinio_, i_cosio_, betao, - theta2, sing, cosg, betao2, + theta2, betao2, i_xmdot_, i_omgdot_, i_xnodot_); } else { @@ -606,6 +604,8 @@ void SGDP4::DeepSpaceInitialize(const double& eosq, const double& sinio, const d const double xpidot = omgdot + xnodot; const double sinq = sin(AscendingNode()); const double cosq = cos(AscendingNode()); + const double sing = sin(ArgumentPerigee()); + const double cosg = cos(ArgumentPerigee()); /* * initialize lunar / solar terms diff --git a/SGDP4.h b/SGDP4.h index f6b7417..ce323a0 100644 --- a/SGDP4.h +++ b/SGDP4.h @@ -15,7 +15,7 @@ public: 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, - const double& theta2, const double& sing, const double& cosg, const double& betao2, + const double& theta2, const double& betao2, const double& xmdot, const double& omgdot, const double& xnodot); void DeepSpaceCalculateLunarSolarTerms(const double t, double& pe, double& pinc, double& pl, double& pgh, double& ph) const;