I have a class Point, consisting of a point with x and y coordinates, and I have to write a method that computes and returns the equation of a straight line joi
Point
class Line(object): def __init__(self,coor1,coor2): self.coor1 = coor1 self.coor2 = coor2 def distance(self): x1,y1 = self.coor1 x2,y2 = self.coor2 return ((x2-x1)**2+(y2-y1)**2)**0.5 def slope(self): x1,x2 = self.coor1 y1,y2 = self.coor2 return (float(y2-y1))/(x2-x1)