# Oriented angle between vectors

1. Jun 30, 2011

### uwowizard

"oriented" angle between vectors

Say, we are given two vectors v1(1,2) and v2(2,1). Question - how to find an "oriented" angle in clockwise direction between the given vectors?

Note, the angle between v1 and v2 will be equal to (360-(the angle between v2 and v1))

Any suggestions will be highly appreciated. Thank you in advance.

PS: I know that one can use the dot product to find the "non-oriented" angle between vectors, but it doesn't really work in my case

2. Jun 30, 2011

### Stephen Tashi

Re: "oriented" angle between vectors

Pretend you are in 3 dimensions (append a zero z coordinate to each vector) and use the cross product.

3. Jun 30, 2011

### uwowizard

Re: "oriented" angle between vectors

Good idea, Stephen. Thanks.

4. Jun 30, 2011

### chogg

Re: "oriented" angle between vectors

The cross product won't give you the full answer. For example, it would give you the same "angle" for 10 degrees and 170 degrees, though they're clearly different angles.

Really, you can't do it without both the dot product and the cross product (or something like it). You need to add them both together. When you do, it makes a new kind of product called the "Clifford product" or "geometric product" -- just like when you add a real number and an imaginary number, it makes a new kind of number called a complex number.

This "Clifford product" contains the full information about how the two vectors relate, whereas its dot product and cross product "parts" each give only a piece of the puzzle. Again, this is just like with complex numbers: the real and imaginary parts give only partial information, but the real power comes when you treat the complex number as a unified entity.

Let's get specific. Write your vectors v1 and v2 in terms of an orthonormal basis, $(e_x, e_y)$:
$$v_1 = x_1e_x + y_1e_y$$
$$v_2 = x_2e_x + y_2e_y$$
(i.e. $x_1$ is the x-component of vector 1, and so on.) The angle you're looking for is just the product of the vectors $v_1$ and $v_2$, as we'll see in a moment. To multiply the vectors, we first need to learn how to multiply the basis vectors they're composed of.

The rule for multiplying two of the same vector is simple: because they are orthonormal, we just get 1:
$$e_x e_x = 1$$
Multiplying two different basis vectors is where your requested orientation comes in. By "$e_xe_y$", we mean:
• the plane spanned by $e_x$ and $e_y$, with
• the orientation turning $e_x$ into $e_y$.
(Notice this last bit implies that $e_xe_y = -e_ye_x$.)

We're almost ready to calculate our angle. But first, remember that both the dot and cross products are proportional to the magnitude of the vectors. If we want to get just the angle part, we'll need to divide them both by the magnitudes. In your example, both vectors have the same magnitude: $|v_1| = \sqrt{v_1 \cdot v_1} = \sqrt{2^2 + 1^2} = \sqrt{5}$, and same for $|v_2|$.

Now, let's calculate that angle!
\begin{align} \angle(v_1,v_2) &= \frac{v_1 v_2}{|v_1||v_2|} \\ &= \frac{(x_1e_x + y_1e_y) (x_2e_x + y_2e_y)}{\sqrt{5}\sqrt{5}} \\ &= (x_1x_2e_x^2 + x_1y_2e_xe_y + y_1x_2e_ye_x + y_1y_2e_y^2)/5 \\ &= ([x_1x_2 + y_1y_2] + [x_1y_2-x_2y_1]e_xe_y)/5 \end{align}
Notice the first term in square brackets looks just like the dot product, so it must be telling us $\cos\theta$. Similarly, the second term looks just like the cross product, so it's telling us $\sin\theta$. Plug in your values to get:
\begin{align} \cos\theta &= \frac{4}{5} \\ \sin\theta &= - \frac{3}{5} \end{align}
Solve these equations to get your oriented angle. Try it out for a few examples! (Notice that the orientation is given in terms of $e_xe_y$. In other words, positive angles mean you're turning in the same direction that turns $e_x$ to $e_y$.)

I hope you find this helpful!