[−][src]Function dihedral::dihedral_unsigned
pub fn dihedral_unsigned([a, b, c, d]: [[f64; 3]; 4]) -> f64
Calculates the unsigned dihedral angle, in the range 0 to π, of the four ordered coordinates
Examples
use dihedral::dihedral_unsigned; let P0 = [24.969, 13.428, 30.692]; // N let P1 = [24.044, 12.661, 29.808]; // CA let P2 = [22.785, 13.482, 29.543]; // C let P3 = [21.951, 13.670, 30.431]; // O let P4 = [23.672, 11.328, 30.466]; // CB let P5 = [22.881, 10.326, 29.620]; // CG let P6 = [23.691, 9.935, 28.389]; // CD1 let P7 = [22.557, 9.096, 30.459]; // CD2 assert!((dihedral_unsigned([P0, P1, P2, P3]).to_degrees() - (71.21515)).abs() < 1E-2); assert!((dihedral_unsigned([P0, P1, P4, P5]).to_degrees() - (171.94319)).abs() < 1E-2); assert!((dihedral_unsigned([P1, P4, P5, P6]).to_degrees() - (60.82226)).abs() < 1E-2); assert!((dihedral_unsigned([P1, P4, P5, P7]).to_degrees() - (177.63641)).abs() < 1E-2);