What is the Cosine of Two Vectors?

The cosine of two vectors is a measure of the angle between them and is an essential concept in vector mathematics and physics. This measure is crucial in fields like computer science, engineering, and data analysis.

Definition and Formula

The cosine of the angle between two vectors A and B can be found using the dot product and the magnitudes of the vectors. The formula is:

$cos(theta) = frac{mathbf{A} cdot mathbf{B}}{||mathbf{A}|| cdot ||mathbf{B}||}$

Where:

  • $mathbf{A} cdot mathbf{B}$ is the dot product of the vectors.
  • $||mathbf{A}||$ and $||mathbf{B}||$ are the magnitudes (or lengths) of the vectors.
  • $theta$ is the angle between the vectors.

Dot Product

The dot product of two vectors A = $(a_1, a_2, …, a_n)$ and B = $(b_1, b_2, …, b_n)$ is calculated as:

$mathbf{A} cdot mathbf{B} = a_1b_1 + a_2b_2 + … + a_nb_n$

For example, if A = $(1, 2, 3)$ and B = $(4, 5, 6)$, their dot product is:

$mathbf{A} cdot mathbf{B} = 1cdot4 + 2cdot5 + 3cdot6 = 4 + 10 + 18 = 32$

Magnitude of a Vector

The magnitude of a vector A = $(a_1, a_2, …, a_n)$ is given by:

$||mathbf{A}|| = sqrt{a_1^2 + a_2^2 + … + a_n^2}$

Using our example vectors, the magnitudes are:

$||mathbf{A}|| = sqrt{1^2 + 2^2 + 3^2} = sqrt{1 + 4 + 9} = sqrt{14}$

$||mathbf{B}|| = sqrt{4^2 + 5^2 + 6^2} = sqrt{16 + 25 + 36} = sqrt{77}$

Applying the Formula

Now, we can find the cosine of the angle between A and B:

$cos(theta) = frac{32}{sqrt{14} cdot sqrt{77}} = frac{32}{sqrt{1078}} = frac{32}{32.83} approx 0.97$

Interpretation

The cosine value ranges from -1 to 1:

  • $cos(theta) = 1$: Vectors are in the same direction.
  • $cos(theta) = 0$: Vectors are perpendicular.
  • $cos(theta) = -1$: Vectors are in opposite directions.

In our example, $cos(theta) approx 0.97$ indicates that the vectors A and B are almost in the same direction.

Practical Applications

Understanding the cosine of two vectors is vital in various fields:

  • Computer Graphics: To calculate the angle between light sources and surfaces for shading.
  • Machine Learning: In cosine similarity, a measure used to find the similarity between two non-zero vectors.
  • Physics: To determine the work done by a force along a displacement.

Conclusion

The cosine of two vectors is a fundamental concept that helps quantify the relationship between vectors in terms of their direction and magnitude. It has broad applications across multiple disciplines, making it an essential tool in both theoretical and applied sciences.

Citations

  1. 1. Khan Academy – Dot Product
  2. 2. MIT OpenCourseWare – Linear Algebra
  3. 3. Wolfram MathWorld – Vector Magnitude

Related

(2) O3 + H → O2 + OH k2 = 1.78×10^-11 cm^3 s^-1 (3) O + OH → O2 + H k3 = 4.40×10^-11 cm^3 s^-1 (5) O + HO2 → O2 + OH k5 = 3.50×10^-11 cm^3 s^-1 (6) H + HO2 → O2 + H2 k6 = 5.40×10^-12 cm^3 s^-1 (9) OH + HO2 → O2 + H2O2 k9 = 4.00×10^-11 cm^3 s^-1 (10) HO2 + HO2 → O2 + H2O2 k10 = 2.50×10^-12 cm s^-1 (11) O + O2 + M → O3 + M k11 = 1.05×10^-34 cm^6 s^-1 (14) H + O2 + M → HO2 + M k14 = 8.08×10^-32 cm^6 s^-1 (15) H + H + M → H2O + M k15 = 3.31×10^-27 cm^6 s^-1 (16) O2 + hv → 2 O k16 = (1.26×10^-8 s^-1) φ (17) H2O + hv → H + OH k17 = (3.4×10^-6 s^-1) φ (18) O3 + hv → O2 + O k18 = (7.10×10^-5 s^-1) φ

Table 1 Reactions, rate constants and activation energies used in the model* No. Reaction kopt (M⁻¹ s⁻¹) 1 OH + H₂ → H + H₂O 3.74 x 10⁷ 2 OH + HO₂ → HO₂ + OH⁻ 5 x 10⁹ 3 OH + H₂O₂ → HO₂ + H₂O 3.8 x 10⁷ 4 OH + O₂ → O₂ + OH 9.96 x 10⁹ 5 OH + HO₂ → O₂ + H₂O 7.1 x 10⁹ 6 OH + OH → H₂O₂ 5.3 x 10⁹ 7 OH + e⁻aq → OH⁻ 3 x 10¹⁰ 8 H + O₂ → HO₂ 2.0 x 10¹⁰ 9 H + HO₂ → H₂O₂ 2.0 x 10¹⁰ 10 H + H₂O₂ → OH + H₂O 3.44 x 10⁷ 11 H + OH → H₂O 1.4 x 10¹⁰ 12 H + H → H₂ 1.94 x 10¹⁰ 13 e⁻aq + O₂ → O₂⁻ 1.9 x 10¹⁰ 14 e⁻aq + O₂ → HO₂⁻ + OH⁻ 1.3 x 10¹⁰ 15 e⁻aq + HO₂ 2.0 x 10¹⁰ 16 e⁻aq + H₂O₂ 1.1 x 10¹⁰ 17 e⁻aq + HO₂ → OH + OH⁻ 1.3 x 10¹⁰ 18 e⁻aq + H⁺ → H 2.3 x 10¹⁰ 19 e⁻aq + e⁻aq → H₂ + OH⁻ + OH⁻ 2.5 x 10⁹ 20 HO₂ + O₂ → O₂ + HO₂ 1.3 x 10⁹ 21 HO₂ + HO₂ → O₂ + H₂O₂ 8.3 x 10⁵ 22 HO₂ + HO₂ → O₂ + OH + H₂O 3.7 23 HO₂ + HO₂ → O₂ + O₂ + OH + H₂O 7 x 10⁵ s⁻¹ 24 H⁺ + O₂⁻ → HO₂ 4.5 x 10¹⁰ 25 H⁺ + O₂⁻ → O₂ 2.0 x 10¹⁰ 26 H⁺ + OH⁻ 1.4 x 10¹¹ 27 H⁺ + HO₂⁻ 2 x 10¹⁰ 28 H₂O₂ → HO₂ + H⁺ + OH⁻ 2.5 x 10⁻⁵ s⁻¹ 29 H₂O₂ → H⁺ + OH⁻ 1.4 x 10⁻⁷ s⁻¹ 30 O₂ + O₂ → O₂ + HO₂ + OH⁻ 0.3 31 O₂ + H₂O₂ → O₂ + OH + OH 16 32

(2) O3 + H → O2 + OH k2 = 1.78×10^-11 cm^3 s^-1 (3) O + OH → O2 + H k3 = 4.40×10^-11 cm^3 s^-1 (5) O + HO2 → O2 + OH k5 = 3.50×10^-11 cm^3 s^-1 (6) H2O + O → 2 OH k6 = 5.40×10^-12 cm^3 s^-1 (9) OH + HO2 → O2 + H2O k9 = 4.00×10^-11 cm^3 s^-1 (10) HO2 + HO2 → O2 + H2O2 k10 = 2.50×10^-12 cm s^-1 (11) O + O2 + M → O3 + M k11 = 1.05×10^-34 cm^6 s^-1 (14) H + O2 + M → HO2 + M k14 = 8.08×10^-32 cm^6 s^-1 (15) OH + H + M → H2O + M k15 = 3.31×10^-27 cm^6 s^-1 (16) O2 + hv → 2 O k16 = (1.26×10^-8 s^-1) φ (17) H2O + hv → H + OH k17 = (3.4×10^-6 s^-1) φ (18) O3 + hv → O2 + O k18 = (7.10×10^-8 s^-1) φ