Cross Product

The cross product is a special operation only serving a purpose in 3D.

a×b=[a1a2a3]×[b1b2b3]=[a2b3a3b2a3b1a1b3a1b2a2b1]\vec{a}\times\vec{b} = \begin{bmatrix} a_1 \\ a_2 \\ a_3 \end{bmatrix} \times \begin{bmatrix} b_1 \\ b_2 \\ b_3 \end{bmatrix} = \begin{bmatrix} a_2 b_3 - a_3 b_2\\ a_3 b_1 - a_1 b_3\\ a_1 b_2 - a_2 b_1 \end{bmatrix}

We are mainly going to use the cross product to construct vectors which are linear independent from another. Other than that it's not too useful for our purposes. Take this example where we have 2 (linear independent) vectors and use the cross product to construct a 3rd vector which all together form a new coordinate system.

Vector orangeVector = new Vector(3, 0, 1).normalize();
Vector tealVector = new Vector(-0.5, 2, 1).normalize();
Vector purpleVector = orangeVector.getCrossProduct(tealVector);

Last updated