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_dvnorm

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


Abstract


   CSPICE_DVNORM returns the derivative of the vector norm of a 3-vector.

I/O


   Given:

      state    a double precision 6-vector, the second three components of the
               vector being the derivatives of the first three with respect to
               some scalar.

               help, state
                  DOUBLE = Array[6]

               `state' can be expressed as:

                               dx
                  state = ( x, -- )
                               ds

               A common form for `state' would contain position and
               velocity.

   the call:

      dvnorm = cspice_dvnorm( state )

   returns:

      dvnorm   the derivative of the norm of the position component of the
               input `state' vector.

               help, dvnorm
                  DOUBLE = Scalar

               `dvnorm' can be expressed as:

                            d ||x||
                  dvnorm = ---------
                              ds

               where the norm of `x' is given by:

                                               .----------------
                             .---------       /    2    2    2
                  ||x|| =  \/ < x, x >  = \  / ( x1 + x2 + x3  )
                                           \/


               If the velocity component of `state' is:

                            dx1   dx2   dx3
                     v = ( ----, ----, ---- )
                            ds    ds    ds

               then

                     d||x||      < x, v >
                     ------ =  ------------  =  < xhat, v >
                       ds        .---------
                               \/ < x, x >

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) Compute the derivative of the norm of three vectors of
      different magnitudes. Use the first two vectors to define
      the derivatives as parallel and anti-parallel, and let
      the third be the zero vector.

      Example code begins here.


      PRO dvnorm_ex1

         ;;
         ;; Create several 6-vectors (6x1 arrays) with the structure
         ;;
         ;;   s = |  x  |
         ;;       |     |
         ;;       |  dx |
         ;;       |  -- |
         ;;       |  ds |
         ;;
         ;; where 'x' is a 3-vector (3x1 array).
         ;;

         ;;
         ;; Create 's' with 'x' of varying magnitudes. Use 'x'
         ;; and '-x' to define the derivative as parallel and
         ;; anti-parallel.
         ;;
         mag = [ -4.D, 4, 12 ]

         x   = [ 1.D, sqrt(2.D), sqrt(3.D) ]

         s1  = [ x * 10.D^mag[0],  x]
         s2  = [ x * 10.D^mag[1], -x]
         s3  = [ dblarr(3), x * 10.D^mag[2] ]

         ;;
         ;; Calculate the derivative of the vector norms with respect
         ;; to 's'.
         ;;
         dvnorm1 = cspice_dvnorm( s1 )
         dvnorm2 = cspice_dvnorm( s2 )
         dvnorm3 = cspice_dvnorm( s3 )

         print, 'Parallel x, dx/ds         : ', dvnorm1
         print, 'Anti-parallel x, dx/ds    : ', dvnorm2
         print, 'Zero vector x, large dx/ds: ', dvnorm3

      END


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


      Parallel x, dx/ds         :        2.4494897
      Anti-parallel x, dx/ds    :       -2.4494897
      Zero vector x, large dx/ds:        0.0000000


Particulars


   A common use for this routine is to calculate the time derivative
   of the radius corresponding to a state vector.

Exceptions


   1)  If the first three components of `state' ("x") describe the
       origin (zero vector) the routine returns zero as the
       derivative of the vector norm.

   2)  If the input argument `state' is undefined, an error is
       signaled by the IDL error handling system.

   3)  If the input argument `state' is not of the expected type, or
       it does not have the expected dimensions and size, an error is
       signaled by the Icy interface.

Files


   None.

Restrictions


   None.

Required_Reading


   ICY.REQ

Literature_References


   None.

Author_and_Institution


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

Version


   -Icy Version 1.0.1, 25-AUG-2021 (JDR)

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

       Added -Parameters, -Particulars, -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.0, 10-MAY-2010 (EDW)

Index_Entries


   derivative of 3-vector norm



Fri Dec 31 18:43:03 2021