source: trunk/FACT++/sofa/src/eors.c@ 18368

Last change on this file since 18368 was 18346, checked in by tbretz, 11 years ago
File size: 5.9 KB
Line 
1#include "sofa.h"
2
3double iauEors(double rnpb[3][3], double s)
4/*
5** - - - - - - - -
6** i a u E o r s
7** - - - - - - - -
8**
9** Equation of the origins, given the classical NPB matrix and the
10** quantity s.
11**
12** This function is part of the International Astronomical Union's
13** SOFA (Standards Of Fundamental Astronomy) software collection.
14**
15** Status: support function.
16**
17** Given:
18** rnpb double[3][3] classical nutation x precession x bias matrix
19** s double the quantity s (the CIO locator)
20**
21** Returned (function value):
22** double the equation of the origins in radians.
23**
24** Notes:
25**
26** 1) The equation of the origins is the distance between the true
27** equinox and the celestial intermediate origin and, equivalently,
28** the difference between Earth rotation angle and Greenwich
29** apparent sidereal time (ERA-GST). It comprises the precession
30** (since J2000.0) in right ascension plus the equation of the
31** equinoxes (including the small correction terms).
32**
33** 2) The algorithm is from Wallace & Capitaine (2006).
34**
35** References:
36**
37** Capitaine, N. & Wallace, P.T., 2006, Astron.Astrophys. 450, 855
38**
39** Wallace, P. & Capitaine, N., 2006, Astron.Astrophys. 459, 981
40**
41** This revision: 2013 June 18
42**
43** SOFA release 2015-02-09
44**
45** Copyright (C) 2015 IAU SOFA Board. See notes at end.
46*/
47{
48 double x, ax, xs, ys, zs, p, q, eo;
49
50/* Evaluate Wallace & Capitaine (2006) expression (16). */
51 x = rnpb[2][0];
52 ax = x / (1.0 + rnpb[2][2]);
53 xs = 1.0 - ax * x;
54 ys = -ax * rnpb[2][1];
55 zs = -x;
56 p = rnpb[0][0] * xs + rnpb[0][1] * ys + rnpb[0][2] * zs;
57 q = rnpb[1][0] * xs + rnpb[1][1] * ys + rnpb[1][2] * zs;
58 eo = ((p != 0) || (q != 0)) ? s - atan2(q, p) : s;
59
60 return eo;
61
62/*----------------------------------------------------------------------
63**
64** Copyright (C) 2015
65** Standards Of Fundamental Astronomy Board
66** of the International Astronomical Union.
67**
68** =====================
69** SOFA Software License
70** =====================
71**
72** NOTICE TO USER:
73**
74** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
75** CONDITIONS WHICH APPLY TO ITS USE.
76**
77** 1. The Software is owned by the IAU SOFA Board ("SOFA").
78**
79** 2. Permission is granted to anyone to use the SOFA software for any
80** purpose, including commercial applications, free of charge and
81** without payment of royalties, subject to the conditions and
82** restrictions listed below.
83**
84** 3. You (the user) may copy and distribute SOFA source code to others,
85** and use and adapt its code and algorithms in your own software,
86** on a world-wide, royalty-free basis. That portion of your
87** distribution that does not consist of intact and unchanged copies
88** of SOFA source code files is a "derived work" that must comply
89** with the following requirements:
90**
91** a) Your work shall be marked or carry a statement that it
92** (i) uses routines and computations derived by you from
93** software provided by SOFA under license to you; and
94** (ii) does not itself constitute software provided by and/or
95** endorsed by SOFA.
96**
97** b) The source code of your derived work must contain descriptions
98** of how the derived work is based upon, contains and/or differs
99** from the original SOFA software.
100**
101** c) The names of all routines in your derived work shall not
102** include the prefix "iau" or "sofa" or trivial modifications
103** thereof such as changes of case.
104**
105** d) The origin of the SOFA components of your derived work must
106** not be misrepresented; you must not claim that you wrote the
107** original software, nor file a patent application for SOFA
108** software or algorithms embedded in the SOFA software.
109**
110** e) These requirements must be reproduced intact in any source
111** distribution and shall apply to anyone to whom you have
112** granted a further right to modify the source code of your
113** derived work.
114**
115** Note that, as originally distributed, the SOFA software is
116** intended to be a definitive implementation of the IAU standards,
117** and consequently third-party modifications are discouraged. All
118** variations, no matter how minor, must be explicitly marked as
119** such, as explained above.
120**
121** 4. You shall not cause the SOFA software to be brought into
122** disrepute, either by misuse, or use for inappropriate tasks, or
123** by inappropriate modification.
124**
125** 5. The SOFA software is provided "as is" and SOFA makes no warranty
126** as to its use or performance. SOFA does not and cannot warrant
127** the performance or results which the user may obtain by using the
128** SOFA software. SOFA makes no warranties, express or implied, as
129** to non-infringement of third party rights, merchantability, or
130** fitness for any particular purpose. In no event will SOFA be
131** liable to the user for any consequential, incidental, or special
132** damages, including any lost profits or lost savings, even if a
133** SOFA representative has been advised of such damages, or for any
134** claim by any third party.
135**
136** 6. The provision of any version of the SOFA software under the terms
137** and conditions specified herein does not imply that future
138** versions will also be made available under the same terms and
139** conditions.
140*
141** In any published work or commercial product which uses the SOFA
142** software directly, acknowledgement (see www.iausofa.org) is
143** appreciated.
144**
145** Correspondence concerning SOFA software should be addressed as
146** follows:
147**
148** By email: sofa@ukho.gov.uk
149** By post: IAU SOFA Center
150** HM Nautical Almanac Office
151** UK Hydrographic Office
152** Admiralty Way, Taunton
153** Somerset, TA1 2DN
154** United Kingdom
155**
156**--------------------------------------------------------------------*/
157}
Note: See TracBrowser for help on using the repository browser.