from chapter_11.chapter11_section2.Point import Point
from chapter_11.chapter11_section2.Rectangle import Rectangle

r = Rectangle(Point(0, 0), 10, 5)
print(r.contains(Point(10, 5)))
from chapter_11.chapter11_section2.Point import Point
from chapter_11.chapter11_section2.Rectangle import Rectangle

p = Point(0, 0)
q = Point(2, 2)
print(p.distance(q))
print(p.reflect_x())

r = Rectangle(Point(0, 0), 10, 5)
print(r.flip())
from chapter_11.chapter11_section2.Point import Point

p = Point(4, 5)
print(p.reflect_x())
from chapter_11.chapter11_section2.Point import Point
from chapter_11.chapter11_section2.Rectangle import Rectangle

r = Rectangle(Point(0, 0), 10, 5)
print(r.perimeter())
from chapter_11.chapter11_section2.Point import Point

p = Point(0, 0)
q = Point(2, 2)
print(p.distance(q))
from chapter_11.chapter11_section2.Point import Point

p = Point(1, 1)
q = Point(5, 5)
print(p.linear_equation(q))

# will fail when point are the same
Example #7
0
from chapter_11.chapter11_section2.Point import Point
p = Point(5, 10)
print(p.slope_from_origin())