# How to find a 4D vector perpendicular to 3 other 4D vectors?

In 3 dimensions it is possible to find a vector c (one of infinitely many) perpendicular to two vectors a and b using the cross product. Is there any way of extending this to 4 dimensions, i.e. given three vectors a, b, and c finding a vector d perpendicular to all of them?

I realize that this can be done by solving the equation system:

dot(a, d) = 0
dot(b, d) = 0
dot(c, d) = 0


and imposing an additional constraint, for instance setting the length of d to or one of its components to 1, but is there a way of doing this that does not involve solving an equation system?

• You can generalise the cross product... – Shakespeare Aug 20 '14 at 15:45

## 3 Answers

If $\mathbf{u} = (x_1, y_1, z_1, t_1)$, $\mathbf{v} = (x_2, y_2, z_2, t_2)$ and $\mathbf{w} = (x_3, y_3, z_3, t_3)$, then the vector: $$\mathbf{x} = \left|\begin{array}{c c c c} \mathbf{e}_1 & \mathbf{e}_2 & \mathbf{e}_3 & \mathbf{e}_4 \\ x_1 & y_1 & z_1 & t_1 \\ x_2 & y_2 & z_2 & t_2 \\ x_3 & y_3 & z_3 & t_3 \end{array}\right|$$ is orthogonal to $\mathbf{u,v}$ and $\mathbf{w}$. Here, $\{\mathbf{e}_i\}_{i = 1}^4$ is the canonical basis for $\Bbb R^4$. If you want a vector orthogonal to the first three, with length $d$, consider $\frac{d}{\|\mathbf{x}\|}\mathbf{x}$. Given $n - 1$ vectors in $\Bbb R^n$, the above gives you one last vector orthogonal to all the given vectors.

Let $P_1$, $P_2$ and $P_3$ the endpoints of the three vectors (thought to be applied in $O$) and let $$aw+bx+cy+dz=0$$ the equation of the hyperplane ($3$-dimensional space) through them and $O$ (I'm assuming the three vectors are linearly independent).

Then the vector $(a,b,c,d)$ is perpendicular to all three.

This generalizes to any number of dimensions.

• Yes, I realize this, but the question is if there is a way of finding one set of a, b, c, and d without solving an equation system. In 3D, one can use the cross product, is there an analogy in 4D? – Andreas Brinck Aug 20 '14 at 16:07
• Well, of course you can define a $4$-dimensional cross-product by mimicking the usual (3-D) definition. The point is how to compute it quickly. – Andrea Mori Aug 20 '14 at 16:42

Yes, in general this is done by finding the null space of the matrix of vectors. when solving for $d$ you are finding the solutions to the matrix equation:

$\vec{0} = \left(\begin{array}{c}{a \\ b \\ c}\end{array}\right).d$

It doesn't matter the number of dimensions, except that with more than three dimensions you will have lotsa solutions (infinite).