Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 6ef7224569ba
Choose a base ref
...
head repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 16e6105d38c4
Choose a head ref
  • 2 commits
  • 1 file changed
  • 1 contributor

Commits on Dec 11, 2020

  1. Copy the full SHA
    19e633d View commit details
  2. Merge pull request #2817 from eggrobin/negative-periods

    Negative sidereal periods are out of range
    eggrobin authored Dec 11, 2020
    Copy the full SHA
    16e6105 View commit details
Showing with 4 additions and 2 deletions.
  1. +4 −2 astronomy/orbital_elements_body.hpp
6 changes: 4 additions & 2 deletions astronomy/orbital_elements_body.hpp
Original file line number Diff line number Diff line change
@@ -48,8 +48,10 @@ StatusOr<OrbitalElements> OrbitalElements::ForTrajectory(
SiderealPeriod(orbital_elements.osculating_equinoctial_elements_);
RETURN_IF_ERROR(sidereal_period);
orbital_elements.sidereal_period_ = sidereal_period.ValueOrDie();
if (!IsFinite(orbital_elements.sidereal_period_)) {
// Guard against NaN sidereal periods (from hyperbolic orbits).
if (!IsFinite(orbital_elements.sidereal_period_) ||
orbital_elements.sidereal_period_ <= Time{}) {
// Guard against NaN sidereal periods (from hyperbolic orbits) or negative
// sidereal periods (from aberrant trajectories, see #2811).
return Status(
Error::OUT_OF_RANGE,
"sidereal period is " + DebugString(orbital_elements.sidereal_period_));