コード例 #1
0
 def test_create_from_matrix44_translation_dtype_matches(self):
     mat = np.array([
         [
             1.,
             2.,
             3.,
             4.,
         ],
         [
             5.,
             6.,
             7.,
             8.,
         ],
         [
             9.,
             10.,
             11.,
             12.,
         ],
         [
             13.,
             14.,
             15.,
             16.,
         ],
     ],
                    dtype=np.float32)
     result = vector4.create_from_matrix44_translation(mat)
     np.testing.assert_almost_equal(result, [13., 14., 15., 16.], decimal=5)
     self.assertTrue(result.dtype == np.float32)
コード例 #2
0
ファイル: test_vector4.py プロジェクト: adamlwgriffiths/Pyrr
 def test_create_from_matrix44_translation_dtype_matches(self):
     mat = np.array([
         [1.,2.,3.,4.,],
         [5.,6.,7.,8.,],
         [9.,10.,11.,12.,],
         [13.,14.,15.,16.,],
     ], dtype=np.float32)
     result = vector4.create_from_matrix44_translation(mat)
     np.testing.assert_almost_equal(result, [13.,14.,15.,16.], decimal=5)
     self.assertTrue(result.dtype == np.float32)