def test_nan(self):
     a=numpy.array([util.NAN, 3.0, 0.0],floattype)
     b=numpy.array([6.0, util.NAN, 2.0],floattype)
     c=numpy.array([util.NAN, 1.0, 0.0],floattype)
     d=numpy.array([2.1, 1.0, 29.02],floattype)
     result = linear_algebra.dihedral_angle(a,b,c,d)
     self.assertTrue(numpy.isnan(result))
 def test_inf_2(self):
     a=numpy.array([util.INF, 3.0, 0.0],floattype)
     b=numpy.array([util.INF, 1.2, 2.3],floattype)
     c=numpy.array([0.3, util.INF, 29.02],floattype)
     d=numpy.array([2.1, 1.0, 29.02],floattype)
     result = linear_algebra.dihedral_angle(a,b,c,d)
     self.assertTrue(numpy.isnan(result) or numpy.isinf(result))
 def test_arb_1(self):
     a=numpy.array([23.0, 0.0, 0.0],floattype)
     b=numpy.array([0.0, 0.0, 0.0],floattype)
     c=numpy.array([0.0, 12.0, 0.0],floattype)
     d=numpy.array([0.0, 212.0, -20.0],floattype)
     result = linear_algebra.dihedral_angle(a,b,c,d)
     expected = 90.0
     self.assertAlmostEqual(result,expected)
 def test_same_plane_1(self):
     a=numpy.array([1.0, 0.0, 0.0],floattype)
     b=numpy.array([0.0, 0.0, 0.0],floattype)
     c=numpy.array([0.0, 1.0, 0.0],floattype)
     d=numpy.array([1.0, 1.0, 0.0],floattype)
     result = linear_algebra.dihedral_angle(a,b,c,d)
     expected = 0.0
     self.assertAlmostEqual(result,expected)
 def test_all_zero_arrays(self):
     a=numpy.array([0.0, 0.0, 0.0],floattype)
     b=numpy.array([0.0, 0.0, 0.0],floattype)
     c=numpy.array([0.0, 0.0, 0.0],floattype)
     d=numpy.array([0.0, 0.0, 0.0],floattype)
     result = linear_algebra.dihedral_angle(a,b,c,d)
     expected = 180.0
     self.assertAlmostEqual(result,expected)
 def test_zero(self):
     a=numpy.array([util.ZERO, 3.0, 0.0],floattype)
     b=numpy.array([6.0, util.ZERO, 2.0],floattype)
     c=numpy.array([6.7, 1.0, util.ZERO],floattype)
     d=numpy.array([2.1, 1.0, 29.02],floattype)
     result = linear_algebra.dihedral_angle(a,b,c,d)
     expected = 89.502
     self.assertAlmostEqual(result,expected,3)
 def test_tiny(self):
     a=numpy.array([util.TINY, 3.0, 0.0],floattype)
     b=numpy.array([6.0, util.TINY, 2.0],floattype)
     c=numpy.array([2.0, 3.2, util.TINY],floattype)
     d=numpy.array([2.1, 1.0, 29.02],floattype)
     result = linear_algebra.dihedral_angle(a,b,c,d)
     expected = 66.032
     self.assertAlmostEqual(result,expected,3)
 def test_arb_2(self):
     a=numpy.array([1.0168308, -1.35572028, -1.35362422],floattype)
     b=numpy.array([-0.69958848, 1.66901076, 0.49978462],floattype)
     c=numpy.array([12.0168308, 12.35572028, 1.35362422],floattype)
     d=numpy.array([-20.69958848, 16.66901076, 20.49978462],floattype)
     c=numpy.array([0.3, 0.0, -1.2],floattype)
     result = linear_algebra.dihedral_angle(a,b,c,d)
     expected = 85.786
     self.assertAlmostEqual(result,expected,3)