Removed unnecessary pow

feature/19
Daniel Warner 2011-12-24 14:55:21 +00:00
parent 84bbd5fa54
commit 773e340770
2 changed files with 6 additions and 4 deletions

View File

@ -231,10 +231,12 @@ double Julian::ToGreenwichSiderealTime() const
// (since J2000 which is 2451545.0)
// a Julian century is 36525 days
const double tut1 = (date_ - 2451545.0) / 36525.0;
const double tut2 = tut1 * tut1;
const double tut3 = tut2 * tut1;
// Rotation angle in arcseconds
double theta = 67310.54841 + (876600.0 * 3600.0 + 8640184.812866) * tut1
+ 0.093104 * pow(tut1, 2.0) - 0.0000062 * pow(tut1, 3.0);
+ 0.093104 * tut2 - 0.0000062 * tut3;
// 360.0 / 86400.0 = 1.0 / 240.0
theta = Util::WrapTwoPI(Util::DegreesToRadians(theta / 240.0));

View File

@ -99,7 +99,7 @@ void SGP4::Initialise()
common_consts_.x3thm1 * (8.0 + 3.0 * etasq *
(8.0 + etasq)));
common_consts_.c1 = elements_.BStar() * c2;
common_consts_.a3ovk2 = -kXJ3 / kCK2 * pow(kAE, 3.0);
common_consts_.a3ovk2 = -kXJ3 / kCK2 * kAE * kAE * kAE;
common_consts_.x1mth2 = 1.0 - theta2;
common_consts_.c4 = 2.0 * elements_.RecoveredMeanMotion() * coef1 * elements_.RecoveredSemiMajorAxis() * betao2 *
(common_consts_.eta * (2.0 + 0.5 * etasq) + elements_.Eccentricity() * (0.5 + 2.0 * etasq) -
@ -239,7 +239,7 @@ Eci SGP4::FindPositionSDP4(double tsince) const
throw SatelliteException("Error: #2 (xn <= 0.0)");
}
a = pow(kXKE / xn, kTWOTHIRD) * pow(tempa, 2.0);
a = pow(kXKE / xn, kTWOTHIRD) * tempa * tempa;
e -= tempe;
double xmam = xmdf + elements_.RecoveredMeanMotion() * templ;
@ -360,7 +360,7 @@ Eci SGP4::FindPositionSGP4(double tsince) const
templ += nearspace_consts_.t3cof * tcube + tfour * (nearspace_consts_.t4cof + tsince * nearspace_consts_.t5cof);
}
a = elements_.RecoveredSemiMajorAxis() * pow(tempa, 2.0);
a = elements_.RecoveredSemiMajorAxis() * tempa * tempa;
e = elements_.Eccentricity() - tempe;
xl = xmp + omega + xnode + elements_.RecoveredMeanMotion() * templ;