1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
use crate::utils::*; /// Convert spherical coordinates to Cartesian. /// /// Given: /// * theta longitude angle (radians) /// * phi latitude angle (radians) /// /// Returned: /// * c direction cosines /// /// This revision: 2021 May 11 pub fn s2c(theta: f64, phi: f64, c: &mut [f64;3]) { let cp = cos(phi); c[0] = cos(theta) * cp; c[1] = sin(theta) * cp; c[2] = sin(phi); /* Finished. */ }