Let vector r_{1} = a_{1}i + b_{1}j + c_{1}k

and vector r_{2} = a_{2}i + b_{2}j + c_{2}k.

Then cos(θ) = ((a_{1}a_{2} + b_{1}b_{2 }+ c_{1}c_{2})/(√(a_{1}^{2} + b_{1}^{2} + c_{1}^{2}) √(a_{2}^{2} + b_{2}^{2} + c_{2}^{2})).

The angle between two diagonals of a unit cube is