Facebook Pixel
Mathos AI logo

Dot Product and Vector Angles

Dot Product and Angle Between Vectors

The dot product (or scalar product) is an algebraic operation that takes two equal-length sequences of numbers (usually coordinate vectors) and returns a single number (a scalar). It is a powerful tool in both algebra and geometry.

Calculating the Dot Product

For two 2D vectors u=u1,u2\vec{u} = \langle u_1, u_2 \rangle and v=v1,v2\vec{v} = \langle v_1, v_2 \rangle, the dot product is calculated by multiplying corresponding components and adding the results:

uv=u1v1+u2v2\vec{u} \cdot \vec{v} = u_1 v_1 + u_2 v_2

(This extends naturally to 3D vectors: u1v1+u2v2+u3v3u_1 v_1 + u_2 v_2 + u_3 v_3)

Finding the Angle Between Vectors

The dot product connects algebra and geometry. Geometrically, it is defined as:

uv=uvcosθ\vec{u} \cdot \vec{v} = |\vec{u}| |\vec{v}| \cos \theta

where θ\theta is the angle between the two vectors, and u|\vec{u}| and v|\vec{v}| are their magnitudes (lengths). Rearranging this gives a reliable formula for finding the angle between any two vectors:

cosθ=uvuv\cos \theta = \frac{\vec{u} \cdot \vec{v}}{|\vec{u}| |\vec{v}|}

Example: Find the angle between u=2,3\vec{u} = \langle 2, 3 \rangle and v=1,4\vec{v} = \langle -1, 4 \rangle.

  1. Find the dot product: uv=(2)(1)+(3)(4)=2+12=10\vec{u} \cdot \vec{v} = (2)(-1) + (3)(4) = -2 + 12 = 10
  2. Find the magnitudes: u=22+32=4+9=13|\vec{u}| = \sqrt{2^2 + 3^2} = \sqrt{4 + 9} = \sqrt{13} v=(1)2+42=1+16=17|\vec{v}| = \sqrt{(-1)^2 + 4^2} = \sqrt{1 + 16} = \sqrt{17}
  3. Calculate the angle: cosθ=101317=10221\cos \theta = \frac{10}{\sqrt{13}\sqrt{17}} = \frac{10}{\sqrt{221}} θ=arccos(10221)47.7\theta = \arccos\left(\frac{10}{\sqrt{221}}\right) \approx 47.7^\circ

Orthogonal (Perpendicular) Vectors

If two non-zero vectors are perpendicular, the angle between them is 9090^\circ. Since cos(90)=0\cos(90^\circ) = 0, their dot product must be zero.

Rule: Two vectors u\vec{u} and v\vec{v} are orthogonal if and only if: uv=0\vec{u} \cdot \vec{v} = 0

Vector Projection

The vector projection of u\vec{u} onto v\vec{v} gives the component (or "shadow") of u\vec{u} that lies perfectly along the direction of v\vec{v}. The formula is:

projvu=(uvv2)v\text{proj}_{\vec{v}} \vec{u} = \left( \frac{\vec{u} \cdot \vec{v}}{|\vec{v}|^2} \right) \vec{v}

Example: Find the projection of u=3,4\vec{u} = \langle 3, 4 \rangle onto v=1,0\vec{v} = \langle 1, 0 \rangle.

  1. Dot product: uv=(3)(1)+(4)(0)=3\vec{u} \cdot \vec{v} = (3)(1) + (4)(0) = 3
  2. Magnitude squared of v\vec{v}: v2=12+02=1|\vec{v}|^2 = 1^2 + 0^2 = 1
  3. Projection: projvu=(31)1,0=3,0\text{proj}_{\vec{v}} \vec{u} = \left( \frac{3}{1} \right) \langle 1, 0 \rangle = \langle 3, 0 \rangle

This means the component of 3,4\langle 3, 4 \rangle acting purely in the horizontal direction (along 1,0\langle 1, 0 \rangle) is exactly 3,0\langle 3, 0 \rangle.