本文整理汇总了Python中line.Line.intersects方法的典型用法代码示例。如果您正苦于以下问题:Python Line.intersects方法的具体用法?Python Line.intersects怎么用?Python Line.intersects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类line.Line
的用法示例。
在下文中一共展示了Line.intersects方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_lines
# 需要导入模块: from line import Line [as 别名]
# 或者: from line.Line import intersects [as 别名]
def test_lines():
n1 = Vector([4.046, 2.836])
c1 = 1.21
n2 = Vector([10.115, 7.09])
c2 = 3.025
l1 = Line(n1, c1)
l2 = Line(n2,c2)
#print "l1 is parallel to l2: ", l1.is_parallel_to(l2)
print "l1 is same as l2: ", l1 ==l2
if l1.intersects(l2):
intersection = l1.intersection_with(l2)
print "intersection: ", intersection
else:
print "No intersection"
print "-"*60
n1 = Vector([7.204, 3.182])
c1 = 8.68
n2 = Vector([8.172, 4.114])
c2 = 9.883
l1 = Line(n1, c1)
l2 = Line(n2,c2)
#print "l1 is parallel to l2: ", l1.is_parallel_to(l2)
print "l1 is same as l2: ", l1 ==l2
if l1.intersects(l2):
intersection = l1.intersection_with(l2)
print "intersection: ", intersection
else:
print "No intersection"
print "-"*60
n1 = Vector([1.182, 5.562])
c1 = 6.744
n2 = Vector([1.773, 8.343])
c2 = 9.525
l1 = Line(n1, c1)
l2 = Line(n2,c2)
#print "l1 is parallel to l2: ", l1.is_parallel_to(l2)
print "l1 is same as l2: ", l1 ==l2
if l1.intersects(l2):
intersection = l1.intersection_with(l2)
print "intersection: ", intersection
else:
print "No intersection"