Index Page
vlcomg_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 vlcomg_c ( SpiceInt            n,
                   SpiceDouble         a,
                   ConstSpiceDouble *  v1,
                   SpiceDouble         b,
                   ConstSpiceDouble *  v2,
                   SpiceDouble      *  sum )

Abstract

   Compute a vector linear combination of two double precision
   vectors of arbitrary dimension.

Required_Reading

   None.

Keywords

   VECTOR


Brief_I/O

    VARIABLE  I/O  DESCRIPTION
    --------  ---  --------------------------------------------------
    n          I   Dimension of vector space
    a          I   Coefficient of v1
    v1         I   Vector in n-space
    b          I   Coefficient of v2
    v2         I   Vector in n-space
    sum        O   Linear Vector Combination a*v1 + b*v2

Detailed_Input

    n   This variable contains the dimension of the v1, v2 and sum.
    a   This double precision variable multiplies v1.
    v1  This is an arbitrary, double precision n-dimensional vector.
    b   This double precision variable multiplies v2.
    v2  This is an arbitrary, double precision n-dimensional vector.

Detailed_Output

    sum   is an arbitrary, double precision n-dimensional vector
          which contains the linear combination a*v1 + b*v2.

Parameters

    None.

Exceptions

   Error free.

Files

    None

Particulars

    For each index from 1 to n, 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

    We can easily use this routine to perform vector projections
    to 2-planes in n-space.  Let x be an arbitray n-vector
    and let u and v be orthonormal n-vectors spanning the plane
    of interest.  The projection of x onto this 2-plane, projuv can
    be obtained by the following code fragment.

       vlcomg_c ( n, vdot_c(x,u,n), u, vdot_c(x,v,n), v, projuv );

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)

Version

   -CSPICE Version 1.0.0, 30-JUN-1999

Index_Entries

   linear combination of two n-dimensional vectors

Link to routine vlcomg_c source file vlcomg_c.c

Wed Apr  5 17:54:46 2017