Index Page
cspice_vdist
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_VDIST returns the scalar distance between two three-dimensional
   vectors.

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

I/O


   Given:

      vec1,
      vec2    two arbitrary double precision 3-vectors, the distance between
              which is desired.

   the call:

      dist = cspice_vdistg( vec1, vec2 )

   returns:

      dist   double precision scalar distance between 'vec1' and 'vec2'.
             This is defined as

                ||  v1 - v2  ||,

             where || x || indicates the Euclidean norm of the vector x.

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.

      v1 = [ 12.3d   , -4.32d ,  76.d  ]
      v2 = [ 23.0423d, -11.99d, -0.10d ]

      print, cspice_vdist( v1, v2)

   IDL outputs:

      77.236234

   Native IDL code to calculate the same scalar result:

      norm( v1 - v2 )

   The IDL function accepts an arbitrary size N-vectors.

Particulars


   The Euclidean norm of a three-dimensional vector (x, y, z) is
   defined as

                                   1/2
           2        2        2
      (   x    +   y    +   z    ).


   This number is the distance of the point (x, y, z) from the
   origin.  If A and B are two vectors whose components are

      ( a[0], a[1], a[2] )    and    ( b[0], b[1], b[2] ),

   then the distance between A and B is the norm of the difference
   A - B, which has components

      (  a[0] - b[0],  a[1] - b[1],  a[2] - b[2]  ).

   A related routine is cspice_vdistg, which computes the distance between
   two vectors of general dimension.

Required Reading


   ICY.REQ

Version


   -Icy Version 1.0.2, 13-JUN-2011, EDW (JPL)

      Edits to comply with NAIF standard for Icy headers.

      Corrected version ID for 18-APR-2006 entry "1.0.1"
      rather than "1.0.2."

   -Icy Version 1.0.1, 18-APR-2006, EDW (JPL)

      Expanded header comments.

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

Index_Entries


   distance between 3-dimensional vectors




Wed Apr  5 17:58:04 2017