コード例 #1
0
 def test_inside_upper_right_corner(self):
     r, s = stick_interpolate((0.9, 0.9), (-1.0, -1.0, 1.0, 1.0))
     self.assertPointAlmostEqual(r, (0.9, 0.9))
     self.assertPointAlmostEqual(s, (-1.0, -1.0))
コード例 #2
0
 def test_beyond_bottom_center_edge(self):
     r, s = stick_interpolate((0.0, -2.0), (-1.0, -1.0, 1.0, 1.0))
     self.assertPointAlmostEqual(r, (0.0, -SQRT2))
     self.assertPointAlmostEqual(s, (0.0, SQRT2))
コード例 #3
0
 def test_inside_lower_left_corner(self):
     r, s = stick_interpolate((-0.9, -0.9), (-1.0, -1.0, 1.0, 1.0))
     self.assertPointAlmostEqual(r, (-0.9, -0.9))
     self.assertPointAlmostEqual(s, (1.0, 1.0))
コード例 #4
0
 def test_beyond_left_center_edge(self):
     r, s = stick_interpolate((-2.0, 0.0), (-1.0, -1.0, 1.0, 1.0))
     self.assertPointAlmostEqual(r, (-SQRT2, 0.0))
     self.assertPointAlmostEqual(s, (SQRT2, 0.0))
コード例 #5
0
 def test_top_center_edge(self):
     r, s = stick_interpolate((0.0, 1.0), (-1.0, -1.0, 1.0, 1.0))
     self.assertPointAlmostEqual(r, (0.0, 1.0))
     self.assertPointAlmostEqual(s, (0.0, -SQRT2))
コード例 #6
0
 def test_right_center_edge(self):
     r, s = stick_interpolate((1.0, 0.0), (-1.0, -1.0, 1.0, 1.0))
     self.assertPointAlmostEqual(r, (1.0, 0.0))
     self.assertPointAlmostEqual(s, (-SQRT2, 0.0))
コード例 #7
0
 def test_right_center_edge(self):
     r, s = stick_interpolate((1.0, 0.0), (-1.0, -1.0, 1.0, 1.0))
     self.assertPointAlmostEqual(r, (1.0, 0.0))
     self.assertPointAlmostEqual(s, (-SQRT2, 0.0))
コード例 #8
0
 def test_beyond_upper_right_corner(self):
     r, s = stick_interpolate((2.0, 2.0), (-1.0, -1.0, 1.0, 1.0))
     self.assertPointAlmostEqual(r, (1.0, 1.0))
     self.assertPointAlmostEqual(s, (-1.0, -1.0))
コード例 #9
0
 def test_beyond_and_left_upper_right_corner(self):
     r, s = stick_interpolate((1.0, 2.0), (-1.0, -1.0, 1.0, 1.0))
     self.assertPointAlmostEqual(r,
                                 (0.63245553203367588, 1.2649110640673518))
     self.assertPointAlmostEqual(s,
                                 (-0.63245553203367599, -1.264911064067352))
コード例 #10
0
 def test_inside_lower_left_corner(self):
     r, s = stick_interpolate((-0.9, -0.9), (-1.0, -1.0, 1.0, 1.0))
     self.assertPointAlmostEqual(r, (-0.9, -0.9))
     self.assertPointAlmostEqual(s, (1.0, 1.0))
コード例 #11
0
 def test_inside_upper_right_corner(self):
     r, s = stick_interpolate((0.9, 0.9), (-1.0, -1.0, 1.0, 1.0))
     self.assertPointAlmostEqual(r, (0.9, 0.9))
     self.assertPointAlmostEqual(s, (-1.0, -1.0))
コード例 #12
0
 def test_beyond_bottom_center_edge(self):
     r, s = stick_interpolate((0.0, -2.0), (-1.0, -1.0, 1.0, 1.0))
     self.assertPointAlmostEqual(r, (0.0, -SQRT2))
     self.assertPointAlmostEqual(s, (0.0, SQRT2))
コード例 #13
0
 def test_top_center_edge(self):
     r, s = stick_interpolate((0.0, 1.0), (-1.0, -1.0, 1.0, 1.0))
     self.assertPointAlmostEqual(r, (0.0, 1.0))
     self.assertPointAlmostEqual(s, (0.0, -SQRT2))
コード例 #14
0
 def test_beyond_left_center_edge(self):
     r, s = stick_interpolate((-2.0, 0.0), (-1.0, -1.0, 1.0, 1.0))
     self.assertPointAlmostEqual(r, (-SQRT2, 0.0))
     self.assertPointAlmostEqual(s, (SQRT2, 0.0))
コード例 #15
0
 def test_beyond_upper_right_corner(self):
     r, s = stick_interpolate((2.0, 2.0), (-1.0, -1.0, 1.0, 1.0))
     self.assertPointAlmostEqual(r, (1.0, 1.0))
     self.assertPointAlmostEqual(s, (-1.0, -1.0))
コード例 #16
0
 def test_center(self):
     """A singularity that we have to special case"""
     r, s = stick_interpolate((0.0, 0.0), (-1.0, -1.0, 1.0, 1.0))
     self.assertPointEqual(r, (0.0, 0.0))
     self.assertPointEqual(s, (0.0, 0.0))
コード例 #17
0
 def test_beyond_and_left_upper_right_corner(self):
     r, s = stick_interpolate((1.0, 2.0), (-1.0, -1.0, 1.0, 1.0))
     self.assertPointAlmostEqual(
         r, (0.63245553203367588, 1.2649110640673518))
     self.assertPointAlmostEqual(
         s, (-0.63245553203367599, -1.264911064067352))
コード例 #18
0
 def test_center(self):
     """A singularity that we have to special case"""
     r, s = stick_interpolate((0.0, 0.0), (-1.0, -1.0, 1.0, 1.0))
     self.assertPointEqual(r, (0.0, 0.0))
     self.assertPointEqual(s, (0.0, 0.0))