TITLE: Finding two more vectors to make up an axis
QUESTION [5 upvotes]: Given a vector $\vec{v} = (x, y, z)$, how do I find two vectors that make up an axis with $\vec{v}$? In other words, one of them is perpendicular and lies in the same plane and the other is normal to those two vectors.

REPLY [7 votes]: If you just want to take your ${\bf v}$ and produce an orthogonal basis including ${\bf v}$, then take
$${\bf w}={\bf A}\times {\bf v}$$
with an arbitrary vector ${\bf A}$ not parallel to ${\bf v}$. Then ${\bf v}\cdot{\bf w}=0$. Next, take
$${\bf x}={\bf v}\times {\bf w}$$
and $\{{\bf v},{\bf w},{\bf x}\}$ is a set of vectors to your specifications. There is a lot of flexibility here, so you might want to think hard about what you really want... because it's probably not what you asked for.

REPLY [3 votes]: You can use for example $(x,y,z)$,$(y,-x,0)$ and $(xz,yz,-x^2-y^2)$. In general, to find the second vector, use one which has dot product zero when taken with the first vector, and then take the cross product of the first two vectors to find the third.