Index Page vdist_c
A B C D E F G H I J K L M N O P Q R S T U V W X
Procedure Abstract Required_Reading Keywords Brief_I/O Detailed_Input | Detailed_Output Parameters Exceptions Files Particulars Examples | Restrictions Literature_References Author_and_Institution Version Index_Entries
#### Procedure
       SpiceDouble vdist_c ( ConstSpiceDouble v1[3],
                             ConstSpiceDouble v2[3] )
#### Abstract
       Return the distance between two three-dimensional vectors.
#### Required_Reading
       None.
#### Keywords
       VECTOR
#### Brief_I/O
       Variable  I/O  Description
       --------  ---  --------------------------------------------------

       v1,
       v2         I   Two 3-vectors.

       The function returns the distance between v1 and v2.
#### Detailed_Input
       v1,
       v2         are two vectors in three-dimensional space, the
                  distance between which is desired.
#### Detailed_Output
       The function returns the distance between v1 and v2.  This is
       defined as

                ||  v1 - v2  ||,

       where || x || indicates the Euclidean norm of the vector x.
#### Parameters
       None.
#### Exceptions
       Error free.
#### Files
       None.
#### Particulars
       This function is simply shorthand for the code

          vsub_c ( v1, v2, diff );

          dist = vnorm_c ( diff );

       Using this function saves you the annoyance of declaring local
       storage for the difference vector diff.

       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(1), A(2), A(3) )    and    ( B(1), B(2), B(3) ),

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

          (  A(1) - B(1),  A(2) - B(2),  A(3) - B(3)  ).

       A related routine is vdistg_, which computes the distance between
       two vectors of general dimension.
#### Examples
       1)  If v1 is

              ( 2.0,  3.0,  0. )

           and v2 is

              ( 5.0,  7.0,  12. ),

           vdist_c (v1, v2) will be 13..

       2)  If VGR2 and NEP are states of the Voyager 2 spacecraft and
           Neptune with respect to some common center at a given time
           ET, then

              vdist_c ( VGR2, NEP )

           yields the distance between the spacecraft and Neptune at time
           ET.
#### Restrictions
       None.
#### Literature_References
       None.
#### Author_and_Institution
       N.J. Bachman   (JPL)
#### Version
       -CSPICE Version 1.2.0, 22-OCT-1998 (NJB)

          Made input vectors const.  Removed #include of SpiceZfc.h.

       -CSPICE Version 1.1.0, 06-MAR-1998   (EDW)

          Removed non printing character.

       -CSPICE Version 1.0.0, 08-FEB-1998   (EDW)
#### Index_Entries
       distance between 3-dimensional vectors
#### Link to routine vdist_c source file vdist_c.c

    Wed Jun  9 13:05:32 2010