-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Legible instants #3034
Legible instants #3034
Conversation
@@ -12,18 +12,19 @@ | |||
#include "geometry/named_quantities.hpp" | |||
#include "glog/logging.h" | |||
#include "quantities/si.hpp" | |||
#include "numerics/double_precision.hpp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alphabetize.
astronomy/time_scales_body.hpp
Outdated
auto const date = TTDay(t); | ||
Instant const beginning_of_day = DateTimeAsTT(DateTime::BeginningOfDay(date)); | ||
// Close to J2000, Sterbenz’s lemma can fail to apply to this subtraction. We | ||
// compute it exactly and round by hand. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an unfortunate property. I wish we had taken, e.g., the origin of MJD as our zero. (Nobody flies rockets in 1858.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JD0 would be the standard approach if the origin is really annoying, but I don’t think this really is a problem except for this kind of correct rounding or round-tripping trickery, and having the origin in the middle of the timespan we care about means we have better resolution, which seems like it should be more broadly useful.
This will be used in
operator<<(std::ostream&, Instant)
in a future PR.