Ejemplo n.º 1
0
 def test_squared_length_batch(self):
     result = quaternion.squared_length([
         [0., 0., 0., 1.],
         [1., 1., 1., 1.],
     ])
     np.testing.assert_almost_equal(result, [1., 4.], decimal=5)
Ejemplo n.º 2
0
 def test_squared_length(self):
     result = quaternion.squared_length([1., 1., 1., 1.])
     np.testing.assert_almost_equal(result, 4., decimal=5)
Ejemplo n.º 3
0
 def test_squared_length_identity(self):
     result = quaternion.squared_length([0., 0., 0., 1.])
     np.testing.assert_almost_equal(result, 1., decimal=5)
Ejemplo n.º 4
0
 def test_squared_length_batch(self):
     result = quaternion.squared_length([
         [0., 0., 0., 1.],
         [1., 1., 1., 1.],
     ])
     np.testing.assert_almost_equal(result, [1., 4.], decimal=5)
Ejemplo n.º 5
0
 def test_squared_length(self):
     result = quaternion.squared_length([1., 1., 1., 1.])
     np.testing.assert_almost_equal(result, 4., decimal=5)
Ejemplo n.º 6
0
 def test_squared_length_identity(self):
     result = quaternion.squared_length([0., 0., 0., 1.])
     np.testing.assert_almost_equal(result, 1., decimal=5)