Equation of Line in Normal FormΒΆ

On this page, we'll derive the equation of a line. It will be an equation containing the variables $x$ and $y$ that is true if $(x,y)$ is a point on the line, and false otherwise.

Note that a line is infinitely long. However, when drawing lines, we only draw a finitely long part of the line, because I can't make an image file with infinitely many pixels and attach it to this site. If you want a "finitely long line", it's called a line segment.

A normal vector of a line is a nonzero vector that is perpendicular to the line.

Note that each line has infinitely many different normal vectors.

Consider any line, and let $\vec n$ be one of its normal vectors. Let's draw $\vec n$ such that it aligns with the origin $O=(0,0)$.

We notice that the projection of $\bigvec{OP}$ onto $\vec n$ is the same for any point $P$ on the line. We call this projection $p$. In the picture, we have a positive $p$, but it could also be zero for a line going through origin, or negative in case $\vec n$ points toward the origin.

We also notice that for a point $Q$ not on the line, the projection of $\bigvec{OQ}$ onto the line will be something else than $p$. In the picture, it's less than $p$, but it would be greater than $p$ if $Q$ was on the other side of the line.

From these observations, we know that the equation of the line can be written as $$ (\text{projection of (vector from $O$ to $(x,y)$) onto $\vec n$}) = p. $$ The vector from $O$ to $(x,y)$ is $x\I + y\J$. Let $a$ and $b$ be the components of $\vec n$; that is, $\vec n = a\I + b\J$. From dot products, we know that the projection used above is $$ \frac{(x\I + y\J) \cdot \vec n}{|\vec n|} =\frac{(x\I + y\J) \cdot (a\I + b\J)}{|\vec n|} =\frac{ax+by}{|\vec n|}. $$ (We can divide by $|\vec n|$ because $\vec n$ is a normal vector, and earlier we said that normal vectors are not zero vectors.) This means that the equation of the line is $$ \frac{ax+by}{|\vec n|} = p, $$ which can be written as $$ ax+by = p|\vec n|, $$ or $$ ax+by\underbrace{{}-p|\vec n|}_{\text{call this $c$}}=0. $$ By letting $c=-p|\vec n|$, we get the following result.

Any line has an equation $ax+by+c=0$, where $a\I + b\J$ is a normal vector of the line.

The above equation is called the normal form of a line equation, because the normal vector appears in it.

Does this go the other way? Is any $ax+by+c=0$ the equation of some line? This is not the case if both $a$ and $b$ are zero, because this corresponds to $\vec n$ being zero vector above; that would mean that the equation is just $c=0$, which is true for all $(x,y)$ points or for no $(x,y)$ points depending on the value of $c$. Hence it's not the equation of any line.

Let's say that we have any equation $ax+by+c=0$, with at least one of $a$ and $b$ nonzero. We'll try to choose a line such that when we calculate the equation of the line, we get $ax+by+c=0$; this would show that any $ax+by+c=0$ equation is the equation of some line. For choosing a line, we can choose two things: which direction we want the line to go in, and where we want to locate the line. For direction, we choose the direction perpendicular to $a\I + b\J \ne \vec0$, and for location of the line, we cleverly locate the line so that what we called $p$ above ends up being $-\frac{c}{|\vec n|}$, where the $c$ came from our $ax+by+c=0$ equation. The equation of this carefully chosen line is then $$ ax+by-\underbrace{\left( -\frac{c}{|\vec n|} \right)}_p|\vec n| = 0, $$ which simplifies to $ax+by+c=0$, so our $ax+by+c=0$ equation is indeed the equation of some line.

If at least one of $a$ and $b$ is nonzero, then $ax+by+c=0$ is the equation of a line, where $a\I + b\J$ is a normal vector of the line.

Examples:

Notice how in the last example, we used two things for finding the equation of the line: the normal vector, and one known point. More generally, to find the equation of a line, you almost always need one known point of the line, and some information about what direction the line should go in. In this case, the normal vector gives the direction of the line.