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
53
54
55
56
57
58
59
use super::{fw2m::*, bpn2xy::*};
/// CIP X,Y given Fukushima-Williams bias-precession-nutation angles.
///
/// Given:
/// * gamb F-W angle gamma_bar (radians)
/// * phib F-W angle phi_bar (radians)
/// * psi F-W angle psi (radians)
/// * eps F-W angle epsilon (radians)
///
/// Returned:
/// * x,y CIP unit vector X,Y
///
/// # Notes:
///
/// 1) Naming the following points:
///
/// e = J2000.0 ecliptic pole,
/// p = GCRS pole
/// E = ecliptic pole of date,
/// and P = CIP,
///
/// the four Fukushima-Williams angles are as follows:
///
/// gamb = gamma = epE
/// phib = phi = pE
/// psi = psi = pEP
/// eps = epsilon = EP
///
/// 2) The matrix representing the combined effects of frame bias,
/// precession and nutation is:
///
/// NxPxB = R_1(-epsA).R_3(-psi).R_1(phib).R_3(gamb)
///
/// The returned values x,y are elements [2][0] and [2][1] of the
/// matrix. Near J2000.0, they are essentially angles in radians.
///
/// # Called:
/// * fw2m F-W angles to r-matrix
/// * bpn2xy extract CIP X,Y coordinates from NPB matrix
///
/// # Reference:
/// * Hilton, J. et al., 2006, Celest.Mech.Dyn.Astron. 94, 351
///
/// This revision: 2021 May 11
pub fn fw2xy(gamb: f64, phib: f64, psi: f64, eps: f64,
x: &mut f64, y: &mut f64)
{
let mut r = [[0.0;3]; 3];
/* Form NxPxB matrix. */
fw2m(gamb, phib, psi, eps, &mut r);
/* Extract CIP X,Y. */
bpn2xy(&r, x, y);
/* Finished. */
}