# A Matrix Definition of a Line

Every so often, I see a tweet so marvellous I can't believe it's true. Then I bookmark it and forget about it for months, until I don't know what to write next.

An example is @robjlow's message from June:

a) Isn't that lovely? and b) Hang on, is it really true?

### Let's algebra

Working out the determinant using my favourite diagonal stripes method gives $x(y_1 - y_2) + y(x_2 - x_1) + (x_1 y_2 - x_2 y_1) = 0$.

Does that look plausible? Certainly it's a straight line, and certainly replacing $x$ and $y$ with either $x_1$ and $y_1$ or $x_2$ and $y_2$ makes it a true statement.

Maybe we can rearrange it into a nicer form? $y(x_1 - x_2) = x(y_1 - y_2) + (x_1 y_2 - x_2 y_1)$, or $y = \frac{y_1 - y_2}{x_1 - x_2} x + \frac{x_1 y_2 - x_2 y_1}{x_1 - x_2}$. The gradient looks right and the $y$-intercept looks plausible.

But wait, we can convince ourselves more elegantly!

### Let's algebra!

If a point lies on the line between $\br{x_1, y_1}$ and $\br{x_2, y_2}$, it can be written as (abusing notation slightly) $k \br{x_1, y_1} + \br{1-k} \br{x_2, y_2}$ - with the point where $k=0$ corresponding to $\br{x_1, y_1}$ and $k=1$ to $\br{x_2, y_2}$.

That is to say, any point that lies on the line between the two points is a linear combination of them - which means the top row of the matrix can be written as a linear combination of the other two. The rows of the matrix are not linearly independent, so its determinant is zero!

Similarly, you can show that only points on the line can be written in this form, so the determinant defines the line. How lovely!

- Thanks to Rob for the original tweet! ## Colin

Colin is a Weymouth maths tutor, author of several Maths For Dummies books and A-level maths guides. He started Flying Colours Maths in 2008. He lives with an espresso pot and nothing to prove.

#### Share

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Sign up for the Sum Comfort newsletter and get a free e-book of mathematical quotations.

No spam ever, obviously.

##### Where do you teach?

I teach in my home in Abbotsbury Road, Weymouth.

It's a 15-minute walk from Weymouth station, and it's on bus routes 3, 8 and X53. On-road parking is available nearby.