FACT++  1.0
int eraTttcg ( double  tt1,
double  tt2,
double *  tcg1,
double *  tcg2 
)

Definition at line 3 of file tttcg.c.

References ERFA_DAYSEC, ERFA_DJM0, ERFA_DJM77, ERFA_ELG, and ERFA_TTMTAI.

Referenced by t_tttcg().

38 {
39 
40 /* 1977 Jan 1 00:00:32.184 TT, as MJD */
41  static const double t77t = ERFA_DJM77 + ERFA_TTMTAI/ERFA_DAYSEC;
42 
43 /* TT to TCG rate */
44  static const double elgg = ERFA_ELG/(1.0-ERFA_ELG);
45 
46 /* Result, safeguarding precision. */
47  if ( tt1 > tt2 ) {
48  *tcg1 = tt1;
49  *tcg2 = tt2 + ( ( tt1 - ERFA_DJM0 ) + ( tt2 - t77t ) ) * elgg;
50  } else {
51  *tcg1 = tt1 + ( ( tt2 - ERFA_DJM0 ) + ( tt1 - t77t ) ) * elgg;
52  *tcg2 = tt2;
53  }
54 
55 /* Status (always OK). */
56  return 0;
57 
58 }
#define ERFA_DJM0
Definition: erfam.h:90
#define ERFA_DJM77
Definition: erfam.h:96
#define ERFA_DAYSEC
Definition: erfam.h:75
#define ERFA_ELG
Definition: erfam.h:114
#define ERFA_TTMTAI
Definition: erfam.h:99

+ Here is the caller graph for this function: