source: trunk/FACT++/sofa/src/c2ixys.c@ 18355

Last change on this file since 18355 was 18346, checked in by tbretz, 11 years ago
File size: 6.2 KB
Line 
1#include "sofa.h"
2
3void iauC2ixys(double x, double y, double s, double rc2i[3][3])
4/*
5** - - - - - - - - - -
6** i a u C 2 i x y s
7** - - - - - - - - - -
8**
9** Form the celestial to intermediate-frame-of-date matrix given the CIP
10** X,Y and the CIO locator 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** x,y double Celestial Intermediate Pole (Note 1)
19** s double the CIO locator s (Note 2)
20**
21** Returned:
22** rc2i double[3][3] celestial-to-intermediate matrix (Note 3)
23**
24** Notes:
25**
26** 1) The Celestial Intermediate Pole coordinates are the x,y
27** components of the unit vector in the Geocentric Celestial
28** Reference System.
29**
30** 2) The CIO locator s (in radians) positions the Celestial
31** Intermediate Origin on the equator of the CIP.
32**
33** 3) The matrix rc2i is the first stage in the transformation from
34** celestial to terrestrial coordinates:
35**
36** [TRS] = RPOM * R_3(ERA) * rc2i * [CRS]
37**
38** = RC2T * [CRS]
39**
40** where [CRS] is a vector in the Geocentric Celestial Reference
41** System and [TRS] is a vector in the International Terrestrial
42** Reference System (see IERS Conventions 2003), ERA is the Earth
43** Rotation Angle and RPOM is the polar motion matrix.
44**
45** Called:
46** iauIr initialize r-matrix to identity
47** iauRz rotate around Z-axis
48** iauRy rotate around Y-axis
49**
50** Reference:
51**
52** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
53** IERS Technical Note No. 32, BKG (2004)
54**
55** This revision: 2014 November 7
56**
57** SOFA release 2015-02-09
58**
59** Copyright (C) 2015 IAU SOFA Board. See notes at end.
60*/
61{
62 double r2, e, d;
63
64
65/* Obtain the spherical angles E and d. */
66 r2 = x*x + y*y;
67 e = (r2 > 0.0) ? atan2(y, x) : 0.0;
68 d = atan(sqrt(r2 / (1.0 - r2)));
69
70/* Form the matrix. */
71 iauIr(rc2i);
72 iauRz(e, rc2i);
73 iauRy(d, rc2i);
74 iauRz(-(e+s), rc2i);
75
76 return;
77
78/*----------------------------------------------------------------------
79**
80** Copyright (C) 2015
81** Standards Of Fundamental Astronomy Board
82** of the International Astronomical Union.
83**
84** =====================
85** SOFA Software License
86** =====================
87**
88** NOTICE TO USER:
89**
90** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
91** CONDITIONS WHICH APPLY TO ITS USE.
92**
93** 1. The Software is owned by the IAU SOFA Board ("SOFA").
94**
95** 2. Permission is granted to anyone to use the SOFA software for any
96** purpose, including commercial applications, free of charge and
97** without payment of royalties, subject to the conditions and
98** restrictions listed below.
99**
100** 3. You (the user) may copy and distribute SOFA source code to others,
101** and use and adapt its code and algorithms in your own software,
102** on a world-wide, royalty-free basis. That portion of your
103** distribution that does not consist of intact and unchanged copies
104** of SOFA source code files is a "derived work" that must comply
105** with the following requirements:
106**
107** a) Your work shall be marked or carry a statement that it
108** (i) uses routines and computations derived by you from
109** software provided by SOFA under license to you; and
110** (ii) does not itself constitute software provided by and/or
111** endorsed by SOFA.
112**
113** b) The source code of your derived work must contain descriptions
114** of how the derived work is based upon, contains and/or differs
115** from the original SOFA software.
116**
117** c) The names of all routines in your derived work shall not
118** include the prefix "iau" or "sofa" or trivial modifications
119** thereof such as changes of case.
120**
121** d) The origin of the SOFA components of your derived work must
122** not be misrepresented; you must not claim that you wrote the
123** original software, nor file a patent application for SOFA
124** software or algorithms embedded in the SOFA software.
125**
126** e) These requirements must be reproduced intact in any source
127** distribution and shall apply to anyone to whom you have
128** granted a further right to modify the source code of your
129** derived work.
130**
131** Note that, as originally distributed, the SOFA software is
132** intended to be a definitive implementation of the IAU standards,
133** and consequently third-party modifications are discouraged. All
134** variations, no matter how minor, must be explicitly marked as
135** such, as explained above.
136**
137** 4. You shall not cause the SOFA software to be brought into
138** disrepute, either by misuse, or use for inappropriate tasks, or
139** by inappropriate modification.
140**
141** 5. The SOFA software is provided "as is" and SOFA makes no warranty
142** as to its use or performance. SOFA does not and cannot warrant
143** the performance or results which the user may obtain by using the
144** SOFA software. SOFA makes no warranties, express or implied, as
145** to non-infringement of third party rights, merchantability, or
146** fitness for any particular purpose. In no event will SOFA be
147** liable to the user for any consequential, incidental, or special
148** damages, including any lost profits or lost savings, even if a
149** SOFA representative has been advised of such damages, or for any
150** claim by any third party.
151**
152** 6. The provision of any version of the SOFA software under the terms
153** and conditions specified herein does not imply that future
154** versions will also be made available under the same terms and
155** conditions.
156*
157** In any published work or commercial product which uses the SOFA
158** software directly, acknowledgement (see www.iausofa.org) is
159** appreciated.
160**
161** Correspondence concerning SOFA software should be addressed as
162** follows:
163**
164** By email: sofa@ukho.gov.uk
165** By post: IAU SOFA Center
166** HM Nautical Almanac Office
167** UK Hydrographic Office
168** Admiralty Way, Taunton
169** Somerset, TA1 2DN
170** United Kingdom
171**
172**--------------------------------------------------------------------*/
173}
Note: See TracBrowser for help on using the repository browser.