Ferdinando Randisi - 8 months ago 56

Python Question

How can I perform the inverse cross product in numpy?

That is, given two numpy arrays

`b`

`c`

`a`

`a.cross(b) == c`

EDIT: Could whoever downvoted please let me know what they didn't like it, so that I can learn from their opinion? I asked the question because I didn't easily find an answer anywhere. Turns out the question is mathematically ill-defined (as people pointed out), but from now on if people look it up here this answer will show up and they'll know that quickly and easily.

Answer Source

There only exists a solution if a and c are orthogonal, and the solution is not unique.

Then, a = np.cross(b,c)/np.dot(b,b)+t*b is a solution for all t.

See this question on Math SE: http://math.stackexchange.com/questions/32600/whats-the-opposite-of-a-cross-product