# Ask Uncle Colin: Rotating vectors

Dear Uncle Colin,

I need to find a unit vector in the xy-plane that makes an angle of 45 degrees with the vector $3\bi + 4\bj$. How would you do that?

- Don’t Enjoy Maths Of Integer Vectors Rotating Enough

Hi, DEMOIVRE, and thanks for your message! I can think of several ways to approach this.

### Method 1: sneaky complex numbers

Instead of the *vector* $3\bi + 4\bj$, consider the complex number $3 + 4\i$.

To rotate the point in the Argand diagram corresponding to $z$ by $\piby4$ ((In Argand-world, we do not degree.)), you multiply by $\frac{1}{\sqrt{2}}\left( 1 \pm \i \right)$, with a positive sign for an anti-clockwise rotation.

Ignoring the $\sqrt{2}$ since we’ll be dividing out the modulus shortly, $(3 + 4\i)(1 \pm i) = (3 \mp 4) + \i (4 \pm 3)$, which is either $-1 + 7\i$ or $7 + \i$.

The modulus of these numbers is $5\sqrt{2}$, so the corresponding vectors are $-\frac{1}{5\sqrt{2}}\bi + \frac{7}{5\sqrt{2}}\bj$ and $\frac{7}{5\sqrt{2}}\bi + \frac{1}{5\sqrt{2}}\bj$.

### Method 2: a dot product

Suppose the required vector is $x \bi + y \bj$. Then we have $\frac{(3\bi + 4\bj)\cdot(x \bi + y \bj)}{5 \times |(x\bi + y\bj)|} =\frac{1}{\sqrt{2}}$. (Any vector at 45 degrees to the original one will satisfy this; the $\frac{1}{\sqrt{2}}$ is the cosine of the angle between the vectors).

Let’s make live easy for ourselves and suppose that $|x\bi + y\bj| = \sqrt{2}$, making our equation $(3\bi + 4\bj)(x\bi + y\bj) = 5$.

We’ve now got simultaneous equations: $x^2 + y^2 = 2$, from the supposition, and $3x + 4y = 5$, from the dot product.

Letting $3x = 5 - 4y$, and considering $9x^2 + 9y^2 = 18$, we get $(5-4y)^2 + 9y^2 = 18$, or $25 - 40y + 25y^2 = 18$

Rearranging, $25y^2 - 40y + 7 = 0$, which factorises as $(5y - 7)(5y-1)$.

This gives $y= \frac{7}{5}$ (with $x = -\frac{1}{5}$) or $y=\frac{1}{5}$ (with $x = \frac{7}{5}$) - and when we normalise, we get the same vector as above.

### Method 3: Use the perpendicular

If you construct a perpendicular vector of the same length - either $-4\bi + 3\bj$ or $4\bi - 3\bj$ - and find the midpoint of the ends of the two vectors, the vector this point will be at 45 degrees to the original vector.

The two possible midpoints are at $-\frac{1}{2}\bi + \frac{7}{2}\bj$ and $\frac{7}{2}\bi + \frac{1}{2}\bj$; both of these, when normalised, give the same answer as method 1.

### Method 4: compound angle formula

Let $\theta$ be the angle between the $x$-axis and $3\bi + 4\bj$, so that $\tan(\theta) = \frac{4}{3}$

$\tan(\theta \pm 45^o) = \frac{ \frac{4}{3} \pm 1 }{1 \mp \frac{4}{3}}$

$\dots = \frac{4 \pm 3}{3 \mp 4}$, giving either -7 or $\frac{1}{7}$.

The first corresponds to a vector parallel to $-\bi + 7\bj$ and the second to $7\bi + \bj$; again, these normalise to the correct answer.

Hope that’s helpful!

- Uncle Colin