1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
use crate::vector_matrix::build_rotations::{rx::rx, rz::rz};
use crate::vector_matrix::init::ir::ir;
/// Form the matrix of nutation.
///
/// Given:
/// * epsa mean obliquity of date (Note 1)
/// * dpsi,deps nutation (Note 2)
///
/// Returned:
/// * rmatn nutation matrix (Note 3)
///
/// # Notes:
///
/// 1) The supplied mean obliquity epsa, must be consistent with the
/// precession-nutation models from which dpsi and deps were obtained.
///
/// 2) The caller is responsible for providing the nutation components;
/// they are in longitude and obliquity, in radians and are with
/// respect to the equinox and ecliptic of date.
///
/// 3) The matrix operates in the sense V(true) = rmatn * V(mean),
/// where the p-vector V(true) is with respect to the true
/// equatorial triad of date and the p-vector V(mean) is with
/// respect to the mean equatorial triad of date.
///
/// # Called:
/// * ir initialize r-matrix to identity
/// * rx rotate around X-axis
/// * rz rotate around Z-axis
///
/// # Reference:
/// * Explanatory Supplement to the Astronomical Almanac,
/// P. Kenneth Seidelmann (ed), University Science Books (1992),
/// Section 3.222-3 (p114).
///
/// This revision: 2021 May 11
pub fn numat(epsa:f64, dpsi: f64, deps: f64, rmatn: &mut [[f64; 3];3])
{
/* Build the rotation matrix. */
ir(rmatn);
rx(epsa, rmatn);
rz(-dpsi, rmatn);
rx(-(epsa + deps), rmatn);
/* Finished. */
}