Example #1
0
 def test_normalise_batch(self):
     result = vector3.normalise([
         [1.,1.,1.],
         [-1.,-1.,-1.],
         [0.,2.,7.],
     ])
     expected = [
         [0.57735, 0.57735, 0.57735],
         [-0.57735,-0.57735,-0.57735],
         [0., 0.274721, 0.961524],
     ]
     np.testing.assert_almost_equal(result, expected, decimal=5)
Example #2
0
 def test_normalise_batch(self):
     result = vector3.normalise([
         [1., 1., 1.],
         [-1., -1., -1.],
         [0., 2., 7.],
     ])
     expected = [
         [0.57735, 0.57735, 0.57735],
         [-0.57735, -0.57735, -0.57735],
         [0., 0.274721, 0.961524],
     ]
     np.testing.assert_almost_equal(result, expected, decimal=5)
Example #3
0
 def test_normalise_single_vector(self):
     result = vector3.normalise([1.,1.,1.])
     np.testing.assert_almost_equal(result, [0.57735, 0.57735, 0.57735], decimal=5)
Example #4
0
 def test_normalise_single_vector(self):
     result = vector3.normalise([1., 1., 1.])
     np.testing.assert_almost_equal(result, [0.57735, 0.57735, 0.57735],
                                    decimal=5)