hw7/hw7.rb
# two_points_to_line could return a Line or a VerticalLine
two_points_to_line could return a Line or a VerticalLine
two_points_to_line could return a Line or a VerticalLine
def two_points_to_line(x1,y1,x2,y2) 
    if real_close(x1,x2)
      VerticalLine.new x1
    else
      m = (y2 - y1).to_f / (x2 - x1)
      b = y1 - m * x1
      Line.new(m,b)
    end
  end
def two_points_to_line ( x1 , y1 , x2 , y2 ) if real_close ( x1 , x2 ) VerticalLine . new x1 else m = ( y2 - y1 ) . to_f / ( x2 - x1 ) b = y1 - m * x1 Line . new ( m , b ) end end
two_points_to_line could return a Line or a VerticalLine
two_points_to_line could return a Line or a VerticalLine
x1
y1
x2
y2