Say one has two points in the x,y plane. How would one convert those two points to a line? Of course I know you could use the slope-point formula & derive the line as following: $$y - y_0 = \frac{y_1-y_0}{x_1-x_0}(x-x_0)$$ However this manner obviously doesn't hold when $x_1-x_0 = 0$ (vertical line). The more generic approach should however be capable of define every line (vertical line would simply mean B = 0); $$Ax+By +C = 0$$

But how to deduce A, B, C given two points?

  • $\begingroup$ Divide $Ax+By+C=0$ by one of $A,B,C$ whichever is non-zero to eliminate one variable $\endgroup$ Jun 17, 2013 at 9:06

1 Answer 1


Let $P_1:(x_1,y_1)$ and $P_2:(x_2,y_2)$. Then a point $P:(x,y)$ lies on the line connecting $P_1$ and $P_2$ if and only if the area of the parallellogram with sides $P_1P_2$ and $P_1P$ is zero. This can be expressed using the determinant as $$ \begin{vmatrix} x_2-x_1 & x-x_1 \\ y_2-y_1 & y-y_1 \end{vmatrix} = 0 \Longleftrightarrow (y_1-y_2)x+(x_2-x_1)y+x_1y_2-x_2y_1=0, $$ so you get (up to scale) $A=y_1-y_2$, $B=x_2-x_1$ and $C=x_1y_2-x_2y_1$.

  • $\begingroup$ Thanks.... Even though I hoped for a more direct way.... As mostly I don't have to solve simple integrals, but double/line integrals possibly using green's theorem & conversion to polar/sphere/other coordinate systems to make an integral easier. Not looking forward to what my profs will throw at me to be frank. $\endgroup$
    – paul23
    Jun 18, 2013 at 21:03
  • $\begingroup$ So (y1 - y2) * x + (x2 - x1) * y + (x1 * y2 - x2 * y1) = 0? $\endgroup$ Oct 29, 2020 at 1:28
  • 1
    $\begingroup$ @AaronFranke: Yes, isn't that precisely what I have written? $\endgroup$
    – Mårten W
    Oct 30, 2020 at 8:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .