示例#1
0
 def test_set_length_batch_vector(self):
     result = vector3.set_length([
         [1., 1., 1.],
         [-1., -1., -1.],
         [0., 2., 7.],
     ], 2.0)
     expected = [
         [1.15470, 1.15470, 1.15470],
         [-1.15470, -1.15470, -1.15470],
         [0., 0.54944, 1.92304],
     ]
     np.testing.assert_almost_equal(result, expected, decimal=5)
示例#2
0
 def test_set_length_batch_vector(self):
     result = vector3.set_length([
         [1.,1.,1.],
         [-1.,-1.,-1.],
         [0.,2.,7.],
         ], 2.0)
     expected = [
         [1.15470,1.15470,1.15470],
         [-1.15470,-1.15470,-1.15470],
         [0.,0.54944,1.92304],
     ]
     np.testing.assert_almost_equal(result, expected, decimal=5)
示例#3
0
 def test_set_length(self):
     result = vector3.set_length([1., 1., 1.], 2.)
     expected = [1.15470, 1.15470, 1.15470]
     np.testing.assert_almost_equal(result, expected, decimal=5)
示例#4
0
 def test_set_length(self):
     result = vector3.set_length([1.,1.,1.],2.)
     expected = [1.15470,1.15470,1.15470]
     np.testing.assert_almost_equal(result, expected, decimal=5)