Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

2.1: Lines in ℝ²

In Chapter 1.4, we drew the vector

v⃗=[3−1]\vec v=\begin{bmatrix}3\\-1\end{bmatrix}

along with 3v⃗3\vec v and −12v⃗-\tfrac12\vec v. When drawn from the origin, all three arrows lie on the same line.

<IPython.core.display.Image object>

v⃗=[3−1]\vec v=\begin{bmatrix}3\\-1\end{bmatrix} and its scalar multiples lie on the same line.

What if we drew every scalar multiple of v⃗\vec v? Positive multiples extend along one direction, negative multiples extend along the opposite direction, and 0v⃗0\vec v gives the origin. Together, they fill the entire line!

We’ll call this collection the span of v⃗\vec v and connect it to a familiar line equation. Then we’ll use orthogonality from Chapter 1.6 to describe the same line using a perpendicular vector.


Homogeneous and nonhomogeneous equations

A line in R2\mathbb R^2 has an equation ax+by=cax+by=c, where aa and bb are not both zero. Let’s start with

ℓ:3x−4y=0.\ell:\quad 3x-4y=0.

This line passes through the origin: substituting (0,0)(0,0) gives 3(0)−4(0)=03(0)-4(0)=0.

Image produced in Jupyter

The line 3x−4y=03x-4y=0 passes through the origin.

What happens if we change the right-hand side from 0 to 7? The origin no longer satisfies the equation, since 3(0)−4(0)≠73(0)-4(0)\ne7. Instead, 3x−4y=73x-4y=7 describes a parallel line.

Image produced in Jupyter

The lines 3x−4y=03x-4y=0 and 3x−4y=73x-4y=7 are parallel.

Keeping aa and bb fixed while varying cc gives parallel lines. For example, 3x−4y=c3x-4y=c describes every line parallel to ℓ\ell.

We’ll first focus on the homogeneous case: lines through the origin.


Lines as spans

The opening example suggests a second way to describe a line through the origin: take all scalar multiples of one nonzero vector along it.

For ℓ:3x−4y=0\ell:3x-4y=0, let’s use

v⃗=[43].\vec v=\begin{bmatrix}4\\3\end{bmatrix}.

Every point on ℓ\ell has the form (4t,3t)(4t,3t) for some scalar t∈Rt\in\mathbb R. Equivalently, we can write

[xy]=t[43],t∈R.\begin{bmatrix}x\\y\end{bmatrix}=t\begin{bmatrix}4\\3\end{bmatrix},\qquad t\in\mathbb R.

This is a parametric form of the line. The scalar tt is called the parameter: each value of tt gives a point on the line, and letting tt range over all real numbers gives the entire line.

Drag the slider below to change tt and watch tv⃗t\vec v sweep along the line. Positive and negative values give opposite directions; when t=0t=0, the vector is the zero vector.

Loading...

Drag the slider: the endpoint (4t,3t)(4t,3t) of tv⃗t\vec v stays on 3x−4y=03x-4y=0. The slider shows part of the line; tt can be any real number.

So ℓ=span⁡(v⃗)\ell=\operatorname{span}(\vec v). We could have picked any nonzero vector along this line, such as

12v⃗=[23/2],−12v⃗=[−2−3/2],13v⃗=[4/31].\frac12\vec v=\begin{bmatrix}2\\3/2\end{bmatrix},\qquad -\frac12\vec v=\begin{bmatrix}-2\\-3/2\end{bmatrix},\qquad \frac13\vec v=\begin{bmatrix}4/3\\1\end{bmatrix}.

Multiplying by a nonzero scalar changes the length, and possibly reverses the direction, as we saw in Chapter 1.5. It does not change the line that the vector spans:

ℓ=span⁡(v⃗)=span⁡(12v⃗)=span⁡(−12v⃗)=span⁡(13v⃗).\ell=\operatorname{span}(\vec v)=\operatorname{span}\left(\frac12\vec v\right) =\operatorname{span}\left(-\frac12\vec v\right)=\operatorname{span}\left(\frac13\vec v\right).

Normal vectors and line equations

In Chapter 1.6, we learned that two vectors are orthogonal exactly when their dot product is zero. We can use this fact to connect a line’s equation to its geometry.

Let’s return to ℓ:3x−4y=0\ell:3x-4y=0. We’ll use ℓ⊥\ell^\perp to refer to the line through the origin perpendicular to ℓ\ell.

Image produced in Jupyter

The normal vector w⃗=[3−4]\vec w=\begin{bmatrix}3\\-4\end{bmatrix} is perpendicular to ℓ:3x−4y=0\ell:3x-4y=0.

The coefficients of 3x−4y=03x-4y=0 give us the vector

w⃗=[3−4].\vec w=\begin{bmatrix}3\\-4\end{bmatrix}.

Why does this vector lie on ℓ⊥\ell^\perp? We can rewrite the equation of ℓ\ell as a dot product:

[3−4]⋅[xy]=0.\begin{bmatrix}3\\-4\end{bmatrix}\cdot\begin{bmatrix}x\\y\end{bmatrix}=0.

So (x,y)(x,y) lies on ℓ\ell exactly when [xy]\begin{bmatrix}x\\y\end{bmatrix} is orthogonal to w⃗\vec w.

We now have two ways to describe ℓ\ell: take multiples of a vector along it, or use a vector perpendicular to it. With v⃗=[43]\vec v=\begin{bmatrix}4\\3\end{bmatrix} and w⃗=[3−4]\vec w=\begin{bmatrix}3\\-4\end{bmatrix},

ℓ=span⁡(v⃗)={[xy]:w⃗⋅[xy]=0}.\ell=\operatorname{span}(\vec v) =\left\{\begin{bmatrix}x\\y\end{bmatrix}:\vec w\cdot\begin{bmatrix}x\\y\end{bmatrix}=0\right\}.

The roles reverse for ℓ⊥\ell^\perp: w⃗\vec w lies along it, and v⃗\vec v is perpendicular to it. Therefore,

ℓ⊥=span⁡(w⃗)={[xy]:v⃗⋅[xy]=0}.\ell^\perp=\operatorname{span}(\vec w) =\left\{\begin{bmatrix}x\\y\end{bmatrix}:\vec v\cdot\begin{bmatrix}x\\y\end{bmatrix}=0\right\}.

Taking the dot product with v⃗\vec v gives the equation 4x+3y=04x+3y=0 for ℓ⊥\ell^\perp.

A normal vector is not unique. For example, 3w⃗=[9−12]3\vec w=\begin{bmatrix}9\\-12\end{bmatrix} is also normal to ℓ\ell, giving 9x−12y=09x-12y=0. This is just the original equation multiplied by 3, so it describes the same line.


Affine lines

Now let’s return to 3x−4y=73x-4y=7, which does not pass through the origin.

In Chapter 1.4, we saw that a vector represents a displacement and can be drawn from any starting point. We can use that idea to shift an entire line.

Image produced in Jupyter

Starting at (1,−1)(1,-1) and adding v⃗=[43]\vec v=\begin{bmatrix}4\\3\end{bmatrix} takes us to (5,2)(5,2).

The point (1,−1)(1,-1) lies on 3x−4y=73x-4y=7. Starting there and adding any multiple of v⃗=[43]\vec v=\begin{bmatrix}4\\3\end{bmatrix} takes us to another point on the line. The vector v⃗\vec v gives its direction, just as it did for 3x−4y=03x-4y=0.

So we can describe the line as

[1−1]+span⁡(v⃗)={[1−1]+tv⃗:t∈R}.\begin{bmatrix}1\\-1\end{bmatrix}+\operatorname{span}(\vec v) =\left\{\begin{bmatrix}1\\-1\end{bmatrix}+t\vec v:t\in\mathbb R\right\}.

This gives the parametric form

[xy]=[1−1]+t[43],t∈R.\begin{bmatrix}x\\y\end{bmatrix}=\begin{bmatrix}1\\-1\end{bmatrix}+t\begin{bmatrix}4\\3\end{bmatrix},\qquad t\in\mathbb R.

Our starting point is not unique. For example, (5,2)(5,2) also lies on the line, so the same line is

{[52]+tv⃗:t∈R}.\left\{\begin{bmatrix}5\\2\end{bmatrix}+t\vec v:t\in\mathbb R\right\}.

Finding the constant from a point

Suppose we know a point on an affine line and a normal vector, but not its equation. How can we find the constant on the right-hand side?

Let p⃗\vec p be the position vector of the known point, let n⃗\vec n be a nonzero normal vector, and write

x⃗=[xy].\vec x=\begin{bmatrix}x\\y\end{bmatrix}.

A point with position vector x⃗\vec x lies on the line exactly when the displacement x⃗−p⃗\vec x-\vec p is perpendicular to n⃗\vec n. Therefore,

n⃗⋅(x⃗−p⃗)=0⟺n⃗⋅x⃗=n⃗⋅p⃗.\vec n\cdot(\vec x-\vec p)=0 \quad\Longleftrightarrow\quad \vec n\cdot\vec x=\vec n\cdot\vec p.

In general, an affine line in R2\mathbb R^2 through p⃗\vec p with nonzero normal vector n⃗\vec n has equation

n⃗⋅x⃗=n⃗⋅p⃗.\vec n\cdot\vec x=\vec n\cdot\vec p.

The right-hand side is a constant: take the dot product of the normal vector with the known point’s position vector. For our line, p⃗=[1−1]\vec p=\begin{bmatrix}1\\-1\end{bmatrix} and n⃗=[3−4]\vec n=\begin{bmatrix}3\\-4\end{bmatrix} give 3(1)−4(−1)=73(1)-4(-1)=7, recovering 3x−4y=73x-4y=7.

For another example, consider the affine line in R2\mathbb R^2

ℓ=p⃗+span⁡(v⃗),p⃗=[2−1],v⃗=[12].\ell=\vec p+\operatorname{span}(\vec v),\qquad \vec p=\begin{bmatrix}2\\-1\end{bmatrix},\qquad \vec v=\begin{bmatrix}1\\2\end{bmatrix}.

To write an equation for this line, choose a nonzero vector perpendicular to its direction:

n⃗=[2−1],n⃗⋅v⃗=2(1)−1(2)=0.\vec n=\begin{bmatrix}2\\-1\end{bmatrix},\qquad \vec n\cdot\vec v=2(1)-1(2)=0.

Then use the known point to find the constant:

n⃗⋅p⃗=2(2)−1(−1)=5.\vec n\cdot\vec p=2(2)-1(-1)=5.

The dot-product equation and its expanded form are

[2−1]⋅[xy]=5,2x−y=5.\begin{bmatrix}2\\-1\end{bmatrix}\cdot \begin{bmatrix}x\\y\end{bmatrix}=5, \qquad 2x-y=5.

To check the result, substitute the parametric coordinates of the line:

2(2+t)−(−1+2t)=5.2(2+t)-(-1+2t)=5.

This holds for every t∈Rt\in\mathbb R, as it should.

Image produced in Jupyter

The line passes through (2,−1)(2,-1). Its direction vector and normal vector are perpendicular.

Here’s a video reviewing how to find the equation of a line in R2\mathbb{R}^2.