Index Page vlcom_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 vlcom_c ( SpiceDouble        a,
                      ConstSpiceDouble   v1[3],
                      SpiceDouble        b,
                      ConstSpiceDouble   v2[3],
                      SpiceDouble        sum[3] )
#### Abstract
       Compute a vector linear combination of two double precision,
       3-dimensional vectors.
#### Required_Reading
       None.
#### Keywords
       VECTOR
#### Brief_I/O
       VARIABLE  I/O  DESCRIPTION
       --------  ---  --------------------------------------------------
       a          I   Coefficient of v1
       v1         I   Vector in 3-space
       b          I   Coefficient of v2
       v2         I   Vector in 3-space
       sum        O   Linear Vector Combination a*v1 + b*v2
#### Detailed_Input
       a     This double precision variable multiplies v1.
       v1    This is an arbitrary, double precision 3-dimensional
              vector.
       b     This double precision variable multiplies v2.
       v2    This is an arbitrary, double precision 3-dimensional
              vector.
#### Detailed_Output
       sum   is an arbitrary, double precision 3-dimensional vector
              which contains the linear combination a*v1 + b*v2.
#### Parameters
       None.
#### Exceptions
       Error free.
#### Files
       None
#### Particulars
       For each index from 0 to 2, this routine implements in C
       code the expression:

       sum[i] = a*v1[i] + b*v2[i]

       No error checking is performed to guard against numeric overflow.
#### Examples
       To generate a sequence of points on an ellipse with major
       and minor axis vectors major and minor, one could use the
       following code fragment

              step = twopi_c()/ n;
              ang  = 0.0;

              for ( i = 0; i < n; i++ )
                 {
                 vlcom_c ( cos(ang),major,  sin(ang),minor,  point );

                 do something with the ellipse point just constructed

                 ang = ang + step;
                 }

       As a second example, suppose that u and v are orthonormal vectors
       that form a basis of a plane. Moreover suppose that we wish to
       project a vector x onto this plane, we could use the following
       call inserts this projection into proj.

              vlcom_c ( vdot_c(x,v),v,   vdot_c(x,u),u,    proj )
#### Restrictions
       No error checking is performed to guard against numeric overflow
       or underflow.  The user is responsible for insuring that the
       input values are reasonable.
#### Literature_References
       None
#### Author_and_Institution
       W.L. Taber      (JPL)
       E.D. Wright     (JPL)
#### Version
       -CSPICE Version 1.1.0, 22-OCT-1998 (NJB)

          Made input vectors const.

       -CSPICE Version 1.0.0, 08-FEB-1998 (EDW)
#### Index_Entries
       linear combination of two 3-dimensional vectors
#### Link to routine vlcom_c source file vlcom_c.c

    Wed Apr  5 17:54:46 2017