Ctrl+k

Determine the angle between two vectors

The angle between two nonzero vectors is the smallest angle from one vector’s direction to the other, determined from their dot product by cosθ=abab\cos\theta=\frac{\mathbf a\cdot\mathbf b}{\|\mathbf a\|\|\mathbf b\|}, using component form in two or three dimensions and 0θ1800\leq\theta\leq180^\circ (or 0θπ0\leq\theta\leq\pi). The signs of the dot product identify acute, right, or obtuse relationships; the zero vector has no direction and therefore no defined angle, supporting geometric reasoning about perpendicularity, projections, and vector applications.

Detailed Explanation: Determine the angle between two vectors

For two nonzero vectors a\mathbf a and b\mathbf b, the angle θ\theta between them is found using the dot product formula:

cosθ=ab a  b .\cos\theta=\frac{\mathbf a\cdot\mathbf b}{\ \vert \mathbf a\ \vert \ \vert \mathbf b\ \vert }.

The angle is always chosen between 00^\circ and 180180^\circ.

Worked example

Find the angle between

a=(21)andb=(13).\mathbf a=\begin{pmatrix}2\\1\end{pmatrix} \quad\text{and}\quad \mathbf b=\begin{pmatrix}1\\3\end{pmatrix}.

Step 1: Find the dot product.

Multiply corresponding components and add:

ab=(2)(1)+(1)(3)=2+3=5.\mathbf a\cdot\mathbf b=(2)(1)+(1)(3)=2+3=5.

Step 2: Find the length of each vector.

For a\mathbf a:

 a =22+12=5.\ \vert \mathbf a\ \vert =\sqrt{2^2+1^2}=\sqrt5.

For b\mathbf b:

 b =12+32=10.\ \vert \mathbf b\ \vert =\sqrt{1^2+3^2}=\sqrt{10}.

Step 3: Substitute into the formula.

cosθ=5(5)(10)=550=12.\cos\theta =\frac{5}{(\sqrt5)(\sqrt{10})} =\frac{5}{\sqrt{50}} =\frac{1}{\sqrt2}.

Step 4: Use the inverse cosine.

θ=cos1(12)=45.\theta=\cos^{-1}\left(\frac{1}{\sqrt2}\right)=45^\circ.

Therefore, the angle between the vectors is

45.\boxed{45^\circ}.

Because the dot product was positive, the angle is acute. In general:

  • If ab>0\mathbf a\cdot\mathbf b>0, the angle is acute.
  • If ab=0\mathbf a\cdot\mathbf b=0, the vectors are perpendicular, so the angle is 9090^\circ.
  • If ab<0\mathbf a\cdot\mathbf b<0, the angle is obtuse.

The zero vector cannot be used because it has no direction, so its angle with another vector is undefined.

Learn by doing: Determine the angle between two vectors

Click a topic below to practice the foundational skills you'll need, learn the steps, or master this skill

Practice with unlimited practice problems

Vectors - Dot Product - Grid, Geometric Formula and Dot Product to Angle


    ?