1 #include "erfa.h"
2 
eraLtecm(double epj,double rm[3][3])3 void eraLtecm(double epj, double rm[3][3])
4 /*
5 **  - - - - - - - - -
6 **   e r a L t e c m
7 **  - - - - - - - - -
8 **
9 **  ICRS equatorial to ecliptic rotation matrix, long-term.
10 **
11 **  Given:
12 **     epj     double         Julian epoch (TT)
13 **
14 **  Returned:
15 **     rm      double[3][3]   ICRS to ecliptic rotation matrix
16 **
17 **  Notes:
18 **
19 **  1) The matrix is in the sense
20 **
21 **        E_ep = rm x P_ICRS,
22 **
23 **     where P_ICRS is a vector with respect to ICRS right ascension
24 **     and declination axes and E_ep is the same vector with respect to
25 **     the (inertial) ecliptic and equinox of epoch epj.
26 **
27 **  2) P_ICRS is a free vector, merely a direction, typically of unit
28 **     magnitude, and not bound to any particular spatial origin, such
29 **     as the Earth, Sun or SSB.  No assumptions are made about whether
30 **     it represents starlight and embodies astrometric effects such as
31 **     parallax or aberration.  The transformation is approximately that
32 **     between mean J2000.0 right ascension and declination and ecliptic
33 **     longitude and latitude, with only frame bias (always less than
34 **     25 mas) to disturb this classical picture.
35 **
36 **  3) The Vondrak et al. (2011, 2012) 400 millennia precession model
37 **     agrees with the IAU 2006 precession at J2000.0 and stays within
38 **     100 microarcseconds during the 20th and 21st centuries.  It is
39 **     accurate to a few arcseconds throughout the historical period,
40 **     worsening to a few tenths of a degree at the end of the
41 **     +/- 200,000 year time span.
42 **
43 **  Called:
44 **     eraLtpequ    equator pole, long term
45 **     eraLtpecl    ecliptic pole, long term
46 **     eraPxp       vector product
47 **     eraPn        normalize vector
48 **
49 **  References:
50 **
51 **    Vondrak, J., Capitaine, N. and Wallace, P., 2011, New precession
52 **    expressions, valid for long time intervals, Astron.Astrophys. 534,
53 **    A22
54 **
55 **    Vondrak, J., Capitaine, N. and Wallace, P., 2012, New precession
56 **    expressions, valid for long time intervals (Corrigendum),
57 **    Astron.Astrophys. 541, C1
58 **
59 **  Copyright (C) 2013-2020, NumFOCUS Foundation.
60 **  Derived, with permission, from the SOFA library.  See notes at end of file.
61 */
62 {
63 /* Frame bias (IERS Conventions 2010, Eqs. 5.21 and 5.33) */
64    const double dx = -0.016617 * ERFA_DAS2R,
65                 de = -0.0068192 * ERFA_DAS2R,
66                 dr = -0.0146 * ERFA_DAS2R;
67 
68    double p[3], z[3], w[3], s, x[3], y[3];
69 
70 
71 /* Equator pole. */
72    eraLtpequ(epj, p);
73 
74 /* Ecliptic pole (bottom row of equatorial to ecliptic matrix). */
75    eraLtpecl(epj, z);
76 
77 /* Equinox (top row of matrix). */
78    eraPxp(p, z, w);
79    eraPn(w, &s, x);
80 
81 /* Middle row of matrix. */
82    eraPxp(z, x, y);
83 
84 /* Combine with frame bias. */
85    rm[0][0] =   x[0]    - x[1]*dr + x[2]*dx;
86    rm[0][1] =   x[0]*dr + x[1]    + x[2]*de;
87    rm[0][2] = - x[0]*dx - x[1]*de + x[2];
88    rm[1][0] =   y[0]    - y[1]*dr + y[2]*dx;
89    rm[1][1] =   y[0]*dr + y[1]    + y[2]*de;
90    rm[1][2] = - y[0]*dx - y[1]*de + y[2];
91    rm[2][0] =   z[0]    - z[1]*dr + z[2]*dx;
92    rm[2][1] =   z[0]*dr + z[1]    + z[2]*de;
93    rm[2][2] = - z[0]*dx - z[1]*de + z[2];
94 
95 }
96 /*----------------------------------------------------------------------
97 **
98 **
99 **  Copyright (C) 2013-2020, NumFOCUS Foundation.
100 **  All rights reserved.
101 **
102 **  This library is derived, with permission, from the International
103 **  Astronomical Union's "Standards of Fundamental Astronomy" library,
104 **  available from http://www.iausofa.org.
105 **
106 **  The ERFA version is intended to retain identical functionality to
107 **  the SOFA library, but made distinct through different function and
108 **  file names, as set out in the SOFA license conditions.  The SOFA
109 **  original has a role as a reference standard for the IAU and IERS,
110 **  and consequently redistribution is permitted only in its unaltered
111 **  state.  The ERFA version is not subject to this restriction and
112 **  therefore can be included in distributions which do not support the
113 **  concept of "read only" software.
114 **
115 **  Although the intent is to replicate the SOFA API (other than
116 **  replacement of prefix names) and results (with the exception of
117 **  bugs;  any that are discovered will be fixed), SOFA is not
118 **  responsible for any errors found in this version of the library.
119 **
120 **  If you wish to acknowledge the SOFA heritage, please acknowledge
121 **  that you are using a library derived from SOFA, rather than SOFA
122 **  itself.
123 **
124 **
125 **  TERMS AND CONDITIONS
126 **
127 **  Redistribution and use in source and binary forms, with or without
128 **  modification, are permitted provided that the following conditions
129 **  are met:
130 **
131 **  1 Redistributions of source code must retain the above copyright
132 **    notice, this list of conditions and the following disclaimer.
133 **
134 **  2 Redistributions in binary form must reproduce the above copyright
135 **    notice, this list of conditions and the following disclaimer in
136 **    the documentation and/or other materials provided with the
137 **    distribution.
138 **
139 **  3 Neither the name of the Standards Of Fundamental Astronomy Board,
140 **    the International Astronomical Union nor the names of its
141 **    contributors may be used to endorse or promote products derived
142 **    from this software without specific prior written permission.
143 **
144 **  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
145 **  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
146 **  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
147 **  FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
148 **  COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
149 **  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
150 **  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
151 **  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
152 **  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
153 **  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
154 **  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
155 **  POSSIBILITY OF SUCH DAMAGE.
156 **
157 */
158