File tree Expand file tree Collapse file tree 2 files changed +18
-20
lines changed
Expand file tree Collapse file tree 2 files changed +18
-20
lines changed Original file line number Diff line number Diff line change @@ -272,28 +272,8 @@ void gps_time_match_weeks(gps_time_t *t, const gps_time_t *ref);
272272u16 gps_adjust_week_cycle (u16 wn_raw , u16 wn_ref );
273273u16 gps_adjust_week_cycle256 (u16 wn_raw , u16 wn_ref );
274274
275- /**
276- * @brief Converts a decimal year to a MJD (modified Julian date).
277- *
278- * @param epoch_years The epoch in decimal years representation.
279- * @return The epoch in MJD representation.
280- */
281275double decimal_year_to_mjd (const double epoch_years );
282-
283- /**
284- * @brief Converts a GPS time to a decimal year.
285- *
286- * @param gps_time The GPS epoch to convert.
287- * @return The epoch in decimal years representation.
288- */
289276double gps_time_to_decimal_years (const gps_time_t * time );
290-
291- /**
292- * @brief Converts a epoch represented as a decimal year to a GPS time.
293- *
294- * @param years The epoch in decimal years representation.
295- * @return The epoch in GPS time representation.
296- */
297277gps_time_t decimal_years_to_gps_time (const double years );
298278
299279static inline bool is_leap_year (s32 year ) {
Original file line number Diff line number Diff line change @@ -507,6 +507,12 @@ u16 gps_adjust_week_cycle256(u16 wn_raw, u16 wn_ref) {
507507 return wn_raw + 256 * ((wn_ref + 255 - wn_raw ) / 256 );
508508}
509509
510+ /**
511+ * Converts a decimal year to a MJD (modified Julian date).
512+ *
513+ * \param epoch_years The epoch in decimal years representation.
514+ * \return The epoch in MJD representation.
515+ */
510516double decimal_year_to_mjd (const double epoch_years ) {
511517 const double integer_year = floor (epoch_years );
512518 const double fractional_year = epoch_years - integer_year ;
@@ -519,6 +525,12 @@ double decimal_year_to_mjd(const double epoch_years) {
519525 return epoch_mjd ;
520526}
521527
528+ /**
529+ * Converts a GPS time to a decimal year.
530+ *
531+ * \param gps_time The GPS epoch to convert.
532+ * \return The epoch in decimal years representation.
533+ */
522534double gps_time_to_decimal_years (const gps_time_t * time ) {
523535 utc_tm utc ;
524536 make_utc_tm (time , & utc );
@@ -531,6 +543,12 @@ double gps_time_to_decimal_years(const gps_time_t *time) {
531543 return (double )utc .year + (double )utc .year_day / days_in_year ;
532544}
533545
546+ /**
547+ * Converts a epoch represented as a decimal year to a GPS time.
548+ *
549+ * \param years The epoch in decimal years representation.
550+ * \return The epoch in GPS time representation.
551+ */
534552gps_time_t decimal_years_to_gps_time (const double years ) {
535553 const double mjd = decimal_year_to_mjd (years );
536554 return mjd2gps (mjd );
You can’t perform that action at this time.
0 commit comments