当前位置: 首页>>代码示例>>Python>>正文


Python Line.intersection_with方法代码示例

本文整理汇总了Python中line.Line.intersection_with方法的典型用法代码示例。如果您正苦于以下问题:Python Line.intersection_with方法的具体用法?Python Line.intersection_with怎么用?Python Line.intersection_with使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在line.Line的用法示例。


在下文中一共展示了Line.intersection_with方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_lines

# 需要导入模块: from line import Line [as 别名]
# 或者: from line.Line import intersection_with [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"
开发者ID:sanjiv510,项目名称:la,代码行数:57,代码来源:testLine.py

示例2: Line

# 需要导入模块: from line import Line [as 别名]
# 或者: from line.Line import intersection_with [as 别名]
from vector import Vector
from line import Line

l1 = Line(normal_vector=Vector(['4.046', '2.836']), constant_term='1.21')
l2 = Line(normal_vector=Vector(['10.115', '7.09']), constant_term='3.025')

print(l1.intersection_with(l2))

l1 = Line(normal_vector=Vector(['7.204', '3.182']), constant_term='8.68')
l2 = Line(normal_vector=Vector(['8.172', '4.114']), constant_term='9.883')

print(l1.intersection_with(l2))

l1 = Line(normal_vector=Vector(['1.182', '5.562']), constant_term='6.744')
l2 = Line(normal_vector=Vector(['1.773', '8.343']), constant_term='9.525')

print(l1.intersection_with(l2))
开发者ID:aleksandrpak,项目名称:solutions,代码行数:19,代码来源:main.py


注:本文中的line.Line.intersection_with方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。