Calculates the dot product of two plane vectors as x₁x₂ + y₁y₂, and the angle between them (in degrees) from cos θ = dot product ÷ (|a||b|).
Explanation
The dot product of two plane vectors is a single number: multiply matching components and add. Simple as it looks, it measures how much the two vectors point the same way, which is precisely what lets you recover the angle between them.
a⋅b=x1x2+y1y2
The angle comes from dividing the dot product by the two magnitudes.
cosθ=∣a∣∣b∣a⋅b
(x1,y1) — the components of the first vector a
(x2,y2) — the components of the second vector b
θ — the angle between them in degrees, always somewhere from 0∘ to 180∘
Example
Let a=(3,1) and b=(1,2). The dot product is 3×1+1×2=5. The magnitudes are ∣a∣=10 and ∣b∣=5, so
cosθ=10×55=505=21
and therefore θ=45∘.
Notes
A positive dot product means the vectors lean the same way, so the angle is acute. A negative one means they lean apart, and the angle is obtuse.
A dot product of exactly 0 means the vectors are perpendicular, matching cos90∘=0. Testing for a right angle is one of the things the dot product is best at.
If either vector is the zero vector, its magnitude is 0, the division breaks down, and there is no angle to speak of. The calculator reports this rather than guessing.