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);
272
272
u16 gps_adjust_week_cycle (u16 wn_raw , u16 wn_ref );
273
273
u16 gps_adjust_week_cycle256 (u16 wn_raw , u16 wn_ref );
274
274
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
- */
281
275
double 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
- */
289
276
double 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
- */
297
277
gps_time_t decimal_years_to_gps_time (const double years );
298
278
299
279
static 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) {
507
507
return wn_raw + 256 * ((wn_ref + 255 - wn_raw ) / 256 );
508
508
}
509
509
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
+ */
510
516
double decimal_year_to_mjd (const double epoch_years ) {
511
517
const double integer_year = floor (epoch_years );
512
518
const double fractional_year = epoch_years - integer_year ;
@@ -519,6 +525,12 @@ double decimal_year_to_mjd(const double epoch_years) {
519
525
return epoch_mjd ;
520
526
}
521
527
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
+ */
522
534
double gps_time_to_decimal_years (const gps_time_t * time ) {
523
535
utc_tm utc ;
524
536
make_utc_tm (time , & utc );
@@ -531,6 +543,12 @@ double gps_time_to_decimal_years(const gps_time_t *time) {
531
543
return (double )utc .year + (double )utc .year_day / days_in_year ;
532
544
}
533
545
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
+ */
534
552
gps_time_t decimal_years_to_gps_time (const double years ) {
535
553
const double mjd = decimal_year_to_mjd (years );
536
554
return mjd2gps (mjd );
You can’t perform that action at this time.
0 commit comments