From 219b70ee2c814d85d4956b201a6e51d24b0521ab Mon Sep 17 00:00:00 2001 From: Daniel Warner Date: Fri, 1 Apr 2011 15:01:38 +0100 Subject: [PATCH] Added fmod 2PI for calculation of d_xlamo_ --- SGDP4.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SGDP4.cpp b/SGDP4.cpp index 68c374a..d0c0316 100644 --- a/SGDP4.cpp +++ b/SGDP4.cpp @@ -810,7 +810,7 @@ void SGDP4::DeepSpaceInitialize(const double& eosq, const double& sinio, const d d_fasx4_ = 2.8843198; d_fasx6_ = 0.37448087; - d_xlamo_ = MeanAnomoly() + AscendingNode() + ArgumentPerigee() - i_gsto_; + d_xlamo_ = fmod(MeanAnomoly() + AscendingNode() + ArgumentPerigee() - i_gsto_, Globals::TWOPI()); bfact = xmdot + xpidot - THDT; bfact += d_ssl_ + d_ssg_ + d_ssh_; @@ -907,7 +907,7 @@ void SGDP4::DeepSpaceInitialize(const double& eosq, const double& sinio, const d d_d5421_ = temp * f542 * g521; d_d5433_ = temp * f543 * g533; - d_xlamo_ = MeanAnomoly() + AscendingNode() + AscendingNode() - i_gsto_ - i_gsto_; + d_xlamo_ = fmod(MeanAnomoly() + AscendingNode() + AscendingNode() - i_gsto_ - i_gsto_, Globals::TWOPI()); bfact = xmdot + xnodot + xnodot - THDT - THDT; bfact = bfact + d_ssl_ + d_ssh_ + d_ssh_; }