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_vrelg

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


Abstract


   CSPICE_VRELG returns the relative difference between two
   double precision N-vectors.

I/O


   Given:

      v1,
      v2       two double precision N-dimensional vectors for which the
               relative difference is to be computed.

               help, v1
                  DOUBLE = Array[N]
               help, v2
                  DOUBLE = Array[N]

   the call:

      vrelg = cspice_vrelg( v1, v2 )

   returns:

      vrelg    the scalar double precision relative difference between between
               `v1' and `v2'.

               help, vrelg
                  DOUBLE = Scalar

               It is defined as:

                                 || v1 - v2 ||
                  vrelg  =   ----------------------
                             max ( ||v1||, ||v2|| )

               where || x || indicates the Euclidean norm of
               the vector `x' ( ||x|| = sqrt( x . x ) ).

               cspice_vrelg assumes values in the range [0,2]. If both
               `v1' and `v2' are zero vectors then cspice_vrelg is defined
               to be zero.

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 relative difference between two four-dimensional
      vectors.

      Example code begins here.


      PRO vrelg_ex1

         vec1 = [ 12.3d   , -4.32d ,  76.d ,  1.87d ]
         vec2 = [ 23.0423d, -11.99d, -0.10d, -99.1d ]

         ;;
         ;; Compute the relative difference between `vec1' and `vec2'
         ;;
         diff = cspice_vrelg( vec1, vec2 )

         print, 'Relative difference between v1 and v2:', diff

      END


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


      Relative difference between v1 and v2:       1.2408623


Particulars


   This function computes the relative difference between two vectors
   of general dimension as defined above.

   The function cspice_vrel may be used to find the relative difference
   for two 3-dimensional vectors.

Exceptions


   1)  If both `v1' and `v2' are zero vectors then cspice_vrelg is defined
       to be zero.

   2)  If any of the input arguments, `v1' or `v2', is undefined, an
       error is signaled by the IDL error handling system.

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

   4)  If the input vector arguments `v1' and `v2' do not have the
       same dimension (N), 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.2, 01-JUN-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, and
       completed -Particulars section.

       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.1, 13-JUN-2011 (EDW)

      Edits to comply with NAIF standard for Icy headers.

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

Index_Entries


   relative difference of n-dimensional vectors



Fri Dec 31 18:43:09 2021