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

Table of contents
Abstract
I/O
Parameters
Examples
Particulars
Exceptions
Files
Restrictions
Required_Reading
Literature_References
Author_and_Institution
Version
Index_Entries


Abstract


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

I/O


      a        a double precision 3-array defining a vector.

               help, a
                  DOUBLE = Array[3]

               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.

               help, b
                  DOUBLE = Array[3]

               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'.

               help, p
                  DOUBLE = Array[3]

Parameters


   None.

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.

   1) Define two vector sets and compute the component of the vector
      in the first set perpendicular to the vector in the second set.

      Example code begins here.


      PRO vperp_ex1

         ;;
         ;; 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

      END


      When this program was executed on a Mac/Intel/IDL8.x/64-bit
      platform, the output was:


      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


   Given and non-zero vector `b' and a vector `a', there is a unique
   decomposition of `a' as a sum v + p such that `p' is orthogonal
   to `b' and `v' is parallel to `b'. This routine finds the vector `p'.

   If `b' is a zero vector, `p' will be identical to `a'.

Exceptions


   1)  If any of the input arguments, `a' or `b', is undefined, an
       error is signaled by the IDL error handling system.

   2)  If any of the input arguments, `a' or `b', is not of the
       expected type, or it does not have the expected dimensions and
       size, an error is signaled by the Icy interface.

   3)  If the output argument `p' is not a named variable, an error
       is signaled by the Icy interface.

Files


   None.

Restrictions


   None.

Required_Reading


   ICY.REQ

Literature_References


   [1]  G. Thomas and R. Finney, "Calculus and Analytic Geometry,"
        7th Edition, Addison Wesley, 1988.

Author_and_Institution


   J. Diaz del Rio     (ODC Space)
   E.D. Wright         (JPL)

Version


   -Icy Version 1.0.3, 10-AUG-2021 (JDR)

       Edited the header to comply with NAIF standard. Added
       example's problem statement and reformatted example's output.

       Added -Parameters, -Exceptions, -Files, -Restrictions,
       -Literature_References and -Author_and_Institution sections.

       Removed reference to the routine's corresponding CSPICE header from
       -Abstract section.

       Added arguments' type and size information in the -I/O section.

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

       Edited header, improved/clarified -I/O descriptions.

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

       Added -Examples section.

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

Index_Entries


   perpendicular component of a 3-vector



Fri Dec 31 18:43:09 2021