math - Efficient Calculation of an N-Dimensional Cross Product? -


as per title, best way calculate n-dimensional cross product using determinant definition , using lu decomposition method of doing such or guys suggest better one?

thanks

edit: clarity mean http://en.wikipedia.org/wiki/cross_product , not cartesian product

edit: seems using leibniz formula might - though don't know how compares lu decomp. @ moment.

from comment, seems looking operation takes n −1 vectors input , computes single vector result, orthogonal input vectors , perhaps have well-defined length well.

with defined length

you can characterize 3-dimensional cross product v =a ×b using identity v ∙w =det(a,b,w). in other words, taking cross product of input vectors , computing dot product any other vector w same plugging input vectors , other vector matrix , computing determinant.

this definition can generalized arbitrary dimensions. due way determinant can computed using laplace expansion along last column, resulting coordinates of cross product values of (n −1)×(n −1) sub-determinants can form input vectors, alternating signs. yes, leibniz might useful in theory, although hardly suitable real-world computations. in practice, you'll have figure out ways avoid repeating computationswhile computing these n determinants. wait last section of answer…

just direction

most applications can weaker requirement. don't care length of resulting vector, direction. in case, asking kernel of (n −1)×n matrix can form taking input vectors rows. element of kernel orthogonal input vectors, , since computing kernels common task, can build on lot of existing implementations, e.g. lapack. details might depend on language using.

combining these

you can combine 2 approaches above: compute 1 element of kernel, , non-zero entry of vector, compute corresponding (n −1)×(n −1) determinant give single coordinate using first approach. can scale vector selected coordinate reaches computed value, , other coordinates match one.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -