Ejemplo n.º 1
0
 def test_for_line_and_line(self):
     """testing if a given infinite line is located inisde another
     given infinite line which should always return False
     """
     
     line1 = shapes.Line(1, 0)
     line2 = shapes.Line(1, 1)
     self.assertFalse(operations.is_inside(line1, line2))
Ejemplo n.º 2
0
 def test_for_circle_and_point(self):
     """testing if a given circle is located inside a given point
     which should always return False
     """
     
     circle = shapes.Circle(shapes.Point(0, 0), 1)
     point = shapes.Point(0, 0)
     self.assertFalse(operations.is_inside(circle, point))
Ejemplo n.º 3
0
 def test_for_line_and_point(self):
     """testing if a given infinite line is located inside a given
     point which should always return False
     """
     
     line = shapes.Line(1, 0)
     point = shapes.Point(0, 0)
     self.assertFalse(operations.is_inside(line, point))
Ejemplo n.º 4
0
 def test_for_circle_and_circle5(self):
     """the fifth test for checking if a given circle is located
     inside another given circle with them intersecting
     """
     
     circle1 = shapes.Circle(shapes.Point(0, 0), 1)
     circle2 = shapes.Circle(shapes.Point(10, 0), 1)
     self.assertFalse(operations.is_inside(circle1, circle2))
Ejemplo n.º 5
0
 def test_for_point_and_line(self):
     """testing if a given point is located inside a given infinite
     line
     """
     
     point = shapes.Point(0, 0)
     line = shapes.Line(0, 0)
     self.assertFalse(operations.is_inside(point, line))
Ejemplo n.º 6
0
 def test_for_circle_and_line(self):
     """testing if a given circle is located inside a given
     inifinite line which should always return False
     """
     
     circle = shapes.Circle(shapes.Point(0, 0), 1)
     line = shapes.Line(1, 0)
     self.assertFalse(operations.is_inside(circle, line))
Ejemplo n.º 7
0
 def test_for_point_and_point(self):
     """testing if a point is located inside another point with the
     same coordinates
     """
     
     point1 = shapes.Point(0, 0)
     point2 = shapes.Point(0, 0)
     self.assertFalse(operations.is_inside(point1, point2))
Ejemplo n.º 8
0
 def test_for_point_and_circle1(self):
     """the first test for checking if a given point is inside a
     given circle, with the point being located inside the circle
     """
     
     point = shapes.Point(0, 0)
     circle = shapes.Circle(shapes.Point(0, 0), 1)
     self.assertTrue(operations.is_inside(point, circle))
Ejemplo n.º 9
0
 def test_for_point_and_circle3(self):
     """the third test for checking if a given point is inside a
     given circle with the point being located outside the circle
     """
     
     point = shapes.Point(5, 5)
     circle = shapes.Circle(shapes.Point(0, 0), 1)
     self.assertFalse(operations.is_inside(point, circle))
Ejemplo n.º 10
0
 def test_for_circle_and_circle2(self):
     """the second test for checking if a given circle is located
     inside another given circle with them fully overlap each other
     """
     
     circle1 = shapes.Circle(shapes.Point(0, 0), 1)
     circle2 = shapes.Circle(shapes.Point(0, 0), 1)
     self.assertFalse(operations.is_inside(circle1, circle2))
Ejemplo n.º 11
0
 def test_for_circle_and_circle3(self):
     """the third test for checking if a given circle is located
     inside another given circle with the second one being inside
     the first one
     """
     
     circle1 = shapes.Circle(shapes.Point(0, 0), 2)
     circle2 = shapes.Circle(shapes.Point(0, 0), 1)
     self.assertFalse(operations.is_inside(circle1, circle2))
Ejemplo n.º 12
0
 def test_for_point_and_circle2(self):
     """the second test for checking if a given point is inside a
     given circle, with the point being located on the perimeter of
     the circle
     """
     
     point = shapes.Point(0, -1)
     circle = shapes.Circle(shapes.Point(0, 0), 1)
     self.assertFalse(operations.is_inside(point, circle))
Ejemplo n.º 13
0
 def test_for_linesegment_and_circle4(self):
     """the fourth test for checking if a given line segment is
     located inside a given circle with them being fully apart
     """
     
     end1 = shapes.Point(10, 10)
     end2 = shapes.Point(11, 11)
     line = shapes.LineSegment(end1, end2)
     circle = shapes.Circle(shapes.Point(0, 0), 1)
     self.assertFalse(operations.is_inside(line, circle))
Ejemplo n.º 14
0
 def test_for_point_and_linesegment(self):
     """testing if a given point is located inside a given line
     segment
     """
     
     point = shapes.Point(0, 0)
     end1 = shapes.Point(0, 1)
     end2 = shapes.Point(0, -1)
     line = shapes.LineSegment(end1, end2)
     self.assertFalse(operations.is_inside(point, line))
Ejemplo n.º 15
0
 def test_for_linesegment_and_line(self):
     """testing if a given line segment is located inside a given
     infinite line which should always return False
     """
     
     end1 = shapes.Point(0, 0)
     end2 = shapes.Point(1, 1)
     line1 = shapes.LineSegment(end1, end2)
     line2 = shapes.Line(1, 0)
     self.assertFalse(operations.is_inside(line1, line2))
Ejemplo n.º 16
0
 def test_for_linesegment_and_circle3(self):
     """the third test for checking if a given line segment is
     located inside a given circle with them intersecting each other
     """
     
     end1 = shapes.Point(0, 0)
     end2 = shapes.Point(3, 3)
     line = shapes.LineSegment(end1, end2)
     circle = shapes.Circle(shapes.Point(0, 0), 1)
     self.assertFalse(operations.is_inside(line, circle))
Ejemplo n.º 17
0
 def test_for_circle_and_linesegment(self):
     """testing if a given circle is located inside a given line
     segment which should always return False
     """
     
     circle = shapes.Circle(shapes.Point(0, 0), 1)
     end1 = shapes.Point(0, 0)
     end2 = shapes.Point(1, 1)
     line = shapes.LineSegment(end1, end2)
     self.assertFalse(operations.is_inside(circle, line))
Ejemplo n.º 18
0
 def test_for_linesegment_and_point(self):
     """testing if a given line segment is located inside a given
     point which should always return False
     """
     
     end1 = shapes.Point(0, 0)
     end2 = shapes.Point(1, 1)
     line = shapes.LineSegment(end1, end2)
     point = shapes.Point(0, 0)
     self.assertFalse(operations.is_inside(line, point))
Ejemplo n.º 19
0
 def test_for_linesegment_and_circle1(self):
     """the first test for checking if a given line segment is
     located inside a given circle with the line segment being
     fully inside the circle
     """
     
     end1 = shapes.Point(0, 0)
     end2 = shapes.Point(0, 0.4)
     line = shapes.LineSegment(end1, end2)
     circle = shapes.Circle(shapes.Point(0, 0), 1)
     self.assertTrue(operations.is_inside(line, circle))
Ejemplo n.º 20
0
 def test_for_line_and_polygon(self):
     """testing if a given infinite line is located inside a given
     polygon which should always return False
     """
     
     line = shapes.Line(1, 0)
     v1 = shapes.Point(0, 0)
     v2 = shapes.Point(0, 1)
     v3 = shapes.Point(1, 1)
     pol = shapes.Polygon(v1, v2, v3)
     self.assertFalse(operations.is_inside(line, pol))
Ejemplo n.º 21
0
 def test_for_rectangle_and_point(self):
     """test for checking if a given rectangle is located inside a
     given point which should always return False
     """
     
     v1 = shapes.Point(-1, -1)
     v2 = shapes.Point(1, -1)
     v3 = shapes.Point(1, 1)
     v4 = shapes.Point(-1, 1)
     rec = shapes.Rectangle(v1, v2, v3, v4)
     point = shapes.Point(0, 0)
     self.assertFalse(operations.is_inside(rec, point))
Ejemplo n.º 22
0
 def test_for_line_and_rectangle(self):
     """testing if a given infinite line is located inside a given
     rectangle which should always return False
     """
     
     line = shapes.Line(1, 0)
     v1 = shapes.Point(-1, -1)
     v2 = shapes.Point(1, -1)
     v3 = shapes.Point(1, 1)
     v4 = shapes.Point(-1, 1)
     rec = shapes.Rectangle(v1, v2, v3, v4)
     self.assertFalse(operations.is_inside(line, rec))
Ejemplo n.º 23
0
 def test_for_linesegment_and_circle2(self):
     """the second test for checking if a given line segment is
     located inisde a given circle with the line segment being
     inside the circle but with one of its ends touching the
     circle's perimeter
     """
     
     end1 = shapes.Point(0, 0)
     end2 = shapes.Point(0, 1)
     line = shapes.LineSegment(end1, end2)
     circle = shapes.Circle(shapes.Point(0, 0), 1)
     self.assertFalse(operations.is_inside(line, circle))
Ejemplo n.º 24
0
 def test_for_rectangle_and_line(self):
     """testing if a given rectangle is located insied a given
     infinite line which should always return False
     """
     
     v1 = shapes.Point(-2, 0)
     v2 = shapes.Point(0, -2)
     v3 = shapes.Point(2, 0)
     v4 = shapes.Point(0, 2)
     rec = shapes.Rectangle(v1, v2, v3, v4)
     line = shapes.Line(1, 0)
     self.assertFalse(operations.is_inside(rec, line))
Ejemplo n.º 25
0
 def test_for_rectangle_and_circle5(self):
     """the fifth test for checking if a given rectangle is located
     inside a given circle with them being fully apart
     """
     
     v1 = shapes.Point(-2, 0)
     v2 = shapes.Point(0, -2)
     v3 = shapes.Point(2, 0)
     v4 = shapes.Point(0, 2)
     rec = shapes.Rectangle(v1, v2, v3, v4)
     circle = shapes.Circle(shapes.Point(5, 5), 1)
     self.assertFalse(operations.is_inside(rec, circle))
Ejemplo n.º 26
0
 def test_for_circle_and_rectangle4(self):
     """the fourth test for checking if a given circle is located
     inside a given rectangle with them being fully apart
     """
     
     circle = shapes.Circle(shapes.Point(10, 10), 1)
     v1 = shapes.Point(-2, -2)
     v2 = shapes.Point(2, -2)
     v3 = shapes.Point(2, 2)
     v4 = shapes.Point(-2, 2)
     rec = shapes.Rectangle(v1, v2, v3, v4)
     self.assertFalse(operations.is_inside(circle, rec))
Ejemplo n.º 27
0
 def test_for_point_and_rectangle3(self):
     """the third test for checking if a given point is inside a
     given rectangle with the point being located outside the
     rectangle
     """
     
     point = shapes.Point(5, 5)
     v1 = shapes.Point(-1, -1)
     v2 = shapes.Point(1, -1)
     v3 = shapes.Point(1, 1)
     v4 = shapes.Point(-1, 1)
     rec = shapes.Polygon(v1, v2, v3, v4)
     self.assertFalse(operations.is_inside(point, rec))
Ejemplo n.º 28
0
 def test_for_circle_and_rectangle1(self):
     """the first test for checking if a given circle is located
     inside a given rectangle with the circle being fully inside
     the rectangle
     """
     
     circle = shapes.Circle(shapes.Point(0, 0), 1)
     v1 = shapes.Point(-2, -2)
     v2 = shapes.Point(2, -2)
     v3 = shapes.Point(2, 2)
     v4 = shapes.Point(-2, 2)
     rec = shapes.Rectangle(v1, v2, v3, v4)
     self.assertTrue(operations.is_inside(circle, rec))
Ejemplo n.º 29
0
 def test_for_circle_and_rectangle3(self):
     """the third test for checking if a given circle is located
     inside a given rectangle with the circle intersecting the 
     rectangle
     """
     
     circle = shapes.Circle(shapes.Point(0, -3), 2)
     v1 = shapes.Point(-2, -2)
     v2 = shapes.Point(2, -2)
     v3 = shapes.Point(2, 2)
     v4 = shapes.Point(-2, 2)
     rec = shapes.Rectangle(v1, v2, v3, v4)
     self.assertFalse(operations.is_inside(circle, rec))
Ejemplo n.º 30
0
 def test_for_circle_and_rectangle2(self):
     """the second test for checking if a given circle is located
     inside a given rectangle with the circle being inside the
     rectangle but touching one of its edges
     """
     
     circle = shapes.Circle(shapes.Point(0, -1), 2)
     v1 = shapes.Point(-2, -2)
     v2 = shapes.Point(2, -2)
     v3 = shapes.Point(2, 2)
     v4 = shapes.Point(-2, 2)
     rec = shapes.Rectangle(v1, v2, v3, v4)
     self.assertFalse(operations.is_inside(circle, rec))