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

Last change on this file since 18355 was 18346, checked in by tbretz, 11 years ago
File size: 7.5 KB
Line 
1#include "sofa.h"
2
3void iauPb06(double date1, double date2,
4 double *bzeta, double *bz, double *btheta)
5/*
6** - - - - - - - -
7** i a u P b 0 6
8** - - - - - - - -
9**
10** This function forms three Euler angles which implement general
11** precession from epoch J2000.0, using the IAU 2006 model. Frame
12** bias (the offset between ICRS and mean J2000.0) is included.
13**
14** This function is part of the International Astronomical Union's
15** SOFA (Standards Of Fundamental Astronomy) software collection.
16**
17** Status: support function.
18**
19** Given:
20** date1,date2 double TT as a 2-part Julian Date (Note 1)
21**
22** Returned:
23** bzeta double 1st rotation: radians cw around z
24** bz double 3rd rotation: radians cw around z
25** btheta double 2nd rotation: radians ccw around y
26**
27** Notes:
28**
29** 1) The TT date date1+date2 is a Julian Date, apportioned in any
30** convenient way between the two arguments. For example,
31** JD(TT)=2450123.7 could be expressed in any of these ways,
32** among others:
33**
34** date1 date2
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** The JD method is the most natural and convenient to use in
42** cases where the loss of several decimal digits of resolution
43** is acceptable. The J2000 method is best matched to the way
44** the argument is handled internally and will deliver the
45** optimum resolution. The MJD method and the date & time methods
46** are both good compromises between resolution and convenience.
47**
48** 2) The traditional accumulated precession angles zeta_A, z_A,
49** theta_A cannot be obtained in the usual way, namely through
50** polynomial expressions, because of the frame bias. The latter
51** means that two of the angles undergo rapid changes near this
52** date. They are instead the results of decomposing the
53** precession-bias matrix obtained by using the Fukushima-Williams
54** method, which does not suffer from the problem. The
55** decomposition returns values which can be used in the
56** conventional formulation and which include frame bias.
57**
58** 3) The three angles are returned in the conventional order, which
59** is not the same as the order of the corresponding Euler
60** rotations. The precession-bias matrix is
61** R_3(-z) x R_2(+theta) x R_3(-zeta).
62**
63** 4) Should zeta_A, z_A, theta_A angles be required that do not
64** contain frame bias, they are available by calling the SOFA
65** function iauP06e.
66**
67** Called:
68** iauPmat06 PB matrix, IAU 2006
69** iauRz rotate around Z-axis
70**
71** This revision: 2013 June 18
72**
73** SOFA release 2015-02-09
74**
75** Copyright (C) 2015 IAU SOFA Board. See notes at end.
76*/
77{
78 double r[3][3], r31, r32;
79
80/* Precession matrix via Fukushima-Williams angles. */
81 iauPmat06(date1, date2, r);
82
83/* Solve for z. */
84 *bz = atan2(r[1][2], r[0][2]);
85
86/* Remove it from the matrix. */
87 iauRz(*bz, r);
88
89/* Solve for the remaining two angles. */
90 *bzeta = atan2 (r[1][0], r[1][1]);
91 r31 = r[2][0];
92 r32 = r[2][1];
93 *btheta = atan2(-dsign(sqrt(r31 * r31 + r32 * r32), r[0][2]),
94 r[2][2]);
95
96 return;
97
98/*----------------------------------------------------------------------
99**
100** Copyright (C) 2015
101** Standards Of Fundamental Astronomy Board
102** of the International Astronomical Union.
103**
104** =====================
105** SOFA Software License
106** =====================
107**
108** NOTICE TO USER:
109**
110** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
111** CONDITIONS WHICH APPLY TO ITS USE.
112**
113** 1. The Software is owned by the IAU SOFA Board ("SOFA").
114**
115** 2. Permission is granted to anyone to use the SOFA software for any
116** purpose, including commercial applications, free of charge and
117** without payment of royalties, subject to the conditions and
118** restrictions listed below.
119**
120** 3. You (the user) may copy and distribute SOFA source code to others,
121** and use and adapt its code and algorithms in your own software,
122** on a world-wide, royalty-free basis. That portion of your
123** distribution that does not consist of intact and unchanged copies
124** of SOFA source code files is a "derived work" that must comply
125** with the following requirements:
126**
127** a) Your work shall be marked or carry a statement that it
128** (i) uses routines and computations derived by you from
129** software provided by SOFA under license to you; and
130** (ii) does not itself constitute software provided by and/or
131** endorsed by SOFA.
132**
133** b) The source code of your derived work must contain descriptions
134** of how the derived work is based upon, contains and/or differs
135** from the original SOFA software.
136**
137** c) The names of all routines in your derived work shall not
138** include the prefix "iau" or "sofa" or trivial modifications
139** thereof such as changes of case.
140**
141** d) The origin of the SOFA components of your derived work must
142** not be misrepresented; you must not claim that you wrote the
143** original software, nor file a patent application for SOFA
144** software or algorithms embedded in the SOFA software.
145**
146** e) These requirements must be reproduced intact in any source
147** distribution and shall apply to anyone to whom you have
148** granted a further right to modify the source code of your
149** derived work.
150**
151** Note that, as originally distributed, the SOFA software is
152** intended to be a definitive implementation of the IAU standards,
153** and consequently third-party modifications are discouraged. All
154** variations, no matter how minor, must be explicitly marked as
155** such, as explained above.
156**
157** 4. You shall not cause the SOFA software to be brought into
158** disrepute, either by misuse, or use for inappropriate tasks, or
159** by inappropriate modification.
160**
161** 5. The SOFA software is provided "as is" and SOFA makes no warranty
162** as to its use or performance. SOFA does not and cannot warrant
163** the performance or results which the user may obtain by using the
164** SOFA software. SOFA makes no warranties, express or implied, as
165** to non-infringement of third party rights, merchantability, or
166** fitness for any particular purpose. In no event will SOFA be
167** liable to the user for any consequential, incidental, or special
168** damages, including any lost profits or lost savings, even if a
169** SOFA representative has been advised of such damages, or for any
170** claim by any third party.
171**
172** 6. The provision of any version of the SOFA software under the terms
173** and conditions specified herein does not imply that future
174** versions will also be made available under the same terms and
175** conditions.
176*
177** In any published work or commercial product which uses the SOFA
178** software directly, acknowledgement (see www.iausofa.org) is
179** appreciated.
180**
181** Correspondence concerning SOFA software should be addressed as
182** follows:
183**
184** By email: sofa@ukho.gov.uk
185** By post: IAU SOFA Center
186** HM Nautical Almanac Office
187** UK Hydrographic Office
188** Admiralty Way, Taunton
189** Somerset, TA1 2DN
190** United Kingdom
191**
192**--------------------------------------------------------------------*/
193}
Note: See TracBrowser for help on using the repository browser.