/// Differential of the cross-product.
///
/// Format of the output derivative (a Jacobian) is declared above.
Differential of the cross-product.
Format of the output derivative (a Jacobian) is declared above.
Differential of the cross - product . Format of the output derivative ( a Jacobian ) is declared above .
pub fn cross(a: V3, b: V3) -> (V3, (M33, M33)) {
        let value = a.cross(&b);
        let J_a = M3([
            // partial derivatives of value
            V3([1.0, 0.0, 0.0]).cross(&b),
            V3([0.0, 1.0, 0.0]).cross(&b),
            V3([0.0, 0.0, 1.0]).cross(&b),
        ]).t(); // transpose so rows are now gradients
        let J_b = M3([
            a.cross(&V3([1.0, 0.0, 0.0])),
            a.cross(&V3([0.0, 1.0, 0.0])),
            a.cross(&V3([0.0, 0.0, 1.0])),
        ]).t();
        (value, (J_a, J_b))
    }
pub fn cross ( a : V3 , b : V3 ) -> ( V3 , ( M33 , M33 ) ) { let value = a . cross ( & b ) ; let J_a = M3 ( [ // partial derivatives of value V3 ( [ 1.0 , 0.0 , 0.0 ] ) . cross ( & b ) , V3 ( [ 0.0 , 1.0 , 0.0 ] ) . cross ( & b ) , V3 ( [ 0.0 , 0.0 , 1.0 ] ) . cross ( & b ) , ] ) . t ( ) ; // transpose so rows are now gradients let J_b = M3 ( [ a . cross ( & V3 ( [ 1.0 , 0.0 , 0.0 ] ) ) , a . cross ( & V3 ( [ 0.0 , 1.0 , 0.0 ] ) ) , a . cross ( & V3 ( [ 0.0 , 0.0 , 1.0 ] ) ) , ] ) . t ( ) ; ( value , ( J_a , J_b ) ) }
Differential of the cross-product.
Differential of the cross - product .
a
V3
b
V3