void vlcomg_c ( SpiceInt n,
SpiceDouble a,
ConstSpiceDouble * v1,
SpiceDouble b,
ConstSpiceDouble * v2,
SpiceDouble * sum )
Compute a vector linear combination of two double precision
vectors of arbitrary dimension.
None.
VECTOR
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
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.
sum is an arbitrary, double precision n-dimensional vector
which contains the linear combination a*v1 + b*v2.
None.
Error free.
None
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.
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 );
No error checking is performed to guard against numeric overflow
or underflow. The user is responsible for insuring that the
input values are reasonable.
None
W.L. Taber (JPL)
-CSPICE Version 1.0.0, 30-JUN-1999
linear combination of two n-dimensional vectors
Link to routine vlcomg_c source file vlcomg_c.c
|