Added ecc and incl error check in init code
parent
32647bc067
commit
7eb83ea9e9
11
SGDP4.cpp
11
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
|
||||
|
|
Loading…
Reference in New Issue