# How to get perpendicular vector close to another vector?

Suppose I have two vectors $\vec v_1$ and $\vec v_2$ in $E^3$ space. How can I find a vector $v_3$ such that

• $\vec v_3$ is perpendicular to $\vec v_1$
• the angle between $v_2$ and $v_3$ is minimized
• I think it should be $\pi/2-\theta$, where $\theta$ is the angle between $v_1$ and $v_2$ – Shubham Apr 18 '14 at 16:20
• I don't know what you mean since I'm looking for a vector not an angle... – omega Apr 18 '14 at 16:39

Project $v_2$ onto the orthogonal complement plane orthogonal to $v_1$, and this will give you your vector $v_3$.
The reason this works is that in order to minimize the angle, you want to maximize the dot-product assuming the lengths of the vectors are fixed. Let $v_2 = v_3 + cv_1$ where $v_3$ is orthogonal to $v_1$. Then for any vector $w$ orthogonal to $v_1$, we have $w \cdot v_2 = w \cdot v_3$. If we assume that $w$ has the same length as $v_3$, we see that $w = v_3$ is the unique choice that maximizes the dot-product and hence forms the smallest angle to $v_2$.
To compute $v_3$, normalize $v_1$ so that it has Euclidean length = $1$. Then $v_3 = v_2 - (v_1 \cdot v_2)v_1$. If you get $v_3 = 0$ then that means $v_2$ and $v_1$ are parallel, in which case you can choose any $v_3$ perpendicular to $v_1$ and get minimal angle of $90$ degrees to $v_2$.
• Why does it minimize the angle ? I don't see an easy proof of that. The projection of $v_2$ on the plane orthogonal $P$ to $v_1$ is the nearest vector of $v_2$ from $P$, but what about the angles ? – Sebastien Apr 18 '14 at 16:35
• @Sebastien I added the proof of why the projection minimizes the angle. It relies on the dot-product representation for $\cos$ of angle. – user2566092 Apr 18 '14 at 16:54
• How do you project $v_2$ on the plane? – omega Apr 18 '14 at 16:57