I am using the cross product in numpy to generate a third vector orthogonal to two orthogonal vectors. In the code snippet below, the first operation (cross product) shows my problem, taking the cross product of two vectors gives me just the negation of one of the input vectors, not a third vector orthogonal to both.
The next operation shows that my two vectors are indeed orthogonal, not that this should matter. What's going on here?
np.cross([ 0.36195593, 0.93219521, 0. ],[ 0.65916161, -0.25594151, -0.70710672])
Out[94]: array([-0.6591615 , 0.25594147, -0.70710684])
np.dot([ 0.36195593, 0.93219521, 0. ],[ 0.65916161, -0.25594151, -0.70710672])
Out[95]: 3.905680168170278e-09
First, it's isn't exactly the negation. The last term has the same sign. It just so happens, perfectly coincidentally, that it is close to the negation of one of the original vectors.
Secondly, it is the correct cross product. Instead of doing it by hand, I'll appeal to the fact that the cross product is defined geometrically as a vector that must be orthogonal to its two original inputs. The fact that the two inputs are orthogonal is (largely) irrelevant.
HTH.