def _dihed_angle_low(av, bv, cv, deriv):
a = Vector3(<NUM_LIT:9>, deriv, av, (<NUM_LIT:0>, <NUM_LIT:1>, <NUM_LIT:2>))<EOL>b = Vector3(<NUM_LIT:9>, deriv, bv, (<NUM_LIT:3>, <NUM_LIT:4>, <NUM_LIT:5>))<EOL>c = Vector3(<NUM_LIT:9>, deriv, cv, (<NUM_LIT:6>, <NUM_LIT:7>, <NUM_LIT:8>))<EOL>b /= b.norm()<EOL>tmp = b.copy()<EOL>tmp *= dot(a, b)<EOL>a -= tmp<EOL>tmp = b.copy()<EOL>tmp *= dot(c, b)<EOL>c -= tmp<EOL>a /= a.norm()<EOL>c /= c.norm()<EOL>result = dot(a, c).results()<EOL>if abs(result[<NUM_LIT:0>]) < <NUM_LIT:0.5>:<EOL><INDENT>sign = <NUM_LIT:1>-(np.linalg.det([av, bv, cv]) > <NUM_LIT:0>)*<NUM_LIT:2><EOL>return _cos_to_angle(result, deriv, sign)<EOL><DEDENT>else:<EOL><INDENT>d = cross(b, a)<EOL>side = (result[<NUM_LIT:0>] > <NUM_LIT:0>)*<NUM_LIT:2>-<NUM_LIT:1> <EOL>result = dot(d, c).results()<EOL>return _sin_to_angle(result, deriv, side)<EOL><DEDENT>
Similar to dihed_cos, but with relative vectors