/rust/registry/src/index.crates.io-1949cf8c6b5b557f/sofars-0.6.1/src/pnp/numat.rs
Line | Count | Source |
1 | | use crate::vm::{ir, rx, rz}; |
2 | | |
3 | | /// Form the matrix of nutation. |
4 | | /// |
5 | | /// This function is part of the International Astronomical Union's |
6 | | /// SOFA (Standards of Fundamental Astronomy) software collection. |
7 | | /// |
8 | | /// Status: support function. |
9 | | /// |
10 | | /// Given: |
11 | | /// epsa double mean obliquity of date (Note 1) |
12 | | /// dpsi,deps double nutation (Note 2) |
13 | | /// |
14 | | /// Returned (function value): |
15 | | /// [[f64; 3]; 3] nutation matrix (Note 3) |
16 | | /// |
17 | | /// Notes: |
18 | | /// |
19 | | /// |
20 | | /// 1) The supplied mean obliquity epsa, must be consistent with the |
21 | | /// precession-nutation models from which dpsi and deps were obtained. |
22 | | /// |
23 | | /// 2) The caller is responsible for providing the nutation components; |
24 | | /// they are in longitude and obliquity, in radians and are with |
25 | | /// respect to the equinox and ecliptic of date. |
26 | | /// |
27 | | /// 3) The matrix operates in the sense V(true) = rmatn * V(mean), |
28 | | /// where the p-vector V(true) is with respect to the true |
29 | | /// equatorial triad of date and the p-vector V(mean) is with |
30 | | /// respect to the mean equatorial triad of date. |
31 | | /// |
32 | | /// Called: |
33 | | /// iauIr initialize r-matrix to identity |
34 | | /// iauRx rotate around X-axis |
35 | | /// iauRz rotate around Z-axis |
36 | | /// |
37 | | /// Reference: |
38 | | /// |
39 | | /// Explanatory Supplement to the Astronomical Almanac, |
40 | | /// P. Kenneth Seidelmann (ed), University Science Books (1992), |
41 | | /// Section 3.222-3 (p114). |
42 | | /// |
43 | | /// This revision: 2021 May 11 |
44 | | /// |
45 | | /// SOFA release 2023-10-11 |
46 | | /// |
47 | | /// Copyright (C) 2023 IAU SOFA Board. See notes at end. |
48 | | /// |
49 | 0 | pub fn numat(epsa: f64, dpsi: f64, deps: f64) -> [[f64; 3]; 3] { |
50 | 0 | let mut rmatn = [[0.0; 3]; 3]; |
51 | 0 | ir(&mut rmatn); |
52 | 0 | rx(epsa, &mut rmatn); |
53 | 0 | rz(-dpsi, &mut rmatn); |
54 | 0 | rx(-(epsa + deps), &mut rmatn); |
55 | 0 | rmatn |
56 | 0 | } |