本文整理汇总了Python中karta.vector.geometry.Line.intersections方法的典型用法代码示例。如果您正苦于以下问题:Python Line.intersections方法的具体用法?Python Line.intersections怎么用?Python Line.intersections使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类karta.vector.geometry.Line
的用法示例。
在下文中一共展示了Line.intersections方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_line_intersection_horizontal
# 需要导入模块: from karta.vector.geometry import Line [as 别名]
# 或者: from karta.vector.geometry.Line import intersections [as 别名]
def test_line_intersection_horizontal(self):
line0 = Line([(-2.5, 2.5), (2.5, 2.5)])
line1 = Line([(0.0, 0.0), (1.0, 5.0)])
self.assertTrue(line0.intersects(line1))
self.assertEqual(line0.intersections(line1), Multipoint([(0.5, 2.5)]))
return
示例2: test_line_intersection_vertical
# 需要导入模块: from karta.vector.geometry import Line [as 别名]
# 或者: from karta.vector.geometry.Line import intersections [as 别名]
def test_line_intersection_vertical(self):
line0 = Line([(2.5, 2.5), (2.5, -2.5)])
line1 = Line([(1.5, 2.5), (3.5, -2.5)])
self.assertTrue(line0.intersects(line1))
self.assertEqual(line0.intersections(line1), Multipoint([(2.5, 0.0)]))
return
示例3: test_line_intersection
# 需要导入模块: from karta.vector.geometry import Line [as 别名]
# 或者: from karta.vector.geometry.Line import intersections [as 别名]
def test_line_intersection(self):
line0 = Line([(0.0, 0.0), (3.0, 3.0)])
line1 = Line([(0.0, 3.0), (3.0, 0.0)])
self.assertTrue(line0.intersects(line1))
self.assertEqual(line0.intersections(line1), Multipoint([(1.5, 1.5)]))
return