本文整理汇总了Python中Point.Point.distance_coord__方法的典型用法代码示例。如果您正苦于以下问题:Python Point.distance_coord__方法的具体用法?Python Point.distance_coord__怎么用?Python Point.distance_coord__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Point.Point
的用法示例。
在下文中一共展示了Point.distance_coord__方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Point
# 需要导入模块: from Point import Point [as 别名]
# 或者: from Point.Point import distance_coord__ [as 别名]
p2 = Point(15, 25)
p3 = Point(11, 5)
p4 = Point(8, 0)
print("Point p1(%d,%d):" % (p1.get_x(), p1.get_y()))
print("Point p2(%d,%d):" % (p2.get_x(), p2.get_y()))
print("Point p3(%d,%d):" % (p3.get_x(), p3.get_y()))
print("Point p4(%d,%d):" % (p4.get_x(), p4.get_y()))
p1.print_point()
p2.print_point()
p3.print_point()
p4.print_point()
print("Distance between points p1 and (4, 12) is", p1.distance_coord(4, 12))
print("Distance between points (5, 7) and (4, 7)", Point.distance_coord__(5, 7, 4, 7))
print("Distance between points p3 and p4 is %d " % p3.distance_point(p4))
print("Distance between points p1 and p2 is %d " % Point.distance_point__(p1, p2))
p1.set_x(0)
p1.set_y(0)
p2.set_x(1)
p2.set_y(1)
p3.set_x(2)
p3.set_y(2)
p4.set_x(3)
p4.set_y(3)
points = [p1, p2, p3, p4]
Point.print_array_of_points(points)