Many years before Gibbs definition, ancient Greeks discovered that geometrically the product of the corresponding entries of the two sequences of numbers is equivalent to the product of their magnitudes and the cosine of the angle between them. This leads to introducing a metric (or length or distance) in the Cartesian product ℝ³ transferring it into the Euclidean space.
Originally, it was the three-dimensional physical space, but in modern mathematics there are Euclidean spaces of any positive integer dimension n, which are called Euclidean n-spaces.
Geometrical analysis yields further interesting properties of the dot product
operation that can then be used in nongeometric applications. If we rewrite the Cauchy inequality as an equality with parameter k:
it was discovered by ancient Greeks (see Example 13) that the parameter k has a geometric meaning in physical space (ℝ³ or ℝ²). This leads to the equation
where θ is called the angle between vectors u and v because it is an abstract version of three dimensional case.
Your question is anticipated: why sign of the dot product does match the sign of the cosine of the angle between the two vectors?
Example 20:
The cosine of an angle can range
between -1 and +1 while the corresponding angle (θ) varies from 0 to π. First, we verify the extreme cases.
A non-zero vector v should form an angle 0 with itself;
this is indeed the case (and can be seen as the motivation for using the cos, rather than other mathematical functions such as the sine or the Chebyshev polynomial). When vectors have different directions, say u = −v, we have u • v = (−v) • v = −∥v∥², so cosθ = −1, which leads to θ = π, the expected result for the angle between a vector and its negative.
We can also check that the definition of the angle is consistent with the geometrical definition of the cosine function for angles ±π/2 (orthogonality).
Let A(xa, ya, za), B(xb, yb, zb), and C(xc, yc, zc) be arbitrary points in ℝ³ such that corresponding vectors
\begin{align*}
\vec{AB} &= \left( x_b - x_a , y_b - y_a , z_b - z_a \right) , \\
\vec{AC} &= \left( x_c - x_a , y_c - y_a , z_c - z_a \right) , \\
\vec{BC} &= \left( x_b - x_c , y_b - y_c , z_b - z_c \right) ,
\end{align*}
are complanar in three-dimensional space, so
they can be drawn on a single plane. All these three vectors are assumed to have positive lengths:
\begin{align*}
a = \| \vec{AB} \| &= +\sqrt{\left( x_b - x_a \right)^2 + \left( y_b - y_a \right)^2 + \left( z_b - z_a \right)^2} > 0, \\
b = \| \vec{AC} \| &= +\sqrt{\left( x_c - x_a \right)^2 + \left( y_c - y_a \right)^2 + \left( z_c - z_a \right)^2} > 0, \\
c = \| \vec{BC} \| &= +\sqrt{\left( x_b - x_c \right)^2 + \left( y_b - y_c \right)^2 + \left( z_b - z_c \right)^2 } > 0.
\end{align*}
We proceed similar to Example 13 and write three equations:
\begin{align*}
c &= b\,\cos\alpha + a\,\cos\beta , \\
a &= c\,\cos\beta + \,\cos\gamma , \\
b &= c\,\cos\alpha + a\,\cos\gamma .
\end{align*}
This is a linear system with respect to three unknowns: X = cosα, Y = cosβ, and Z = cosγ, which we solve using Mathematica:
Solve[{c == b*X + a*Y, a == c*Y + b*Z, b == c*X + a*Z}, {X, Y, Z}]
{{X -> -((a^2 - b^2 - c^2)/(2 b c)),
Y -> -((-a^2 + b^2 - c^2)/(2 a c)),
Z -> -((-a^2 - b^2 + c^2)/(2 a b))}}
This yields
\[
\cos\alpha = \frac{b^2 + c^2 - a^2}{2bc} , \quad \cos\beta = \frac{a^2 + c^2 - b^2}{2ac} , \quad \gamma = \frac{a^2 + b^2 - c^2}{2ab} .
\]
Let us consider the first equation:
\[
2bc\,\cos\alpha = b^2 + c^2 - a^2 .
\]
Since according to Mathematica, we have
\[
\frac{b^2 + c^2 - a^2}{2} = \left( x_c - x_a \right) \left( x_b - x_c \right) + \left( y_a -y_c \right) \left( y_b - y_c \right) + \left( z_a - z_c \right) \left( z_b - z_c \right) ,
\]
which leads to the dot product of two vectors \( \displaystyle \quad \vec{AC} \quad\mbox{and} \quad \vec{BC} . \quad \) Therefore, upon canceling common multiple 2, we get
\[
\| \vec{AC} \| \cdot \| \vec{BC} \| \,\cos\alpha = \vec{AC} \bullet \vec{BC} .
\]
■
End of Example 20
If both vectors have unit length (∥u∥ = ∥v∥ = 1), then equation \eqref{EqDot.9}
reduces to the cosine of the angle between the two
vectors.
In statistics, the ratio
\( \displaystyle \quad r = \frac{\mathbf{u} \bullet \mathbf{v}}{\| \mathbf{u} \| \cdot \| \mathbf{v} \|} \quad \) is called the
Pearson correlation coefficient (with suitable normalization), which measures the strength of a linear relationship between two variables.
Eq.\eqref{EqDot.10} can be used to define an angle between two vectors in any higher-dimensional space.
Example 21:
What is the angle between i and i + j + 2k?
Mathematica knows how to evaluate the arccos, but the answer is given in radians, not degrees.
N[ArcCos[1/Sqrt[6]]]
1.15026
To convert this number into degrees, just make a simple multiplication
%*180/Pi
65.9052
From angle to dot product:
Suppose we are given two vectors u, v with ∥u∥ = 2 and ∥v∥ = 7. Suppose the angle between u and v is π/6. Find u • v.
Solution: From formula (9), we get
\[
\mathbf{u} \bullet \mathbf{v} = \| \mathbf{u} \| \cdot \| \mathbf{v} \| \,\cos\theta = 2 \cdot 7\cdot\cos\left( \frac{\pi}{6} \right) = 7\,\sqrt{3} .
\]
■
End of Example 21
When θ = π/2 or −π/2, the cosine of a right angle is zero, so the scalar product will be zero, regardless of the magnitudes
of the vectors. This is such an important case that it has
its own name: orthogonal. In this case, mathematicians use a special symbol for perpendicularity which is an upside-down "T." So
you can write that two vectors are orthogonal as u ⊥ v.
When θ = 0 or π, the cosine of such angle is either +1 or −1. Hence the dot product is reduced to the product of the magnitudes of the two
vectors. The term for this situation is collinear (meaning
on the same line). This also means that the dot product of
a vector with itself is simply ±∥u∥², which is the same result obtained algebraically in Eq.(2).
Cosine is positive for acute angle (−π/2 < θ < π/2) and negative for obtuse angle, π/2 < θ < 3π/2. We visualize all these situations with figures below:
The polar coordinate system specifies a given point P(x, y) on the plane by using a distance r and an angle θ as its two coordinates (r, θ), where r is the point's distance from a reference point called the pole, and θ is the point's direction from the pole relative to the direction of the abscissa. The distance r from the pole is called the radial coordinate, radial distance or simply radius, and the angle θ is called the angular coordinate, polar angle, or azimuth, measured in counterclockwise direction stating at zero from a reference direction (abscissa). Note that the origin (0, 0) has no polar coordinates.
The polar coordinates r and θ can be converted to the Cartesian coordinates x and y by using the trigonometric functions sine and cosine or complex numbers:
\[
\begin{split}
x & = r\,\cos\theta , \\
y &= r\,\sin\theta ,
\end{split} \qquad\mbox{or}\qquad z = x + {\bf j}\,y = r\,e^{{\bf j}\,\theta} \in \mathbb{C} ,
\]
with \( \displaystyle \quad r = \| \begin{bmatrix} x & y \end{bmatrix} \| = +\sqrt{x^2 + y^2} . \quad \)
It makes no sense to define dot product in polar coordinates similar to the Cartesian coordinates:
Since arguments of these two vectors are θ₁ ≅ -1.849 and θ₂ ≅ -0.674741, their difference is θ₁ − θ₂ ≅ -1.17436
-1.8490959858000078 + 0.6747409422235527
-1.17436
So the cosine of their difference is
Cos[%]
0.386138
Using Mathematica, we determine the dot product of vectors u and v in polar form:
Sqrt[53]*Sqrt[41]*0.386138
18.
which is accurate up to 16 decimal places.
■
End of Example 22
The polar coordinate system can be extended to three dimensions in two ways: the cylindrical coordinate system adds a second distance coordinate, and the spherical coordinate system adds a second angular coordinate. These two extensions of the polar coordinate system suffers the same drawback---the original is a singular point not having proper dimensions. When vector u = [x, y, z] = xi + yj + zk ∈ ℝ³ is expressed via cylindrical coordinates, its components become
\[
x = r\,\cos\theta , \quad y = r\,\sin\theta , \quad z = z,
\]
We convert these two vectors into cylindrical coordinates. To achive this, we extract two-dimensional part of each vector and find their polar forms:
\[
\mathbf{u} = \mathbf{u}_2 + 3\,\mathbf{k} , \qquad \mathbf{v} = \mathbf{v}_2 + 9\,\mathbf{k} ,
\]
where k is the unit vector in applicat (z-) direction and
\[
\mathbf{u}_2 = \begin{bmatrix} -6&-1 \end{bmatrix} = - 6{\bf i} - {\bf j} , \qquad \mathbf{v}_2 = \begin{bmatrix} 1&-4 \end{bmatrix} = {\bf i} -4{\bf j} .
\]
Using Mathematica, we convert two dimensional vectors u₂ = [−6, −1] and v₂ = [1, −4] into polar form:
\[
\mathbf{u}_2 = \| \mathbf{u}_2 \|\, e^{{\bf j} \theta_1} = \sqrt{37}\,e^{{\bf j} \theta_1} \approx 6.08276\,e^{-2.97644{\bf j}}
\]
Using the dot product formula for two dimensional vectors in polar form
\[
\mathbf{u} \bullet \mathbf{v} = \| \mathbf{u} \| \cdot \| \mathbf{u} \| \cdot \cos\left( \theta_1 - \theta_2 \right) ,
\]
we obtain u₂ • v₂ = −1.99984.
Sqrt[37] * Sqrt[17] * Cos[-2.97644 + 1.32582]
-1.99984
Since 3k • 9k = 27, we find the scalar product of u and v to be
\[
\mathbf{u} \bullet \mathbf{v} = 27 - 1.99984 = 25.0002 .
\]
■
End of Example 23
The radius vector of a point in space with spherical coordinates (ρ, 𝜃, 𝜙) can be written as
with rectangular coordinate unit vectors i (abscissa), j (ordinate), and k (applicate).
Thus, the components of the radius vector with respect to the "spherical basis" form a vector field because they vary from point to point. Moreover, the radius vector has coordinates (ρ, 0, 0) because θ and ϕ have no physical dimension, and cannot be the components of a radius vector. The origin (0, 0, 0) has no spherical coordinates.
When spherical coordinates (ρ₁, θ₁, ϕ₁) and (ρ₂, θ₂, ϕ₂) are known for two vectors u and v, we have
Now we calculate the dot product of these two vectors using spherical coordinate formula
\begin{align*}
\mathbf{u} \bullet \mathbf{v} &= \rho_1 \rho_2 \left[ \sin\phi_1 \sin\phi_2 \cos \left( \theta_1 - \theta_2 \right) + \cos\phi_1 \cos\phi_2 \right]
\\
&= \sqrt{83}\cdot \sqrt{70} \left[ \sin\phi_1 \sin\phi_2 \cos \left( \theta_1 - \theta_2 \right) + \cos\phi_1 \cos\phi_2 \right]
\end{align*}
We calculate each term in the last expression separately.
Since the product of vector norms is
\[
\| \mathbf{u} \| \cdot \| \mathbf{v} \| = \sqrt{83} \cdot \sqrt{70} \approx 76.2234 ,
\]
N[Sqrt[83] * Sqrt[70]]
76.2234
we are able to finish our calculations:
Sqrt[83] * Sqrt[70] * (0.0131202 + 0.354222)
28.0001
However, if we use the six digit approximation of norm product, we will get less accurate answer (which is correct within 6 decimal places)
76.2234 * (0.0131202 + 0.354222)
28.000128.0001
■
End of Example 24
It is not always guaranteed that one can use such special coordinate systems (polar coordinates are an example in which the local orthonormal basis of vectors is not the coordinate basis). However, the dot product between a vector x and a covector y is invariant
under all transformations because this product defines a functional generated by covector y. Then the given dot product is just one representation of this linear functional in particular coordinates. Making linear transformation with matrix A, we get