fork(2) download
  1. import numpy as np
  2.  
  3. def cross(a, b):
  4. c = [a[1]*b[2] - a[2]*b[1],
  5. a[2]*b[0] - a[0]*b[2],
  6. a[0]*b[1] - a[1]*b[0]]
  7.  
  8. return c
  9.  
  10. a = np.array([0.0, 1.0, 0.0])
  11. b = np.array([1.0, 0.0, 0.0])
  12. c = cross(a,b)
  13.  
  14. print c
  15.  
Success #stdin #stdout 0.11s 25336KB
stdin
Standard input is empty
stdout
[0.0, 0.0, -1.0]