>  Docs Center  >  Libraries  >  Markwardt  >  CROSSPN
Libraries

CROSSPN

CROSSPN

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



© 2024 NV5 Geospatial Solutions, Inc. |  Legal
   Contact Us