diff --git a/SGDP4.cpp b/SGDP4.cpp index fded8ba..c542b40 100644 --- a/SGDP4.cpp +++ b/SGDP4.cpp @@ -68,6 +68,17 @@ void SGDP4::SetTle(const Tle& tle) { bstar_ = tle.GetField(Tle::FLD_BSTAR); epoch_ = tle.GetEpoch(); + /* + * error checks + */ + if (eccentricity_ < 0.0 || eccentricity_ > 1.0 - 1.0e-3) { + throw new SatelliteException("Eccentricity out of range"); + } + + if (inclination_ < 0.0 || eccentricity_ > Globals::PI()) { + throw new SatelliteException("Inclination out of range"); + } + /* * recover original mean motion (xnodp) and semimajor axis (aodp) * from input elements