Coverage Report

Created: 2026-06-15 06:09

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/rust/registry/src/index.crates.io-1949cf8c6b5b557f/sofars-0.6.1/src/star/fk5hip.rs
Line
Count
Source
1
use crate::consts::DAS2R;
2
use crate::vm::rv2m;
3
4
/// FK5 to Hipparcos rotation and spin.
5
///
6
/// Status:  support function.
7
///
8
/// Returned:
9
///    r5h   [[f64; 3]; 3] r-matrix: FK5 rotation wrt Hipparcos (Note 2)
10
///    s5h   [f64; 3]      r-vector: FK5 spin wrt Hipparcos (Note 3)
11
///
12
/// Notes:
13
///
14
/// 1) This function models the FK5 to Hipparcos transformation as a
15
///    pure rotation and spin;  zonal errors in the FK5 catalog are not
16
///    taken into account.
17
///
18
/// 2) The r-matrix r5h operates in the sense:
19
///
20
///          P_Hipparcos = r5h x P_FK5
21
///
22
///    where P_FK5 is a p-vector in the FK5 frame, and P_Hipparcos is
23
///    the equivalent Hipparcos p-vector.
24
///
25
/// 3) The r-vector s5h represents the time derivative of the FK5 to
26
///    Hipparcos rotation.  The units are radians per year (Julian,
27
///    TDB).
28
///
29
/// Called:
30
///    rv2m      r-vector to r-matrix
31
///
32
/// Reference:
33
///    F.Mignard & M.Froeschle, Astron.Astrophys., 354, 732-739 (2000).
34
0
pub fn fk5hip() -> ([[f64; 3]; 3], [f64; 3]) {
35
0
    let mut r5h = [[0.0; 3]; 3];
36
0
    let mut s5h = [0.0; 3];
37
38
    /* FK5 wrt Hipparcos orientation and spin (radians, radians/year) */
39
0
    let epx = -19.9e-3 * DAS2R;
40
0
    let epy = -9.1e-3 * DAS2R;
41
0
    let epz = 22.9e-3 * DAS2R;
42
43
0
    let omx = -0.30e-3 * DAS2R;
44
0
    let omy = 0.60e-3 * DAS2R;
45
0
    let omz = 0.70e-3 * DAS2R;
46
47
    /* FK5 to Hipparcos orientation expressed as an r-vector. */
48
0
    let v = [epx, epy, epz];
49
50
    /* Re-express as an r-matrix. */
51
0
    rv2m(&v, &mut r5h);
52
53
    /* Hipparcos wrt FK5 spin expressed as an r-vector. */
54
0
    s5h[0] = omx;
55
0
    s5h[1] = omy;
56
0
    s5h[2] = omz;
57
58
0
    (r5h, s5h)
59
0
}