# PROGRAM Point-Docstrings: import math class Point: "CLASS POINT: Represents a point in 2D space" def move(self,a,b): 'METHOD MOVE: Move the point to a new location' self.x = a self.y = b # END Reset def reset(self): 'METHOD REST: Reset the point back to the origin' self.move(0,0) # END Reset def calc_distance(self, other_point): 'METHOD CALC_DISTANCE: Get the distance between two points' return math.sqrt( (self.x - other_point.x)**2 + (self.y - other_point.y)**2) def OnAxes(self): 'OnAxes: Check if the point is on the axes' if self.x == 0 and self.y == 0: print("On the origin: (",self.x,",",self.y,")") elif self.x > 0 and self.y == 0: print("On the X-axis: (",self.x,",",self.y,")") elif self.x == 0 and self.y > 0: print("On the Y-axis: (",self.x,",",self.y,")") else: print("Just a regular point: (",self.x,",",self.y,")") # ENDIF; # END calc_distance # END Class p1 = Point() p2 = Point() p3 = Point() p4 = Point() p5 = Point() p1.move(2,2) p2.move(6,5) p3.move(6,0) p4.move(0,5) p5.move(0,0) print("") p1.OnAxes() print("") p2.OnAxes() print("") p3.OnAxes() print("") p4.OnAxes() print("") p5.OnAxes() print("") print("P1-x, P1-y is: ", p1.x, p1.y) print("P2-x, P2-y is: ", p2.x, p2.y) print("") print("Distance from P1 to P2 is:", p1.calc_distance(p2)) # END.