For any two vectors u=(x1,y1) and v=(x2,y2) forming an angle θ, the geometric dot product u⋅v=∣u∣∣v∣cosθ equals the coordinate expression x1x2+y1y2.
Why is it true?
Expanding ∣u−v∣2 in coordinates and comparing it with the Law of Cosines on the triangle formed by u, v, and u−v cancels the squared lengths and isolates the cross-term x1x2+y1y2.
Proof sketch
Place u=OA and v=OB at the origin O so that AB=v−u=(x2−x1,y2−y1). By the Law of Cosines in △OAB, the squared side length opposite angle θ is ∣v−u∣2=∣u∣2+∣v∣2−2∣u∣∣v∣cosθ.
On the other hand, computing the squared lengths in coordinates gives ∣u∣2=x12+y12, ∣v∣2=x22+y22, and ∣v−u∣2=(x2−x1)2+(y2−y1)2=x12+y12+x22+y22−2(x1x2+y1y2).
Equating the two expressions for ∣v−u∣2 and subtracting x12+y12+x22+y22 from both sides yields −2∣u∣∣v∣cosθ=−2(x1x2+y1y2). Dividing by −2 gives u⋅v=∣u∣∣v∣cosθ=x1x2+y1y2.