コード例 #1
0
ファイル: test_surfaces.py プロジェクト: zy20091082/diffusion
 def test_cp_2d(self):
     h = Hemisphere(np.zeros(2))
     points = np.array([[0, 0], [-1, -1], [-1, 1], [2, 2]])
     cp, dist, bdy, _ = h.closestPointToCartesianVec(points)
     for cp_i, dist_i, bdy_i, points_i in zip(cp, dist, bdy, points):
         cp_i2, dist_i2, bdy_i2, _ = h.closestPointToCartesian(points_i)
         self.check_cp_results((cp_i, dist_i, bdy_i),
                               (cp_i2, dist_i2, bdy_i2))
コード例 #2
0
ファイル: test_surfaces.py プロジェクト: zy20091082/diffusion
 def test_cp_3d(self):
     points = np.array([[0, 0, 0], [0, 0, -2], [0, 0, 2], [0.5, 0.5, -1],
                        [2, 2, 0]])
     h = Hemisphere()
     cp, dist, bdy, _ = h.closestPointToCartesianVec(points)
     for cp_i, dist_i, bdy_i, points_i in zip(cp, dist, bdy, points):
         # If only we were using py3... "*res_a, _ = "
         cp_i2, dist_i2, bdy_i2, _ = h.closestPointToCartesian(points_i)
         self.check_cp_results((cp_i, dist_i, bdy_i),
                               (cp_i2, dist_i2, bdy_i2))
コード例 #3
0
ファイル: test_surfaces.py プロジェクト: FPaquin/cp_matrices
 def test_cp_2d(self):
     h = Hemisphere(np.zeros(2))
     points = np.array([[0, 0],
                        [-1, -1],
                        [-1, 1],
                        [2, 2]])
     cp, dist, bdy, _ = h.closestPointToCartesianVec(points)
     for cp_i, dist_i, bdy_i, points_i in zip(cp, dist, bdy, points):
         cp_i2, dist_i2, bdy_i2, _ = h.closestPointToCartesian(points_i)
         self.check_cp_results((cp_i, dist_i, bdy_i),
                               (cp_i2, dist_i2, bdy_i2))
コード例 #4
0
ファイル: test_surfaces.py プロジェクト: FPaquin/cp_matrices
 def test_cp_3d(self):
     points = np.array([[0, 0, 0],
                        [0, 0, -2],
                        [0, 0, 2],
                        [0.5, 0.5, -1],
                        [2, 2, 0]])
     h = Hemisphere()
     cp, dist, bdy, _ = h.closestPointToCartesianVec(points)
     for cp_i, dist_i, bdy_i, points_i in zip(cp, dist, bdy, points):
         # If only we were using py3... "*res_a, _ = "
         cp_i2, dist_i2, bdy_i2, _ = h.closestPointToCartesian(points_i)
         self.check_cp_results((cp_i, dist_i, bdy_i),
                               (cp_i2, dist_i2, bdy_i2))