Finding Angle Between Two Vectors Using Inner Products

In summary: \cos θ = x_1 cos x_2 + y_1 y_2...where the cosine is measured in radians, and the two vectors are normalized so that x=y.
  • #1
Cameron95
8
0
Hi all, I am having trouble understanding inner products. Specifically, using inner products to find the angle between two vectors. Our lecturer has given an example, as follows;

(u,v)= 4u1v1 + u1v2 + u2v1 + u2v2, where u=(1,0) v=(0,1)

(u,v)=|u|.|v|cosθ

1=(√4)cosθ

θ=∏/3

Surely the angle between the two vectors is ∏/2? I can't understand why it is ∏/3.
 
Physics news on Phys.org
  • #2
Cameron95 said:
Hi all, I am having trouble understanding inner products. Specifically, using inner products to find the angle between two vectors. Our lecturer has given an example, as follows;

(u,v)= 4u1v1 + u1v2 + u2v1 + u2v2, where u=(1,0) v=(0,1)

(u,v)=|u|.|v|cosθ

1=(√4)cosθ

θ=∏/3

Surely the angle between the two vectors is ∏/2? I can't understand why it is ∏/3.

An abstract vector space only has notions of "parallel" and "not parallel"; it doesn't have a notion of "angle between" or "magnitude" unless you put an inner product on that space.

If [itex]\langle \cdot, \cdot \rangle[/itex] is an inner product, then [itex]\|v\| = \sqrt{\langle v, v \rangle}[/itex] defines the magnitude of a vector, and
[tex]
\cos \theta = \frac{\langle u,v \rangle}{\|u\|\|v\|}
[/tex]
defines the angle [itex]\theta \in [0, \frac12 \pi][/itex] between [itex]u[/itex] and [itex]v[/itex]. Different inner products on the same space may give different magnitudes for, and different angles between, the same vectors.

The Euclidean inner product on [itex]\mathbb{R}^2[/itex] is the dot product, [itex](x_1,y_1) \cdot (x_2, y_2) = x_1 x_2 + y_1 y_2[/itex], with [itex]\|(x,y)\| = \sqrt{x^2 + y^2}[/itex], consistent with Pythagoras. With respect to that inner product [itex](1,0)[/itex] and [itex](0,1)[/itex] are indeed orthogonal and of unit length.

However, your inner product is not the Euclidean inner product, but is instead
[tex]
\langle u,v \rangle = 4u_1v_1 + u_1v_2 + u_2v_1 + u_2v_2
[/tex]
so [itex]\|u\| = \sqrt{4u_1^2 + 2u_1u_2 + u_2^2}[/itex]. Thus in your example,
[tex]\langle (1,0), (0,1) \rangle = 1[/tex] and
[tex]\|(1,0)\| = 2[/tex] and
[tex]\|(0,1)\| = 1[/tex] so
[tex]
\frac{\langle (1,0), (0,1) \rangle}{\|(1,0)\|\|(0,1)\|} = \frac{1}{2}
[/tex]
so [itex]\theta = \pi/3[/itex].
 
  • #3
Every inner product satisfies the Cauchy-Schwartz inequality ##\left|\langle u,v\rangle\right|\leq \|u\|\|v\|##, where the norm notation on the right is defined by ##\|x\|=\sqrt{\langle x,x\rangle}##. This means that when we're dealing with an inner product space over ##\mathbb R## (rather than ##\mathbb C##), we have
$$-1\leq\frac{\langle u,v\rangle}{\|u\|\|v\|}\leq 1,$$ for all u,v. This enables us to define the angle θ between u and v as in pasmith's post, i.e. by
$$\cos\theta =\frac{\langle u,v\rangle}{\|u\|\|v\|}.$$ This is how the idea of angles between vectors are generalized from ##\mathbb R^2## with the standard inner product, to arbitrary inner product spaces over ##\mathbb R##.
 
  • #4
Ok, so what is meant by the angle 'with respect to the inner product'? Is it one of those things you must just accept is true, as I am having trouble visualising what is going on. Thanks for your responses.
 
  • #5
Hi Cameron95! Welcome to PF! :smile:
Cameron95 said:
Ok, so what is meant by the angle 'with respect to the inner product'? … I am having trouble visualising what is going on.

The line y = 0 is orthogonal to the line x = -4y, as you can see by checking that the inner product of (a,0) and (b, -4b) is always zero.

So you could say that the angle between them is 90°

On that view, you have to adjust all the other angles to get them to fit!

(personally, i don't find the concept of the angle helpful :redface:)
 
  • #6
Cameron95 said:
Ok, so what is meant by the angle 'with respect to the inner product'? Is it one of those things you must just accept is true, as I am having trouble visualising what is going on. Thanks for your responses.

You seemed to accept that the "length" of these vectors with the new inner product was not the regular length, so why the problem over angle?

It's not accepting it as "true", it's accepting it as "defined that way". If you have a different inner product, then you can still define "length" and "angle" in terms of this inner product, but these are not the same as the regular length and angle.

As you go further in maths, you will find many generalisations such as this. For example, you can define an inner product on sets of functions and treat these like vectors. This leads to the concept of "length" of functions and "distance" and "angle" between" functions.
 
  • #7
Thank you all for your help; I think it's slightly clearer now!
 
  • #8
Cameron95 said:
Ok, so what is meant by the angle 'with respect to the inner product'?
That is exactly the question that my post answered.

Cameron95 said:
Is it one of those things you must just accept is true, as I am having trouble visualising what is going on. Thanks for your responses.
It's just a definition, so there's nothing that you need to "accept as true", except that this is what the word "angle" means to a mathematician.

I'll try again. Forget about vector spaces for a second, and think about what you know about geometry in a plane (triangles and stuff). The law of cosines implies that the angle θ between two vectors x and y in ##\mathbb R^2## satisfies the equality ##x\cdot y=|x||y|\cos\theta##. This is a theorem, not a definition.

Now let's think about vector spaces. What if the elements of the vector space are e.g. matrices or functions? What is the angle between
##\begin{pmatrix}1 & 0\\ 0 & 1\end{pmatrix}## and ##\begin{pmatrix}1 & 0\\ 0 & -1\end{pmatrix}##? What is the angle between two polynomials? Such questions don't make sense as long as there's no definition of "angle" that can be used to answer these questions. So the question is, is there something, anything, that can be calculated from two arbitrary vectors x and y that somehow "deserves" to be called "the angle between x and y"?

The answer starts with the following observations:

* For all ##x,y\in\mathbb R^2##, we have ##x\cdot y=|x||y|\cos\theta##, where ##\theta## is the angle between x and y.
* The dot product on ##\mathbb R^2## is an inner product.
* The absolute value on ##\mathbb R^2## is a norm, and for all ##x\in\mathbb R^2##, we have ##|x|=\sqrt{x\cdot x}##.
* Let V be an arbitrary inner product space over ##\mathbb R##. The Cauchy-Schwarz inequality implies that for all ##x,y\in V##, we have $$-1\leq \frac{\langle x,y\rangle}{\|x\|\|y\|} \leq 1,$$ where ##\|x\|## is defined as ##\sqrt{\langle x,x\rangle}##. This means that there's a unique real number θ such that
$$\cos\theta=\frac{\langle x,y\rangle}{\|x\|\|y\|}.$$ The first observation tells us that when the inner product space is ##\mathbb R^2## with the standard inner product, this number is the angle between the vectors. So if we're dealing with some inner product space where there is no concept of angle yet, why not just call this number "the angle between x and y"?

The only claim that you have to "accept as true" is that mathematicians have chosen to do this.
 
Last edited:

Related to Finding Angle Between Two Vectors Using Inner Products

1. What is an inner product?

An inner product is a mathematical operation that takes two vectors and produces a single scalar value. It is similar to the dot product, but allows for more complex vector spaces.

2. How do you find the angle between two vectors using inner products?

The angle between two vectors can be found using the inner product formula: θ = arccos((u · v) / (|u| * |v|)), where u and v are the two vectors and |u| and |v| are their magnitudes.

3. Why is it useful to find the angle between two vectors using inner products?

Finding the angle between two vectors using inner products can be useful in a variety of applications, such as in physics, engineering, and computer graphics. It allows for the calculation of important values such as the projection of one vector onto another and the distance between two vectors.

4. Can the angle between two vectors be negative when using inner products?

No, the angle between two vectors using inner products will always be a positive value between 0 and 180 degrees. This is because the inner product formula takes the arccosine, which only returns values between 0 and π (180 degrees).

5. Are there any limitations to using inner products to find the angle between two vectors?

One limitation to using inner products is that it only works in vector spaces with an inner product defined. This means that not all vector spaces are suitable for finding the angle between two vectors using inner products. Additionally, the accuracy of the angle calculation may be affected by rounding errors or precision limitations in the computer or calculator used to perform the calculation.

Similar threads

Replies
10
Views
1K
  • Linear and Abstract Algebra
Replies
7
Views
457
  • Linear and Abstract Algebra
Replies
9
Views
738
  • Linear and Abstract Algebra
Replies
3
Views
439
  • Calculus
Replies
4
Views
691
  • Linear and Abstract Algebra
Replies
12
Views
2K
  • General Math
Replies
7
Views
977
  • Linear and Abstract Algebra
Replies
3
Views
1K
Replies
7
Views
2K
Replies
9
Views
1K
Back
Top