Computes a vector orthogonal to all rows of a matrix using a determinant-based construction. This generalizes the cross product to higher dimensions.
Details
For a matrix \(A\) with dimensions \(n x (n+1)\), the result is a vector in \(R^{n+1}\) orthogonal to all rows of \(A\). The components are given by: $$ v_i = (-1)^{i+1} \det(A_{-i}) $$ where \(A_{-i}\) is the matrix obtained by removing the \(i\)-th column.
For a vector of length 2, the function returns the perpendicular vector \((a_2, -a_1)\), consistent with the formula above.
Internally, the function computes a nullspace vector using SVD (which is
numerically stable also for ill-conditioned input) and rescales it to match
the magnitude of the determinant-based generalized cross product. For
numeric input, the sign is chosen to reproduce the orientation of the
determinant formula (and hence
anticommutativity: swapping two rows of \(A\) flips the sign of the
result). For complex input, where det() is not available, the sign
is fixed by the convention that the first component with non-zero modulus
has a positive real part.
See also
Other math.basic:
closest(),
crossProd(),
dotProd(),
roundTo(),
unirootAll()
