# Geometric interpretation of the addition of linear equations in general form

I have a very simple question: suppose I have two 2D linear equations in general form

$$a_1x + b_1y + c_1 = 0$$ $$a_2x + b_2y + c_2 = 0$$

I'd like to know what's the (intuitive) geometric interpretation of their addition and subtraction

$$(a_1 + a_2)x + (b_1 + b_2)y + (c_1 + c_2) = 0$$ $$(a_1 - a_2)x + (b_1 - b_2)y + (c_1 - c_2) = 0$$

• I don't think that contains too much geometric intuition there. Consider adding up $y=x$ and $y=2x$ to $y=3x$. It just raise or lower one line by the value of the other line – Shuchang Oct 12 '13 at 1:19

Consider the lines given by the following equations: \begin{align} 1 x + 1 y - 1 &= 0 &(A) \\ 2 x + 3 y - 4 &= 0 &(B) \end{align} Their sum (in your sense) has the equation $$3 x + 4 y - 5 = 0 \qquad (A+B)$$

However, that first line is also given by this equation (multiplying-through by $-2$ doesn't change the solution set): $$-2 x - 2 y + 2 = 0 \qquad (A^\prime)$$ but now the sum with $(B)$ is $$0 x + 1 y - 2 = 0 \qquad (A^\prime+B)$$ which represents an entirely different line than the previous sum.

Unfortunately, your notion of "addition" for lines is (as we say) "not well-defined", because a line does not have a unique equation that describes it.

To salvage the idea, you need to try to find a unique representative equation for a given line.

You might consider requiring that the $x$ coefficient must be $1$; this would allow us to reject $(A^\prime)$ from our addition process, but it would mean re-writing $(B)$ as $1 x + \frac{3}{2}y- 2 = 0$ prior to the addition process. So, the sum of the lines represented by $(A)$ and $(B)$ is the line represented by $$2 x + \frac{5}{2}y - 3 = 0$$ which you would re-write as $$1 x + \frac{5}{4}y - \frac{3}{2} = 0$$ if you wanted to add it to another line.

That seems to work fine, except ...

• There's no such representative equation for a horizontal line (since all representative equations have $x$ coefficient $0$).
• Subtraction will always result in a horizontal line by killing the $x$ coefficient!

Hmmm ... So, you can't require the $x$-coefficient to be $1$ (or any particular number), because sometimes there isn't an $x$ coefficient; the same goes for the $y$ coefficient ... and also for the constant term. Hmmm ...

There's a concept that does a little better: Call a line equation "normal" if it has the form $$p x + q y - r = 0 \quad \text{where} \quad p^2 + q^2 = 1 \quad \text{and} \quad r \geq 0$$

This is better than the first attempt, because, if the $x$-coefficient is $0$, we just make the $y$-coefficient $1$, and vice-versa. (Note: If both are zero, then we don't have a line equation at all!) This strategy handles every kind of line ---horizontal, vertical, slanty--- because every line equation can be converted to normal form if it isn't in that form already. (I'll let you do web searches about that. Yes, "normal form" is an actual thing ... and a useful thing at that!)

This all works pretty well for what you want to do. The actual arithmetic involved in this line addition and subtraction gets a little ugly with all the square roots floating around, but at least the operations are possible because everything's well-defined. Well, almost everything.

The problem in this case is the zero constant term. Both $$\frac{3}{5}\;x + \frac{4}{5}\; y = 0 \qquad \text{and} \qquad -\frac{3}{5}\;x - \frac{4}{5}\;y = 0$$ are valid normal forms of a particular line passing through the origin, but they give exactly opposite results with your addition and subtraction operations. It seems we can't win.

We could try imposing other rules to decide these edge cases. "The $y$-coefficient should not be negative" would do it in the above case, but it's no help with the equation for the $y$ axis: $1x = 0$ and $-1x=0$ both still work. How about "At least one coefficient must be positive"? That seems definitive, but it's awfully arbitrary, as is all of this when you get down to it. You just want to add and subtract lines; the geometry doesn't ---and shouldn't--- care about the technicalities of the algebra, so why should those technicalities be such a bother? Somehow, there's something not-right about this avenue of investigation. (That's certainly the sense I got when I first traveled the avenue as a proto-mathematician long ago.)

Maybe you'll find a resolution you find satisfying. (I encourage you to keep looking.) Or maybe your attention will be grabbed (as mine was) by this thought:

Multiplication avoids these problems!

With the examples from the top of this post, $$( 1 x + 1 y - 1 )( 2 x + 3 y - 4 ) = 0 \qquad (A \times B)$$ and $$(-2 x - 2 y + 2 )( 2 x + 3 y - 4 ) = 0 \qquad (A^\prime \times B)$$ represent the same set of points in the plane. Of course they do: that pesky multiplied-through $-2$ is easily nullified by factoring back out and canceling. Multiplied-through constants have no effect! This means that we don't have to care about the exact form of the equation (so long as there's a "$0$" on the right-hand-side). Our mathematical life just got a lot easier.

Now, the result of this multiplication (obviously?) isn't a line equation, but it has a pretty clear geometric interpretation. I'll leave that for you to consider.

• Thank you for this interesting answer! I was led to this question through a very indirect path (i.e. a machine learning problem), and I'm not sure if it makes sense to talk about it here, but I'll take a shot at it anyway.. – cjauvin Oct 13 '13 at 15:13
• As I was studying the question of how to visualize the decision boundaries of a softmax regression model, I realized that the parameters of the decision boundary between class $i$ and $j$ can be computed as $\theta_i - \theta_j$, where the $\theta$s can be interpreted as the parameters of linear equations in general form (as is clear at least for the 2D example I've been studying: cjauvin.blogspot.ca/2013/10/softmax-regression-101.html). I've been trying really hard to find an intuitive way to understand this in geometric terms, to no avail. – cjauvin Oct 13 '13 at 15:19

In general, if you have a system of two linear equations whose solution is a line $L$ in $3$-space, you can visualize the general linear combination of the equations as giving another plane containing $L$. Think of this as different positions of a revolving door, pivoting around $L$.

Note that you can write the linear equations above as follows: $$\begin{pmatrix} a_1& b_1\\ a_2&b_2 \end{pmatrix} \begin{pmatrix} x\\ y \end{pmatrix}= \begin{pmatrix} -c_1\\ -c_2 \end{pmatrix}$$ Now the addition and subtraction means multiplication of the previous equation by following matrix: $$T= \begin{pmatrix} 1& -1\\ 1& 1 \end{pmatrix}=\sqrt 2 \begin{pmatrix} \cos(\frac{\pi}{4})&-\sin(\frac{\pi}{4})\\ \sin(\frac{\pi}{4})&\cos(\frac{\pi}{4}) \end{pmatrix}=\sqrt 2 R_{\frac{\pi}{4}}.$$ $R_{\frac{\pi}{4}}$ is the rotation matrix and therefore the effect of multiplication by $T$ is indeed the rotation of lines by $\frac{\pi}{4}$ and then the scaling (homothety) by $\sqrt 2$.