sofars/pnp/pom00.rs
1use crate::vm::{ir, rx, ry, rz};
2
3/// Form the matrix of polar motion for a given date, IAU 2000.
4///
5/// Given:
6/// xp,yp f64 coordinates of the pole (radians, Note 1)
7/// sp f64 the TIO locator s' (radians, Note 2)
8///
9/// Returned:
10/// [[f64; 3]; 3] polar-motion matrix (Note 3)
11///
12/// Notes:
13///
14/// 1) The arguments xp and yp are the coordinates (in radians) of the
15/// Celestial Intermediate Pole with respect to the International
16/// Terrestrial Reference System (see IERS Conventions 2003),
17/// measured along the meridians 0 and 90 deg west respectively.
18///
19/// 2) The argument sp is the TIO locator s', in radians, which
20/// positions the Terrestrial Intermediate Origin on the equator. It
21/// is obtained from polar motion observations by numerical
22/// integration, and so is in essence unpredictable. However, it is
23/// dominated by a secular drift of about 47 microarcseconds per
24/// century, and so can be taken into account by using s' = -47*t,
25/// where t is centuries since J2000.0. The function sp00
26/// implements this approximation.
27///
28/// 3) The matrix operates in the sense V(TRS) = rpom * V(CIP), meaning
29/// that it is the final rotation when computing the pointing
30/// direction to a celestial source.
31///
32/// Reference:
33///
34/// McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
35/// IERS Technical Note No. 32, BKG (2004)
36pub fn pom00(xp: f64, yp: f64, sp: f64) -> [[f64; 3]; 3] {
37 let mut rpom = [[0.0; 3]; 3];
38 ir(&mut rpom);
39 rz(sp, &mut rpom);
40 ry(-xp, &mut rpom);
41 rx(-yp, &mut rpom);
42 rpom
43}