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
/// p-vector outer (=vector=cross) product. /// /// Given: /// a double[3] first p-vector /// b double[3] second p-vector /// /// Returned: /// axb double[3] a x b /// /// /// This revision: 2021 May 11 pub fn pxp(a: &[f64;3], b: &[f64; 3], axb: &mut [f64; 3]) { let xa = a[0]; let ya = a[1]; let za = a[2]; let xb = b[0]; let yb = b[1]; let zb = b[2]; axb[0] = ya*zb - za*yb; axb[1] = za*xb - xa*zb; axb[2] = xa*yb - ya*xb; /* Finished. */ }