; docformat = 'rst' ;+ ; Evaluates the cross product of vector a with vector b. The input ; vectors must have 3 elements. ; ; :Author: ; DMS: 08-1983, ; Chris Jeppesen: 07-2005 (to multiply a whole grid), ; Ryan Talley: 06-08-2015 (added rst formatting and error test) ; ; :Examples: ; product = crossp_grid(vector_a, vector_b) ;- ;+ ; :Params: ; a : in, required, type=vector of int or vector of double ; Input vector of three elements used to compute the cross product. ; b : in, required, type=vector of int or vector of double ; Input vector of three elements used to compute the cross product. ; ; :Returns: ; Returns the cross product that is a 3-element, floating-point vector. ;- Function crossp_grid,a,b resolve_grid,a,x=ax,y=ay,z=az resolve_grid,b,x=bx,y=by,z=bz x=ay*bz-az*by y=az*bx-ax*bz z=ax*by-ay*bx return,compose_grid(x,y,z) end