Index Page vhat_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

       void vhat_c ( ConstSpiceDouble  v1  [3],
                     SpiceDouble       vout[3] )

#### Abstract

       Find the unit vector along a double precision 3-dimensional vector.

#### Required_Reading

       None.

#### Keywords

       VECTOR

#### Brief_I/O

       VARIABLE  I/O  DESCRIPTION
       --------  ---  --------------------------------------------------
       v1         I   Vector to be unitized.
       vout       O   Unit vector v1 / |v1|.

#### Detailed_Input

        v1            This is any double precision, 3-dimensional vector.

#### Detailed_Output

        vout          vout contains the unit vector in the direction of v1.
                      If v1 represents the zero vector, then vout will also
                      be the zero vector.  vout may overwrite v1.

#### Parameters

       None.

#### Exceptions

       Error free.

       If v1 represents the zero vector, then vout will also be the zero
       vector.

#### Files

       None.

#### Particulars

       vhat_c determines the magnitude of v1 and then divides each
       component of v1 by the magnitude.  This process is highly stable
       over the whole range of 3-dimensional vectors.

#### Examples

       The following table shows how v1 maps to vout.

       v1                        vout
       ------------------        ------------------
       ( 5,     12,    0     )   ( 5/13, 12/13, 0   )
       ( 1.e-7, 2.e-7, 2.e-7 )   ( 1/3,  2/3,   2/3 )

#### Restrictions

       None.

       There is no known case whereby floating point overflow may occur.
       Thus, no error recovery or reporting scheme is incorporated
       into this subroutine.

#### Literature_References

       None.

#### Author_and_Institution

       N.J. Bachman       (JPL)
       W.L. Taber         (JPL)
       W.M. Owen          (JPL)

#### Version

       -CSPICE Version 1.0.2, 16-JAN-2008   (EDW)

          Corrected typos in header titles:

          Detailed Input to Detailed_Input
          Detailed Output to Detailed_Output

       -CSPICE Version 1.0.1, 12-NOV-2006 (EDW)

          Added Parameters section header.

       -CSPICE Version 1.0.0, 16-APR-1999 (EDW)

#### Index_Entries

       unitize a 3-dimensional vector

#### Link to routine vhat_c source file vhat_c.c

    Wed Apr  5 17:54:46 2017