How to produce an N-dimensional *direct* basis?

29 Views Asked by At

I need a procedure to generate an N-dimensional orthonormal direct basis. The 1D, 2D, and 3D case are not a problem. For example, in the 3D case, if I have 3 vectors $v1, v2, v3$ (suppose they behave well i.e. no collinear vectors etc.) I can construct a basis with $u_1 = v_1/\|v_1\|$, $v_2 = [-{u_1}_{,2}; {u_1}_{,1}; 0]$ and $u_3 = u_1$ $\times$ $u_2$ (where $\times$ is the cross product). My question is how to generalize this for any dimension? I am aware that I could just generate N random vectors and apply gram-schmidt orthogonalization, but as far as I understand that does not guarantee me a direct basis (by direct I mean its orientation should be anti-clockwise in 2D --- not sure how the notion of orientation generalizes for higher dimensions).