Krista King Math | Online math help

View Original

How to find unit vectors and basis vectors

What are unit vectors and basis vectors?

We know that every vector, by its own definition, contains information about its direction and its magnitude (remember that “magnitude” just means “length”).

The unit vector

Any vector with a magnitude of ???1??? is called a unit vector, ???\vec{u}???. In general, a unit vector doesn’t have to point in a particular direction. As long as the vector is one unit long, it’s a unit vector.

But oftentimes we’re interested in changing a particular vector ???\vec{v}??? (with a length other than ???1???), into an associated unit vector. In that case, that unit vector needs to point in the same direction as ???\vec{v}???.

Realize that every vector ???\vec{v}??? in space will have a corresponding unit vector. It’ll be the vector that points in exactly the same direction as ???\vec{v}???, but is only one unit long. You’ll be able to find a unit vector for ???\vec{v}???, regardless of whether ???\vec{v}??? exists in ???\mathbb{R}^2???, ???\mathbb{R}^3???, or ???\mathbb{R}^n???.

Let’s look at an example of how to use the Pythagorean theorem find the unit vector that points in the direction of ???\vec{v}???, when ???\vec{v}??? is in ???\mathbb{R}^2???.

How to find the unit vector and basis vectors


Take the course

Want to learn more about Linear Algebra? I have a step-by-step course for that. :)


Finding the unit vector in the direction of some other vector

Example

Find the unit vector in the direction of ???\vec{v}=(-4,-2)???.

Let’s start by drawing a picture of the vector ???\vec{v}???.

We can then use the Pythagorean theorem to find the length of ???\vec{v}???.

???||\vec{v}||=\sqrt{a^2+b^2}???

???||\vec{v}||=\sqrt{4^2+2^2}???

???||\vec{v}||=\sqrt{16+4}???

???||\vec{v}||=\sqrt{20}???

The unit vector ???\vec{u}??? is ???1??? unit long, and sits right on top of ???\vec{v}???, pointing in the same direction as ???\vec{v}???, so it might look roughly like this:

The smaller triangle formed by the unit vector ???\vec{u}??? is similar to the larger triangle formed by ???\vec{v}???. So we can set up a proportion to find the horizontal component of ???\vec{u}???.

???\frac{-4}{\sqrt{20}}=\frac{a}{1}???

???a=\frac{-4}{\sqrt{20}}=-\frac{2}{\sqrt{5}}???

Set up a ratio to find the vertical component of the unit vector.

???\frac{-2}{\sqrt{20}}=\frac{b}{1}???

???b=\frac{-2}{\sqrt{20}}=-\frac{1}{\sqrt{5}}???

Therefore, we can say that the unit vector toward ???\vec{v}=(-4,-2)??? has components

???\vec{u}=\left(-\frac{2}{\sqrt{5}},-\frac{1}{\sqrt{5}}\right)???

If we rationalize the denominators here (like we learned to do back in Algebra), we can say that the unit vector that points in the same direction as ???\vec{v}=(-4,-2)??? is

???\vec{u}=\left(-\frac{2}{\sqrt{5}}\cdot\frac{\sqrt{5}}{\sqrt{5}},-\frac{1}{\sqrt{5}}\cdot\frac{\sqrt{5}}{\sqrt{5}}\right)???

???\vec{u}=\left(-\frac{2\sqrt{5}}{5},-\frac{\sqrt{5}}{5}\right)???


With this last example, we found the unit vector by first using the Pythagorean theorem to find the magnitude of the given vector, and then using a proportion of similar triangles to solve for the components of ???\vec{u}???. 

But there’s a simpler way to find the unit vector that points toward ???\vec{v}???. The unit vector that points in the direction of ???\vec{v}??? is always given by

???\vec{u}=\frac{1}{||\vec{v}||}\vec{v}???

where ???||\vec{v}||??? is the magnitude (length) of the vector ???\vec{v}???. If ???\vec{v}??? is an ???n???-dimensional vector, then its length is the square root of the sum of all of its squared components.

???||\vec{v}||=\sqrt{v_1^2+v_2^2+v_3^2+...+v_n^2}???

So for instance, to find the unit vector for the three-dimensional vector ???\vec{v}=(1,4,-2)???, first find the length of ???\vec{v}???.

???||\vec{v}||=\sqrt{1^2+4^2+(-2)^2}=\sqrt{1+16+4}=\sqrt{21}???

Then plug ???||\vec{v}||??? and ???\vec{v}??? into the formula for ???\vec{u}??? to find the direction of ???\vec{v}???.

???\vec{u}=\frac{1}{||\vec{v}||}\vec{v}=\frac{1}{\sqrt{21}}\begin{bmatrix}1\\4\\-2\end{bmatrix}=\begin{bmatrix}\frac{1}{\sqrt{21}}\\ \frac{4}{\sqrt{21}}\\-\frac{2}{\sqrt{21}}\end{bmatrix}???

The basis vectors

Oftentimes the unit vector is written as ???\hat{u}???, rather than with typical vector notation, ???\vec{u}???. The little “hat” above the ???u??? is there to tell us that the length of the vector is ???1???. Anytime you see a vector with the “hat” on it, it means the vector’s length is ???1???, which is why it’s typical to use this notation for the unit vector specifically.

There are a few special unit vectors that we’ll use a lot in both vector calculus and in linear algebra, which are called the standard basis vectors.

In two-dimensional space, we define two specific basis vectors, ???\hat{i}=(1,0)??? and ???\hat{j}=(0,1)???. As you can see from their components, they both have a length of ???1???. In three-dimensional space, the basis vectors are ???\hat{i}=(1,0,0)???, ???\hat{j}=(0,1,0)???, and ???\hat{k}=(0,0,1)???.

Sometimes you’ll see the basis vectors represented without the “hat,” just as the bolded characters ???\bold{i}???, ???\bold{i}???, and ???\bold{i}???.

Linear combinations of the basis vectors

Using these basis vectors for ???\mathbb{R}^2??? as a starting point, we can actually build every vector in two-dimensional space, simply by adding scaled combinations of ???\hat{i}??? and ???\hat{j}???. We’ll define this in more detail later on, but these scaled combinations (the sums of scaled vectors) are called linear combinations.

For instance, the vector ???\vec{a}=(6,4)??? moves ???6??? units in the horizontal direction, or ???\hat{i}??? times ???4???. It also moves ???4??? units in the vertical direction, or ???4??? times ???\hat{j}???. So we could write a linear combination that expresses the vector, where we scale ???\hat{i}=(1,0)??? by ???6???, and scale ???\hat{j}=(0,1)??? by ????4??.

???\vec{a}=(6,4)=6\begin{bmatrix}1\\0\end{bmatrix}+4\begin{bmatrix}0\\1\end{bmatrix}???

???\vec{a}=(6,4)=\begin{bmatrix}6\\0\end{bmatrix}+\begin{bmatrix}0\\4\end{bmatrix}???

???\vec{a}=(6,4)=\begin{bmatrix}6+0\\0+4\end{bmatrix}???

???\vec{a}=(6,4)=\begin{bmatrix}6\\4\end{bmatrix}???

Which means we can define a new notation to express a vector:

???\vec{a}=(6,4)=6\hat{i}+4\hat{j}???

We’ve expressed vectors like a coordinate point, as row and column matrices, and now as a combination of the basis vectors ???\hat{i}??? and ???\hat{j}???.


Example

Express the vector ???\vec{a}=(-3,2,-1)??? using basis vectors.

The vector ???\vec{a}=(-3,2,-1)??? is part of ???\mathbb{R}^3???, which means we’ll need to use the basis vectors for ???\mathbb{R}^3???, which are ???\hat{i}=(1,0,0)???, ???\hat{j}=(0,1,0)???, and ???\hat{k}=(0,0,1)???.

We’re moving ???-3??? units in the direction of the ???x???-axis, ???2??? units in the direction of the ???y???-axis, and ???-1??? units in the direction of the ???z???-axis.

???\vec{a}=(-3,2,-1)=-3\begin{bmatrix}1\\0\\0\end{bmatrix}+2\begin{bmatrix}0\\1\\0\end{bmatrix}-1\begin{bmatrix}0\\0\\1\end{bmatrix}???

???\vec{a}=(-3,2,-1)=\begin{bmatrix}-3\\0\\0\end{bmatrix}+\begin{bmatrix}0\\2\\0\end{bmatrix}+\begin{bmatrix}0\\0\\-1\end{bmatrix}???

???\vec{a}=(-3,2,-1)=\begin{bmatrix}-3+0+0\\ 0+2+0\\ 0+0-1\end{bmatrix}???

???\vec{a}=(-3,2,-1)=\begin{bmatrix}-3\\ 2\\ -1\end{bmatrix}???

So we can express ???\vec{a}=(-3,2,-1)??? in terms of basis vectors as

???\vec{a}=-3\hat{i}+2\hat{j}-\hat{k}???



Get access to the complete Linear Algebra course