Index Page
cspice_vperp
A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X 

Abstract
I/O
Examples
Particulars
Required Reading
Version
Index_Entries

Abstract


   CSPICE_VPERP calculates the component of a vector perpendicular to a
   second vector.

   For important details concerning this module's function, please refer to
   the CSPICE routine vperp_c.

I/O


      a   a double precision 3-array defining a vector. It is the vector
          whose component orthogonal to 'b' is sought.

          (There is a unique decomposition of a into a sum v + p, where v is
          parallel to b and p is orthogonal to b.  We want the component p.)

      b   double precision 3-array. This is the vector used as a reference
          for the decomposition of 'a'.

      An implicit assumption exists that 'a' and 'b' lie in the same
      reference frame. If this is not the case, the numerical result has
      no meaning.

   the call:

      cspice_vperp, a, b, p

   returns:

      p   a double precision 3-array containing the component of 'a'
          orthogonal to 'b'.

Examples


   Any numerical results shown for this example may differ between
   platforms as the results depend on the SPICE kernels used as input
   and the machine specific arithmetic implementation.

      ;;
      ;; Define two vector sets.
      ;;
      a = [ [ 6.D, 6, 6], $
            [ 6,   6, 6], $
            [ 6,   6, 0], $
            [ 6,   0, 0] ]

      b = [ [ 2.D, 0, 0], $
            [-3,   0, 0], $
            [ 0,   7, 0], $
            [ 0,   0, 9] ]

      ;;
      ;; Calculate the decomposition.
      ;;
      for i=0, 3 do begin
         cspice_vperp, a(*,i), b(*,i), p

         print, 'a = ', a(*,i)
         print, 'b = ', b(*,i)
         print, 'p = ', p
         print
         
      endfor

   IDL outputs:

      a =        6.0000000       6.0000000       6.0000000
      b =        2.0000000       0.0000000       0.0000000
      p =        0.0000000       6.0000000       6.0000000

      a =        6.0000000       6.0000000       6.0000000
      b =       -3.0000000       0.0000000       0.0000000
      p =        0.0000000       6.0000000       6.0000000

      a =        6.0000000       6.0000000       0.0000000
      b =        0.0000000       7.0000000       0.0000000
      p =        6.0000000       0.0000000       0.0000000

      a =        6.0000000       0.0000000       0.0000000
      b =        0.0000000       0.0000000       9.0000000
      p =        6.0000000       0.0000000       0.0000000

Particulars


   None.

Required Reading


   ICY.REQ

Version


   -Icy Version 1.0.2, 22-APR-2010, EDW (JPL)

      Edited header, improved/clarified I/O descriptions.

   -Icy Version 1.0.1, 09-DEC-2005, EDW (JPL)

      Added Examples section.

   -Icy Version 1.0.0, 16-JUN-2003, EDW (JPL)

Index_Entries


   perpendicular component of a 3-vector




Wed Apr  5 17:58:04 2017