How to prove the general equation of a line using linear algebra?

110 Views Asked by At

It is known that the equation $ax + by + c = 0$ can represent any line in a two dimensional Cartesian coordinate system. How to prove that using linear algebra?

Let $P = (P_x, P_y)$ and $Q = (Q_x, Q_y)$ define a straight line $r$ in such system. I can see that $k\overrightarrow{(Q - P)}$ represents a new line $s$ that has the same slope as $r$, for $k \in \mathbb{R}$. However, it's not always true that $s = r$ because $r$ seems to be translated by a factor of $c$ and I'm not sure how to deal with that.

2

There are 2 best solutions below

0
On BEST ANSWER

As we discussed in the comments, for a point $(x,y)$ on the line we have $$\begin{bmatrix}x\\y\end{bmatrix} = \begin{bmatrix}P_x\\P_y\end{bmatrix} + k\left(\begin{bmatrix}Q_x\\Q_y\end{bmatrix} - \begin{bmatrix}P_x\\P_y\end{bmatrix}\right) = \begin{bmatrix}P_x\\P_y\end{bmatrix} + k\begin{bmatrix}Q_x - P_x\\Q_y - P_y\end{bmatrix}$$

Now, define $a = Q_y - P_y$, $b = -(Q_x - P_x)$, and $-c = aP_x + bP_y$.

Then,

$$\begin{bmatrix} x\\y\end{bmatrix} \cdot \begin{bmatrix}a\\b\end{bmatrix} = \left( \begin{bmatrix}P_x\\P_y\end{bmatrix} + k\begin{bmatrix}Q_x - P_x\\Q_y - P_y\end{bmatrix} \right) \cdot \begin{bmatrix} a\\b\end{bmatrix} = \begin{bmatrix}P_x\\P_y\end{bmatrix} \cdot \begin{bmatrix}a\\b\end{bmatrix} + k\begin{bmatrix}Q_x - P_x\\Q_y - P_y\end{bmatrix} \cdot \begin{bmatrix}a\\b\end{bmatrix}$$

Now, by working out the dot products we should get $$\begin{bmatrix}x\\y\end{bmatrix} \cdot \begin{bmatrix}a\\b\end{bmatrix} = ax + by$$ $$\begin{bmatrix}P_x\\P_y\end{bmatrix} \cdot \begin{bmatrix}a\\b\end{bmatrix} = -c$$ $$\begin{bmatrix}Q_x - P_x\\Q_y - P_y\end{bmatrix} \cdot \begin{bmatrix}a\\b\end{bmatrix} = 0$$

So we get the desired equation:

$$ax + by + c = 0$$

The chosen definitions for $a$ and $b$ should make a lot of sense when you realize that $m = -\frac{a}{b}$ is the traditionally defined slope of the line.

0
On

Here's a way to map back and forth between a notion of a line as a solution to a particular kind of equation and a parameterized set of vectors.

Let's define a line passing through the origin as the collection of all scalar multiples of a given nonzero vector $\vec{v}$ where $\vec{v} = \begin{pmatrix} v_x \\ v_y \end{pmatrix} $ .

I claim that $ax + by + 0 = 0 $ corresponds to the vector $\vec{v} = \begin{pmatrix} -b \\ a \end{pmatrix}$ .

First, let's remark that when $a=0$ and $b=0$ we don't have a line. We have either have no solution when $c\ne0$ or the whole plane when $c=0$

$$ a e_x \begin{pmatrix} -b \\ a \end{pmatrix} + be_y \begin{pmatrix} -b \\ a \end{pmatrix} +0 = -ba+ab=0=0 $$

Next, I'm going to define a line in general as the pointwise sum of a line passing through the origin and an offset vector $\vec{u} = \begin{pmatrix} h \\ k \end{pmatrix} $.

This means that the points are our line are of the form

$$ \begin{pmatrix} h \\ k \end{pmatrix} + \xi \begin{pmatrix} -b \\ a \end{pmatrix} $$

where $\xi$ is a real number.

plugging this back into our earlier equation, our $x$ coordinate is $h - \xi b$ and our $y$ coordinate is $k+\xi a$ .

If we plug that in we get:

$$ a(h-\xi b) + b(k+\xi a) + c = 0 $$

simplifying we get

$$ ah + bk = c $$

So, $h$ and $k$ are overdetermined, great. Let's arbitrary pick $h=0$.

$$ bk = c $$

$$ k = \frac{c}{b} $$

Except now we have a problem if $b=0$ . Let's choose to let $k=0$ when $b=0$

$$ ah = c $$

$$ h = \frac{c}{a} $$

So that gives us a rule for converting from the equation $ax+by+c=0$ to a line, namely:

$$ \begin{pmatrix} 0 \\ cb^{-1} \end{pmatrix} + \xi \begin{pmatrix} -b \\ a \end{pmatrix} \;\;\;\;\text{when $b \ne 0$ where $\xi$ is an arbitrary real} $$

$$ \begin{pmatrix} ca^{-1} \\ 0 \end{pmatrix} + \xi \begin{pmatrix} 0 \\ a \end{pmatrix} \;\;\;\;\text{when $b = 0$ where $\xi$ is an arbitrary real} $$

We can convert back as well, but first we have to "normalize" our representation by adding a multiple of $\vec{v}$ to $\vec{u}$ .