1 /*
2  *  - - - - - - - - - - -
3  *   g a l _ t t 2 m t c
4  *  - - - - - - - - - - -
5  *
6  *  This routine is part of the General Astrodynamics Library
7  *
8  *  Description:
9  *
10  *     This routine converts a TT jd date to a Mars Coordinated
11  *     Time (MTC) date. Mars Coordinated Time is the Mean Solar
12  *     Time on the Mars prime meridian.
13  *
14  *  Status:
15  *
16  *     support routine.
17  *
18  *  Given:
19  *
20  *     tt1                 d        TT date part 1 ( see Note 1 )
21  *     tt2                 d        TT date part 2 ( see Note 1 )
22  *
23  *  Returned:
24  *
25  *     *mtc1               d        MTC date part 1 ( see Note 2 )
26  *     *mtc2               d        MTC date part 2 ( see Note 2 )
27  *
28  *  Notes:
29  *
30  *  1) The Julian Date is apportioned in any convenient way between
31  *     the arguments tai1 and tai2.  For example, JD=2450123.7 could
32  *     be expressed in any of these ways, among others:
33  *
34  *               tt1          tt2
35  *
36  *         2450123.7          0.0   (JD method)
37  *         2451545.0      -1421.3   (J2000 method)
38  *         2400000.5      50123.2   (MJD method)
39  *         2450123.5          0.2   (date & time method)
40  *
41  *  2) mtc1 contains the sol number, and mtc2 the fractional part of the
42  *     sol. A Mars "day" is called a "sol".
43  *
44  *  3) As defined, consistent with the terrestrial convention for Mean
45  *     Solar Time, JD 2451549.5 (2000 January 6 00:00:00) corresponds to
46  *     a near coincidence of the terrestrial Greenwich mean solar
47  *     midnight and the Martian mean solar (prime meridian) midnight. The
48  *     addition of the integer number 44796 assures a positive result
49  *     for any date since JD 2405522 (1873 December 29.5).
50  *
51  *  References:
52  *
53  *     A post-Pathfinder evaluation of areocentric solar coordinates with
54  *     improved timing recipes for Mars seasonal/diurnal climate studies
55  *     by Michael Allison, Megan McEwen,
56  *     Planetary and Space Science 48 (2000) 215-235
57  *
58  *     Mars24 URL: http://www.giss.nasa.gov/tools/mars24/help/algorithm.html
59  *     The referenced URL contains corrections to the referenced article.
60  *
61  *  This revision:
62  *
63  *     2009 January 5
64  *
65  *  Copyright (C) 2009 Paul C. L. Willmott. See notes at end.
66  *
67  *-----------------------------------------------------------------------
68  */
69 
70 #ifndef _GAL_TT2MTC_H_
71 #define _GAL_TT2MTC_H_ 1
72 
73 #undef __BEGIN_DECLS
74 #undef __END_DECLS
75 #ifdef __cplusplus
76 #define __BEGIN_DECLS extern "C" {
77 #define __END_DECLS }
78 #else
79 #define __BEGIN_DECLS /* empty */
80 #define __END_DECLS   /* empty */
81 #endif
82 
83 __BEGIN_DECLS
84 
85 void
86 gal_tt2mtc
87  (
88     double tt1,
89     double tt2,
90     double *mtc1,
91     double *mtc2
92  ) ;
93 
94 __END_DECLS
95 
96 #endif /* !_GAL_TT2MTC_H_ */
97 
98 /*
99  *  gal - General Astrodynamics Library
100  *  Copyright (C) 2009 Paul C. L. Willmott
101  *
102  *  This program is free software; you can redistribute it and/or modify
103  *  it under the terms of the GNU General Public License as published by
104  *  the Free Software Foundation; either version 2 of the License, or
105  *  (at your option) any later version.
106  *
107  *  This program is distributed in the hope that it will be useful,
108  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
109  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
110  *  GNU General Public License for more details.
111  *
112  *  You should have received a copy of the GNU General Public License along
113  *  with this program; if not, write to the Free Software Foundation, Inc.,
114  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
115  *
116  *  Contact:
117  *
118  *  Paul Willmott
119  *  vp9mu@amsat.org
120  */
121