Esempio n. 1
0
    def test_is_ccw3(self):
        """
        Test corner cases for non-axis-aligned segment not through origin.

        Test tag: <tc>#tests#LineSegment.is_ccw</tc>
        """
        ls = LineSegment(Point((0, 1)), Point((5, 6)))
        self.assertFalse(ls.is_ccw(Point(
            (10, 11))))  # At positive boundary beyond segment
        self.assertFalse(ls.is_ccw(Point((3, 4))))  # On segment
        self.assertFalse(ls.is_ccw(Point(
            (-10, -9))))  # At negative boundary beyond segment
        self.assertFalse(ls.is_ccw(Point((0, 1))))  # Endpoint of segment
        self.assertFalse(ls.is_ccw(Point((5, 6))))  # Endpoint of segment
Esempio n. 2
0
    def test_is_ccw2(self):
        """
        Test corner cases for vertical segment ending at origin.

        Test tag: <tc>#tests#LineSegment.is_ccw</tc>
        """
        ls = LineSegment(Point((0, -5)), Point((0, 0)))
        self.assertFalse(ls.is_ccw(Point(
            (0, 10))))  # At positive boundary beyond segment
        self.assertFalse(ls.is_ccw(Point((0, -3))))  # On segment
        self.assertFalse(ls.is_ccw(Point(
            (0, -10))))  # At negative boundary beyond segment
        self.assertFalse(ls.is_ccw(Point((0, -5))))  # Endpoint of segment
        self.assertFalse(ls.is_ccw(Point((0, 0))))  # Endpoint of segment
Esempio n. 3
0
    def test_is_ccw1(self):
        """
        Test corner cases for horizontal segment starting at origin.

        Test tag: <tc>#tests#LineSegment.is_ccw</tc>
        """
        ls = LineSegment(Point((0, 0)), Point((5, 0)))
        self.assertFalse(ls.is_ccw(Point(
            (10, 0))))  # At positive boundary beyond segment
        self.assertFalse(ls.is_ccw(Point((3, 0))))  # On segment
        self.assertFalse(ls.is_ccw(Point(
            (-10, 0))))  # At negative boundary beyond segment
        self.assertFalse(ls.is_ccw(Point((0, 0))))  # Endpoint of segment
        self.assertFalse(ls.is_ccw(Point((5, 0))))  # Endpoint of segment
    def test_is_ccw3(self):
        """
        Test corner cases for non-axis-aligned segment not through origin.

        Test tag: <tc>#tests#LineSegment.is_ccw</tc>
        """
        ls = LineSegment(Point((0, 1)), Point((5, 6)))
        self.assertFalse(ls.is_ccw(
            Point((10, 11))))  # At positive boundary beyond segment
        self.assertFalse(ls.is_ccw(Point((3, 4))))  # On segment
        self.assertFalse(ls.is_ccw(
            Point((-10, -9))))  # At negative boundary beyond segment
        self.assertFalse(ls.is_ccw(Point((0, 1))))  # Endpoint of segment
        self.assertFalse(ls.is_ccw(Point((5, 6))))  # Endpoint of segment
    def test_is_ccw2(self):
        """
        Test corner cases for vertical segment ending at origin.

        Test tag: <tc>#tests#LineSegment.is_ccw</tc>
        """
        ls = LineSegment(Point((0, -5)), Point((0, 0)))
        self.assertFalse(ls.is_ccw(
            Point((0, 10))))  # At positive boundary beyond segment
        self.assertFalse(ls.is_ccw(Point((0, -3))))  # On segment
        self.assertFalse(ls.is_ccw(
            Point((0, -10))))  # At negative boundary beyond segment
        self.assertFalse(ls.is_ccw(Point((0, -5))))  # Endpoint of segment
        self.assertFalse(ls.is_ccw(Point((0, 0))))  # Endpoint of segment
    def test_is_ccw1(self):
        """
        Test corner cases for horizontal segment starting at origin.

        Test tag: <tc>#tests#LineSegment.is_ccw</tc>
        """
        ls = LineSegment(Point((0, 0)), Point((5, 0)))
        self.assertFalse(ls.is_ccw(
            Point((10, 0))))  # At positive boundary beyond segment
        self.assertFalse(ls.is_ccw(Point((3, 0))))  # On segment
        self.assertFalse(ls.is_ccw(
            Point((-10, 0))))  # At negative boundary beyond segment
        self.assertFalse(ls.is_ccw(Point((0, 0))))  # Endpoint of segment
        self.assertFalse(ls.is_ccw(Point((5, 0))))  # Endpoint of segment