1 /*
2 * - - - - - - - - - - -
3 * g a l _ m t c 2 t t
4 * - - - - - - - - - - -
5 *
6 * This routine is part of the General Astrodynamics Library
7 *
8 * Description:
9 *
10 * This routine converts a Mars Coordinated Time (MTC) date
11 * to a TT jd 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 * mtc1 d MTC date part 1
21 * mtc2 d MTC date part 2
22 *
23 * Returned:
24 *
25 * *tt1 d TT date part 1
26 * *tt2 d TT date part 2
27 *
28 * Notes:
29 *
30 * 1) As defined, consistent with the terrestrial convention for Mean
31 * Solar Time, JD 2451549.5 (2000 January 6 00:00:00) corresponds to
32 * a near coincidence of the terrestrial Greenwich mean solar
33 * midnight and the Martian mean solar (prime meridian) midnight. The
34 * addition of the integer number 44796 assures a positive result
35 * for any date since JD 2405522 (1873 December 29.5).
36 *
37 * References:
38 *
39 * A post-Pathfinder evaluation of areocentric solar coordinates with
40 * improved timing recipes for Mars seasonal/diurnal climate studies
41 * by Michael Allison, Megan McEwen,
42 * Planetary and Space Science 48 (2000) 215-235
43 *
44 * Mars24 URL: http://www.giss.nasa.gov/tools/mars24/help/algorithm.html
45 * The referenced URL contains corrections to the referenced article.
46 *
47 * This revision:
48 *
49 * 2009 January 5
50 *
51 * Copyright (C) 2009 Paul C. L. Willmott. See notes at end.
52 *
53 *-----------------------------------------------------------------------
54 */
55
56 #include <math.h>
57 #include "gal_mtc2tt.h"
58
59 void
gal_mtc2tt(double mtc1,double mtc2,double * tt1,double * tt2)60 gal_mtc2tt
61 (
62 double mtc1,
63 double mtc2,
64 double *tt1,
65 double *tt2
66 )
67
68 {
69
70 double tt ;
71
72 /*
73 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
74 */
75
76 tt = ( mtc1 + mtc2 + 0.00096 - 44796.0 ) * 1.027491252 + 2451549.5 ;
77 *tt1 = floor ( tt ) ;
78 *tt2 = tt - *tt1 ;
79
80 /*
81 * Finished.
82 */
83
84 }
85
86 /*
87 * gal - General Astrodynamics Library
88 * Copyright (C) 2009 Paul C. L. Willmott
89 *
90 * This program is free software; you can redistribute it and/or modify
91 * it under the terms of the GNU General Public License as published by
92 * the Free Software Foundation; either version 2 of the License, or
93 * (at your option) any later version.
94 *
95 * This program is distributed in the hope that it will be useful,
96 * but WITHOUT ANY WARRANTY; without even the implied warranty of
97 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
98 * GNU General Public License for more details.
99 *
100 * You should have received a copy of the GNU General Public License along
101 * with this program; if not, write to the Free Software Foundation, Inc.,
102 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
103 *
104 * Contact:
105 *
106 * Paul Willmott
107 * vp9mu@amsat.org
108 */
109
110