So you're given the points [itex]\vec{p}_1=(x_1, y_1)[/itex] and [itex]\vec{p}_2=(x_2, y_2)[/itex].
A line is given by the equation
[itex]
a x + b y <br />
=\begin{pmatrix} a & b \end{pmatrix} \cdot \begin{pmatrix} x \\ y \end{pmatrix} <br />
= c[/itex]
Which, assuming [itex]c \neq 0[/itex], can be rescaled to
[itex]
\begin{pmatrix} a & b \end{pmatrix} \cdot \begin{pmatrix} x \\ y \end{pmatrix} = 1[/itex]
Then the two points must satisfy
[itex]\begin{align}<br />
&\begin{pmatrix} a & b \end{pmatrix}\cdot\begin{pmatrix}x_1&x_2 \\ y_1&y_2\end{pmatrix} = \begin{pmatrix} 1 & 1 \end{pmatrix} \\<br />
\implies<br />
&\begin{pmatrix} a & b \end{pmatrix} = \begin{pmatrix} 1 & 1 \end{pmatrix}<br />
\begin{pmatrix}x_1&x_2 \\ y_1&y_2\end{pmatrix}^{-1}<br />
=\frac{1}{x_1 y_2 - x_2 y_1}\begin{pmatrix} y_1-y_2 & x_1-x_2\end{pmatrix}<br />
\end{align}[/itex]
And so we have the equation for the line. (This is just "[URL rule[/URL])
Note that if [itex]\det(\vec{p}_1, \vec{p}_2) = x_1 y_2 - x_2 y_1 = 0 \,,[/itex] (which happens when [itex]\vec{p}_1\propto\vec{p}_2[/itex])
then the above does not make sense and the line must go through the origin, i.e. [itex]c=0[/itex].
In which case,
[itex]a x = - b y \quad \implies \quad y = -\frac{a}{b}x[/itex]
and we can just use either point to find the single parameter determining the line
[itex]\frac{a}{b} = -\frac{y_1}{x_1} = -\frac{y_2}{x_2} \ .[/itex]