Magnitude of a Vector

Magnitude of a 2D Vector
We can calculate the magnitude (a.k.a. length or size) of a vector in 2D using Pythagorean's Theorem:

Example
Find the lengths of the vectors v=[−3, 4] and u=[0, −1]
∣∣v∣∣=(−3)2+(4)2=25=5
∣∣u∣∣=02+(−1)2=1=1
Magnitude of a 3D Vector
We can calculate the magnitude of a vector in 3D using an extension of this formula.

Unit Vector
A unit vector is a vector that has a magnitude of 1.
Example
Show that the following vectors are all unit vectors
u=[1, 0] is a unit vector
∣∣u∣∣=12+02=1
v=[21, −21] is a unit vector
∣∣v∣∣=(21)2+(−21)2=21+21=1=1
w=[0, 53, −54] is a unit vector
∣∣w∣∣=02+(53)2+(−54)2=259+2516=1=1
Finding a Unit Vector in a Certain Direction
Given a vector v, the unit vector in the same direction as v is v^=∣∣v∣∣v
Example
Find the unit vector in the same direction as u=[1, 2, −3]
u^=∣∣ [1, 2, −3] ∣∣[1, 2, −3]
u^=12+22+(−3)2[1, 2, −3]
u^=14[1, 2, −3] or [141, 142, −143]
Special Unit Vectors
In 2D, we have the following special unit vectors:
- i=[1, 0] → unit vector along the positive x-axis
- j=[0, 1] → unit vector along the positive y-axis
In 3D, we have the following special unit vectors:
- i=[1, 0, 0] → unit vector along the positive x-axis
- j=[0, 1, 0] → unit vector along the positive y-axis
- k=[0, 0, 1] → unit vector along the positive z-axis
Example
2i−3j+k= ________
Practice: Unit Vector
Find the unit vector in the same direction as i−5k.

Directional Cosine for 3D Vectors
Given any vector v=[v1, v2, v3] in 3D, we can define the following angles:
- α is the angle v forms with the x- axis
- β is the angle v forms with the y- axis
- γ is the angle v forms with the z- axis
If v is a unit vector, then v=[cosα, cosβ, cosγ] ⟶ these 3 components are called the directional cosines of the vector v.
General Directional Cosines
Given any vector v=[v1, v2, v3],
- cosα=∣∣v∣∣v1
- cosβ=∣∣v∣∣v2
- cosγ=∣∣v∣∣v3