本文整理匯總了Python中Point.Point.get_x方法的典型用法代碼示例。如果您正苦於以下問題:Python Point.get_x方法的具體用法?Python Point.get_x怎麽用?Python Point.get_x使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Point.Point
的用法示例。
在下文中一共展示了Point.get_x方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: print
# 需要導入模塊: from Point import Point [as 別名]
# 或者: from Point.Point import get_x [as 別名]
__author__ = 'Vlada'
from Point import Point
from StraightLine import StraightLine
from BrokenLine import BrokenLine
from Polygon import Polygon
print("------------------ CLASS Point TESTING ------------------")
p1 = Point(10, 20)
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)