# Perpendicular unit vectors

I have a known unit vector $p (a,b,c)$. First I want a unit vector $q$ which is perpendicular to $p$ and passing through a known point $V(X_0,Y_0,Z_0)$. Then a another unit vector $r$ which perpendicular to both $p$ and $q$ vectors. $p,q,r$ must be in clockwise direction. I have drawn this in a picture. Thanks in advance.

• Can you explain the significance of the O vector? Is it that you want (P - O) to be perpendicular to (Q - O) ? Unless O is the origin, the P you've drawn in the diagram is actually (P - O). – DanielV Oct 4 '13 at 20:06
• OK I changed it to V. It is just a know point on P vector and should pass though all the vectors. This should be the origin of the p, q, r coordinate system. – user97946 Oct 4 '13 at 20:24
• You can't: Consider $P(1,0,0)$ and $V(1,1,0)$. – Michael Hoppe Oct 4 '13 at 20:50
• You can. But I want the general case. – user97946 Oct 4 '13 at 20:56

You need a vector normal to the given unit vector $p=(a,b,c)$ [based at the origin - if you need another base like your $v=(x_0,y_0,z_0)$ then these coordinates may be added at the end]. There doesn't appear to be a single way to do this without cases. One way is to consider whether $a=0$. If $a=0$ so that $p=(0,b,c)$ then a normal to $p$ is $(0,c,-b)$, while if $a \neq 0$ then a normal to $p$ is $(b+c,-a,-a)$. Note that this last one could also work when $a=0$, as long as it happened that $b+c \neq 0$, but that again would be another case.
So the above describes how to get a vector $Q$ normal to $p$, then you can make that a unit vector $q$ by dividing through by its length. Finally for $r$ you can use $p \times q$ (cross product), and then $r$ will automatically be a unit vector perpendicular to both of $p,q$ and making a right-hand coordinate system with them.
• You have set up each of $p,q,r$ as mutually perpendicular unit vectors, based at the origin. If $v$ is to be the 'new' origin you have to keep track of whether working in the 'old' or 'new' system. The new origin being at $v$ means the point labeled $(x_0,y_0,z_0)$ in the 'old' system is now $(0,0,0)$ in the new system, etc. – coffeemath Oct 5 '13 at 1:34