Dot product in the plane

From testwiki
Revision as of 07:58, 4 June 2023 by imported>AugPi (Cat.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Given a pair of 2D vectors:

u=(ux,uy)
v=(vx,vy)

Then their dot product is

uv:=uxvx+uyvy.

Suppose that u and v are both rotated by an angle θ:

(cosθsinθsinθcosθ)(uxuy)=(uxcosθuysinθuxsinθ+uycosθ)=(uxuy)
{ux=uxcosθuysinθuy=uxsinθ+uycosθ
{vx=vxcosθvysinθvy=vxsinθ+vycosθ
uv=uxvx+uyvy
=(uxcosθuysinθ)(vxcosθvysinθ)+(uxsinθ+uycosθ)(vxsinθ+vycosθ)
=uxvxcos2θuxvycosθsinθuyvxsinθcosθ+uyvysin2θ
+uxvxsin2θ+uxvysinθcosθ+uyvxcosθsinθ+uyvycos2θ
=uxvx(cos2θ+sin2θ)+uyvy(cos2+sin2θ)
=uxvx+uyvy=uv

applying the trigonometric form of the Pythagorean Theorem (i.e., cos2θ+sin2θ=1).

So if u and v are both rotated with the angle between them preserved then their dot product is preserved as well.

Multiplying lengths of u and v. Let u=λu, v=μv. I.e.,

u=(λux,λuy),
v=(μvx,μvy).

Then

uv=λμuxvx+λμuyvy
=λμ(uxvx+uyvy)=λμuv.

Multiplying the length of u or v also multiplies the length of the dot product uv by the same factor. (This property is called homogeneity, or linearity.)

What happens when u^ and v^ are unit vectors? Rotate both of them (by the same angle) until one of them equals the vector (1, 0). Suppose that u^=(1,0). Then v^=(vx,vy),

u^v^=vx.

Let ϕ be the angle between u^ and v^ (or between u^ and v^, equivalently).

cosϕ=vx1=vx

so u^v^=cosϕ=u^v^

For any vectors u, v which are not unit vectors, let

u=uu^,
v=vv^

where u=uu is the magnitude (or length) of vector u (by the Pythagorean Theorem) and v=vv likewise, and where u^ is a unit vector in the same direction as u; and v^ is a unit vector in the same direction as v.

So

uv=uu^vv^=uv(u^v^)
uv=uvcosϕ

where ϕ is the angle between u^ and v^ (or equivalently, between u and v). This last equation denotes the geometric interpretation of the dot product (as being proportional to the magnitudes of the vectors and the cosine of the angle between them).