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