Index Page vdotg_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 vdotg_c ( ConstSpiceDouble   * v1,
                             ConstSpiceDouble   * v2,
                             SpiceInt             ndim )
#### Abstract
       Compute the dot product of two vectors of arbitrary dimension.
#### Required_Reading
       None.
#### Keywords
       VECTOR
#### Brief_I/O
       VARIABLE  I/O  DESCRIPTION
       --------  ---  --------------------------------------------------
        v1        I     First vector in the dot product.
        v2        I     Second vector in the dot product.
        ndim      I     Dimension of v1 and v2.

       The function returns the value of the dot product of v1 and v2.
#### Detailed_Input
       v1      This may be any double precision vector of arbitrary
               dimension.

       v2      This may be any double precision vector of arbitrary
               dimension.
#### Detailed_Output
       The function returns the value of the dot product of v1 and v2.
#### Parameters
       None.
#### Exceptions
       1)  If ndim is not physically realistic, greater than zero, a
           BADDIMENSION error is signaled.  The value 0. is returned.
#### Files
       None.
#### Particulars
       vdotg_c calculates the dot product of v1 and v2 by a simple
       application of the definition.  No error checking is
       performed to prevent or recover from numeric overflow.
#### Examples
       Suppose that given two n-dimensional vectors, we want to change
       one of the vectors until the two vectors are perpendicular.
       The following code fragment demonstrates the use of vdot_c to do
       so.

        dot = vdotg_c ( v1, v2, ndim );

        while ( dot != 0. )
           {

             /. change one of the vectors ./
                      ....

            dot = vdotg_c ( v1, v2, ndim );
           }
#### Restrictions
       The user is responsible for determining that the vectors v1 and
       v2 are not so large as to cause numeric overflow.  In most cases
       this won't present a problem.
#### Literature_References
       None.
#### Author_and_Institution
       W.M. Owen       (JPL)
       E.D. Wright     (JPL)
#### Version
       -CSPICE Version 1.1.0, 22-OCT-1998 (NJB)

          Made input vectors const.  Converted check-in style to discovery.

       -CSPICE Version 1.0.0, 31-MAR-1998   (EDW)
#### Index_Entries
       dot product of n-dimensional vectors
#### Link to routine vdotg_c source file vdotg_c.c

    Wed Apr  5 17:54:46 2017