;+ ; NAME: ; CROSSPN ; ; AUTHOR: ; Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770 ; craigm@lheamail.gsfc.nasa.gov ; ; PURPOSE: ; A version of CROSSP for efficient vector cross products ; ; CALLING SEQUENCE: ; C = CROSSPN(A, B) ; ; DESCRIPTION: ; ; The function CROSSPN computes the vector cross product (outer ; product). The difference between CROSSPN and the IDL library ; function CROSSP, is that CROSSPN allows more than one cross ; product to be computed at one time (i.e., it is vectorized). ; ; Thus, in the expression "C = CROSSPN(A, B)" the vector cross ; product is computed as C = A x B. Because CROSSPN is vectorized, ; any of the following combinations are valid: ; ; * A is a 3-vector, B is a 3-vector ; ==> C is the vector cross product C = A x B ; ; * A is a 3xN array, B is a 3-vector ; ==> C(*,I) = A(*,I) x B (each A is crossed with B) ; ; * A is a 3-vector, B is a 3xN array ; ==> C(*,I) = A x B(*,I) (A is crossed with each B) ; ; * A is a 3xN array, B is a 3xN array ; ==> C(*,I) = A(*,I) x B(*,I) (component-by-component) ; ; If both A and B are arrays then they must have the same ; dimensions. ; ; INPUTS: ; ; A - a 3-vector or 3xN array. ; ; B - a 3-vector or 3xN array. ; ; ; RETURNS: ; ; The vector cross product A x B, either a 3-vector or a 3xN array ; depending on A and B. ; ; SEE ALSO: ; ; CROSSP ; ; MODIFICATION HISTORY: ; Written, CM, 10 Mar 2002 ; Documented, CM, 22 Mar 2002 ; ; $Id: crosspn.pro,v 1.2 2002/03/22 22:02:02 craigm Exp $ ; ;- ; Copyright (C) 2002, Craig Markwardt ; This software is provided as is without any warranty whatsoever. ; Permission to use, copy, modify, and distribute modified or ; unmodified copies is granted, provided this copyright and disclaimer ; are included unchanged. ;-