# How to get a unit vector from another unit vector and angle between them?

How to get a unit vector from another unit vector and angle between them? Is it possible? I need something like this:

-

You can find the resulting vector by using a rotation matrix.

Alternatively, the unit circle $x^2 + y^2 = 1$ (the set of all vectors of length one) can be parameterised by $x = \cos\theta$, $y = \sin\theta$ where $\theta$ is the anti-clockwise angle made with the positive $x$-axis. As you know the angle the desired vector makes with the positive $x$-axis, you have the value $\theta$.

It is also worth noting that neither method relies on the vectors being unit length. If you rotate the zero vector by any angle, you get the zero vector. If you have a non-zero vector $v$, consider the unit vector $\frac{1}{\|v\|}v$ which is pointing in the direction of $v$. Apply the rotation to the unit vector and then multiply the result by $\|v\|$.

-

Rotate the original vector by the angle $\theta$ specified, and divide it by its norm. If the original vector is $\vec{u}$ then you want a vector $\vec{v}$ given by

$$\vec{v}=R(\theta)\frac{ \vec{u}}{|\vec{u}|}$$

-

Let $\,(a,b)\,$ be the wanted vector, then;

$$\frac{\sqrt 3}{2}=\cos 30^\circ=\frac{(a,b)\cdot(0,1)}{||(a,b)||\,||(0,1)||}=\frac{b}{\sqrt{a^2+b^2}}\implies$$

$$4b^2=3a^2+3b^2\iff b^2=3a^2$$

You have, of course, several options to choose from...

-

You can just multiply it (if you use column vectors, otherwise transpose it before and after) by a Rotation matrix $$\begin {pmatrix} \cos \theta & -\sin \theta \\ \sin \theta & \cos \theta \end {pmatrix}$$ But why do you show a horizontal vector as $(0,1)?$ It should be $(1,0)$ This would give the new vector as $(\cos 30^\circ, \sin 30^\circ)$

-