utils/SSEphem/astrtime.cc
int utc2tdb (long mjd, double utc, long &tdb_mjd, double &tdb)
{
    long tt_mjd;             // Terrestrial coordinate time MJD
    double tt;               // Terrestrial coordinate time
    if (!utc2tt (mjd, utc, tt_mjd, tt)) {
        return 0;
    }
    long ut1_mjd;            // actual earth rotation time MJD
    double ut1;              // actual earth rotation time
    utc2ut1 (mjd, utc, ut1_mjd, ut1);
    
    double obs_long = get_observatory_longitude();
    double obs_r = get_observatory_radius() / 1000.0;
    double obs_z = get_observatory_z() / 1000.0;
    tdb = tt + iauDtdb(2400000.5, (double)tt_mjd + tt, ut1, obs_long,
		       obs_r, obs_z) / 86400.0;
    tdb_mjd = tt_mjd;
    if (tdb > 1.0) {
        tdb -= 1.0;
        tdb_mjd++;
    }
    if (tdb < 0.0) {
        tdb += 1.0;
        tdb_mjd--;
    }
    return 1;
}
// Barycentric Dynamic Time (TDB) is the same as as Terrestrial Dynamic Time
// (TT) except for relativistic corrections to move the origin to the solar
// system barycenter.  These corrections amount to as much as about 1.6
// millisends and are periodic with an average of zero over many years.  The
// dominant terms in this correction are have annula and semi-annual
// periods, as given by the equation in the Astronomical almanac.  This
// routine uses a more accurate calculation implemented in the Starlink
// library, which claims an accuracy of a few nanoseconds.
// The input parameters are mjd and utc (in fraction of a day), and the
// output arguments are tdb_mjd and tdb (in fraction of a day).  The return
// values is 1, if successful, or 0, if not.
Barycentric Dynamic Time (TDB) is the same as as Terrestrial Dynamic Time
(TT) except for relativistic corrections to move the origin to the solar
system barycenter.  These corrections amount to as much as about 1.6
millisends and are periodic with an average of zero over many years.  The
dominant terms in this correction are have annula and semi-annual
periods, as given by the equation in the Astronomical almanac.  This
routine uses a more accurate calculation implemented in the Starlink
library, which claims an accuracy of a few nanoseconds.
The input parameters are mjd and utc (in fraction of a day), and the
output arguments are tdb_mjd and tdb (in fraction of a day).  The return
values is 1, if successful, or 0, if not.
Barycentric Dynamic Time ( TDB ) is the same as as Terrestrial Dynamic Time ( TT ) except for relativistic corrections to move the origin to the solar system barycenter . These corrections amount to as much as about 1 . 6 millisends and are periodic with an average of zero over many years . The dominant terms in this correction are have annula and semi - annual periods as given by the equation in the Astronomical almanac . This routine uses a more accurate calculation implemented in the Starlink library which claims an accuracy of a few nanoseconds . The input parameters are mjd and utc ( in fraction of a day ) and the output arguments are tdb_mjd and tdb ( in fraction of a day ) . The return values is 1 if successful or 0 if not .
int utc2tdb (long mjd, double utc, long &tdb_mjd, double &tdb)
{
    long tt_mjd;             
    double tt;               
    if (!utc2tt (mjd, utc, tt_mjd, tt)) {
        return 0;
    }
    long ut1_mjd;            
    double ut1;              
    utc2ut1 (mjd, utc, ut1_mjd, ut1);
    double obs_long = get_observatory_longitude();
    double obs_r = get_observatory_radius() / 1000.0;
    double obs_z = get_observatory_z() / 1000.0;
    tdb = tt + iauDtdb(2400000.5, (double)tt_mjd + tt, ut1, obs_long,
		       obs_r, obs_z) / 86400.0;
    tdb_mjd = tt_mjd;
    if (tdb > 1.0) {
        tdb -= 1.0;
        tdb_mjd++;
    }
    if (tdb < 0.0) {
        tdb += 1.0;
        tdb_mjd--;
    }
    return 1;
}
int utc2tdb ( long mjd , double utc , long & tdb_mjd , double & tdb ) { long tt_mjd ; double tt ; if ( ! utc2tt ( mjd , utc , tt_mjd , tt ) ) { return 0 ; } long ut1_mjd ; double ut1 ; utc2ut1 ( mjd , utc , ut1_mjd , ut1 ) ; double obs_long = get_observatory_longitude ( ) ; double obs_r = get_observatory_radius ( ) / 1000.0 ; double obs_z = get_observatory_z ( ) / 1000.0 ; tdb = tt + iauDtdb ( 2400000.5 , ( double ) tt_mjd + tt , ut1 , obs_long , obs_r , obs_z ) / 86400.0 ; tdb_mjd = tt_mjd ; if ( tdb > 1.0 ) { tdb -= 1.0 ; tdb_mjd ++ ; } if ( tdb < 0.0 ) { tdb += 1.0 ; tdb_mjd -- ; } return 1 ; }
Barycentric Dynamic Time (TDB) is the same as as Terrestrial Dynamic Time
(TT) except for relativistic corrections to move the origin to the solar
system barycenter.
Barycentric Dynamic Time ( TDB ) is the same as as Terrestrial Dynamic Time ( TT ) except for relativistic corrections to move the origin to the solar system barycenter .
// Terrestrial coordinate time MJD // Terrestrial coordinate time // actual earth rotation time MJD // actual earth rotation time