source: trunk/MagicSoft/slalib/gmst.c@ 3152

Last change on this file since 3152 was 731, checked in by tbretz, 24 years ago
*** empty log message ***
  • Property svn:executable set to *
File size: 1.6 KB
Line 
1#include "slalib.h"
2#include "slamac.h"
3double slaGmst ( double ut1 )
4/*
5** - - - - - - - -
6** s l a G m s t
7** - - - - - - - -
8**
9** Conversion from Universal Time to Sidereal Time.
10**
11** (double precision)
12**
13** Given:
14** ut1 double Universal Time (strictly UT1) expressed as
15** Modified Julian Date (JD-2400000.5)
16**
17** The result is the Greenwich Mean Sidereal Time (double
18** precision, radians).
19**
20** The IAU 1982 expression (see page S15 of the 1984 Astronomical
21** Almanac) is used, but rearranged to reduce rounding errors.
22** This expression is always described as giving the GMST at
23** 0 hours UT. In fact, it gives the difference between the
24** GMST and the UT, which happens to equal the GMST (modulo
25** 24 hours) at 0 hours UT each day. In this routine, the
26** entire UT is used directly as the argument for the
27** standard formula, and the fractional part of the UT is
28** added separately; note that the factor 1.0027379... does
29** not appear.
30**
31** See also the routine slaGmsta, which delivers better numerical
32** precision by accepting the UT date and time as separate arguments.
33**
34** Called: slaDranrm
35**
36** Defined in slamac.h: D2PI, DS2R, dmod
37**
38** Last revision: 19 March 1996
39**
40** Copyright P.T.Wallace. All rights reserved.
41*/
42{
43 double tu;
44
45/* Julian centuries from fundamental epoch J2000 to this UT */
46 tu = ( ut1 - 51544.5 ) / 36525.0;
47
48/* GMST at this UT */
49 return slaDranrm ( dmod ( ut1, 1.0 ) * D2PI +
50 ( 24110.54841 +
51 ( 8640184.812866 +
52 ( 0.093104 - 6.2e-6 * tu ) * tu ) * tu ) * DS2R );
53}
Note: See TracBrowser for help on using the repository browser.