Intereting Posts

Rational solutions of Pell's equation
limit comparison test for alternating series
Bound for the degree
Proof of Product Rule of Limits
Geometric interpretation of matrices
How to invert a very regular banded Toeplitz matrix?
Homology groups of torus
Proof that $\bigcap_{a\in A} \bigg(\, \bigcup_{b\in B} F_{a,b} \, \bigg) = \bigcup_{f\in ^AB} \bigg(\, \bigcap_{a \in A} F_{a,f(a)}\,\bigg) $
Probability that one part of a randomly cut equilateral triangle covers the other without flipping
Degree of the splitting field of $x^{p^2} -2$ over $\mathbb{Q}$, for prime p.
Irreducible in $\mathbb{Z}$
Factor $x^{14}+8x^{13}+3$ over the rationals
Local diffeomorphism from $\mathbb R^2$ onto $S^2$
Adding equations in Triangle Inequality Proof
How many non-isomorphic abelian groups of order $\kappa$ are there for $\kappa$ infinite?

While watching a video about dot products (https://www.youtube.com/watch?v=WDdR5s0C4cY), the following formula is presented for finding the angle between two vectors:

For vectors $a$, and $b$,

$$\cos( \theta ) = \frac{(a, b)}{ \| a \| \| b \| }$$

where $(a,b)$ is the dot product of $a$ and $b$.

How is this formula derived?

- Rigorously proving that a change-of-basis matrix is always invertible
- Let $A$ and $B$ be $n\times n$ matrices. Suppose $A$ is similar to $B$. Prove trace($A$) = trace($B$).
- Vector spaces of the same finite dimension are isomorphic
- Least squares problem: find the line through the origin in $\mathbb{R}^{3}$
- Maximizing the trace
- Questins on Formulae for Eigenvalues & Eigenvectors of any 2 by 2 Matrix

- Finding the polar cone of the given cone
- Matrix is conjugate to its own transpose
- Image and kernel of a matrix transformation
- Quaternions vs Axis angle
- Prove $A^tB^t = (BA)^t$
- Additive rotation matrices
- How to figure out the Argument of complex number?
- Continuous and additive implies linear
- Understanding why the roots of homogeneous difference equation must be eigenvalues
- Can axis/angle notation match all possible orientations of a rotation matrix?

There are several derivations of this online. Here’s where you can start.

Define two vectors $\textbf{a}$ and $\textbf{b}$. Then $ \textbf{a} – \textbf{b}$ is the vector that connects their endpoints and makes a triangle.

Therefore, we have a triangle with side lengths $|\textbf{a}|$, $|\textbf{b}|$, and $|\textbf{a} – \textbf{b}|$. Let the angle between the two vectors be $\theta$. By the Law of Cosines, we have

$$|\textbf{a} – \textbf{b}|^2 = |\textbf{a}|^2 + |\textbf{b}|^2 – 2 |\textbf{a}| |\textbf{b}| \cos (\theta)$$

Now, use the fact that

$$

\begin{align*}

|\textbf{a}- \textbf{b}|^2 &= (\textbf{a}- \textbf{b}) \cdot (\textbf{a}- \textbf{b})\\ &= \textbf{a} \cdot \textbf{a} – 2 (\textbf{a} \cdot \textbf{b}) + \textbf{b} \cdot \textbf{b} \\ &= |\textbf{a}|^2 – 2 (\textbf{a} \cdot \textbf{b}) + |\textbf{b}|^2

\end{align*}

$$

Simplify this equation, and you will get the desired formula.

Since $(a,b)$ is independent of the basis, just choose a basis where $a$ lies along the $x$ axis: $a=(|a|,0)$, so that:

$$

{(a,b)\over|a||b|}={b_x\over|b|}=\cos(\theta),

$$

where $\theta$ is the angle between $b$ and $x$ axis (as you may recall from trigonometry), which is the same as the angle between $a$ and $b$.

I think Augustin was answering a much more general question. In two dimensions, where we have “cosine” already defined, from trigonometry, one can show that the “dot product”, defined in some other way, is equal to the lengths of the two vectors times the cosine of the angle between them.

But in higher dimension spaces, $\mathbb{R}^n$, we can use that formula to define the **angle** between two lines.

This is a part of the geometric definition, but originally comes from the algebraic definition (see here)

In Euclidean space, you have to define a vector. With that vector, following the algebraic definition

$\vec{a} \cdot \vec{b} = \sum_i a_i b_i$

Imagine at the origin you have two vectors, pointing from $O$ to $A = (a_i)_{i=1}^n$ and to $B = (b_i)_{i=1}^n$. You can pick $n=2,3$ for the sake of imagination.

Now drop a perpendicular line from $B = (b_i)_{i=1}^n$ onto $OA$, crossing $OA$ at a point, called $H$. Let $\theta$ be the angle $(OA,OB)$. After a long calculation, the length of $OH$ is $\frac{\sum_i a_i b_i}{||a||} $.

Observe that $\cos \theta = \frac{|OH|}{|OB|}$, you now arrive at the formula

$\cos \theta = \frac{\vec{a}\cdot \vec{b}} {||a|| \cdot ||b||}$

By the law of cosines, $$\tag 1 \left\Vert{\mathbf a – \mathbf b}\right\Vert^2 = \left\Vert{\mathbf a}\right\Vert^2 + \left\Vert{\mathbf b}\right\Vert^2 – 2 \left\Vert{\mathbf a}\right\Vert \left\Vert{\mathbf b}\right\Vert \cos \theta$$ whereas, using the definition of the dot product, $$\tag 2 \left \| \mathbf a-\mathbf b \right \|^{2}=(\mathbf a-\mathbf b)\cdot (\mathbf a-\mathbf b)=\left \| \mathbf a \right \|^{2}+\left \| \mathbf b \right \|^{2}-2(\mathbf a \cdot \mathbf b)$$ Now combine $(1)$ and $(2)$

It’s a trig identity, really.

Two vectors determine a plane. Without loss of generality, we’ll take that to be the $xy$-plane. Now, let $A$ and $B$ be the angles that $\overrightarrow{a}$ and $\overrightarrow{b}$ make with the (positive) $x$-axis; and let $r$ and $s$ be the respective magnitudes. Then, the $xy$-coordinates of the vectors can be written as

$$\overrightarrow{a}= r\,(\cos A, \sin A) \qquad\text{and}\qquad \overrightarrow{b} = s \,(\cos B, \sin B )$$

so that

$$\overrightarrow{a}\cdot\overrightarrow{b} = r s \cos A \cos B + r s\sin A \sin B = r s \cos(A-B)$$

I use projection to remember this formula. Let $\vec a$ and $\vec b$ be two vectors. Then, projection of $\vec a$ over $\vec b$ is defined as:

$$proj_{\vec b}(\vec a)=\left( \frac{\vec a \cdot \vec b}{\vec b \cdot \vec b} \right) \vec b$$

Then we can form the following equality:

$$\begin{aligned}

||\vec a||\cos \theta &= ||proj_{\vec b}(\vec a)|| \\

&=\left( \frac{\vec a \cdot \vec b}{\vec b \cdot \vec b} \right) ||\vec b|| \\

&=\frac{(\vec a \cdot \vec b)}{||\vec b||^2} ||\vec b||

\end{aligned}

$$

Rearranging both sides, we get

$$\vec a \cdot \vec b=||\vec a|| ||\vec b|| \cos \theta$$

The derivation of the formula for projection is here.

Dot product of two vectors is defined as the product of the magnitude of the two vectors together with the cosine of the angle between the two vectors. Mathematically,

a.b=|a||b|cos§

- Geometric Intuition about the relation between Clifford Algebra and Exterior Algebra
- Why is $\tan((1/2)\pi)$ undefined?
- Is there any abstract theory of electrical networks?
- Can $\int|f_n|d\mu \to \int |f|d\mu$ but not $\int|f_n – f|d\mu \to 0$?
- How is $L_{2}$ Minkowski norm different from $L^{2}$ norm?
- Is XOR a combination of AND and NOT operators?
- Nitpicky question about harmonic series
- Is the fundamental group of a compact manifold finitely presented?
- Overview of basic results about images and preimages
- Topological spaces as model-theoretic structures — definitions?
- Verifying Ito isometry for simple stochastic processes
- Challenging identity regarding Bell polynomials
- Second derivative of a vector field
- Positive integers less than 1000 without repeated digits
- How to prove a number system is a fraction field of another?