0
$\begingroup$

I know that the formula to get the straight line which passes trought two points is $\frac{x - x1}{x2 - x1}=\frac{y - y1}{y2 - y1}$ but I need it in a form like $y=mx+q$.

I tried to convert it by myself, but I got stuck here: $y=\frac{y2x-y2x1}{x-x1}$

Can someone help me please?

  • 0
    which points are given?2017-02-23
  • 0
    I just need the formula for two generic points2017-02-23
  • 0
    If the line is vertical, it can’t be expressed in the desired form. To cover *all* possibilities, you need to something like $ax+by=c$ instead.2017-02-23

1 Answers 1

1

assuming we have $$P_1(x_1,y_1)$$ and $$P_2(x_2,y_2)$$ for the slope we get $$m=\frac{y_2-y_1}{x_2-x_1}$$ if $$x_1\ne x_2$$ the variable $q$ we get by inserting the coordinates of one point: $$y_2=\frac{y_2-y_1}{x_2-x_1}x_2+q$$ Can you finish this? ok from the last line we will get $$q=y_2-\frac{y_2-y_1}{x_2-x_1}x_2$$ and our straight line has the form $$y=\frac{y_2-y_1}{x_2-x_1}x+y_2-\frac{y_2-y_1}{x_2-x_1}x_2$$ or $$y=\frac{y_2-y_1}{x_2-x_1}(x-x_2)+y_2$$ Is it better now?

  • 0
    What do you mean *the variable q we get by inserting the coordinates of one point* ?2017-02-23
  • 0
    $$q$$ can expressed by the given coordinates2017-02-23
  • 0
    I still can't understand...we actually have these cordinates...how can I put them into the formula? $y2=\frac{y2−y1}{x2−x1}x2+(x1+y1)$ ?2017-02-23
  • 0
    It might be interesting to note that if $x_1=x_2$, then $m=0$.2017-02-23