Example #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)
Example #2
0
 def test_squared_length(self):
     result = quaternion.squared_length([1., 1., 1., 1.])
     np.testing.assert_almost_equal(result, 4., decimal=5)
Example #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)
Example #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)
Example #5
0
 def test_squared_length(self):
     result = quaternion.squared_length([1., 1., 1., 1.])
     np.testing.assert_almost_equal(result, 4., decimal=5)
Example #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)