void vpack_c ( SpiceDouble x,
SpiceDouble y,
SpiceDouble z,
SpiceDouble v[3] )
Pack three scalar components into a vector.
None.
VECTOR
VARIABLE I/O DESCRIPTION
-------- --- --------------------------------------------------
x,
y,
z I Scalar components of a 3-vector.
v O Equivalent 3-vector.
x,
y,
z are the scalar components of a 3-vector.
v is the equivalent vector, such that v[0] == x
v[1] == y
v[2] == z
None.
Error free.
None.
Basically, this is just shorthand notation for the common
sequence
v[0] = x;
v[1] = y;
v[2] = z;
The routine is useful largely for two reasons. First, it
reduces the chance that the programmer will make a "cut and
paste" mistake, like
v[0] = x;
v[0] = y;
v[0] = z;
Second, it makes conversions between equivalent units simpler,
and clearer. For instance, the sequence
v[0] = x * rpd_c();
v[1] = y * rpd_c();
v[2] = z * rpd_c();
can be replaced by the (nearly) equivalent sequence
vpack_c ( x, y, z, v );
vscl_c ( rpd_c(), v, v );
See: Detailed_Description.
None.
None.
N.J. Bachman (JPL)
I.M. Underwood (JPL)
-CSPICE Version 1.0.0, 24-MAY-1999 (IMU) (NJB)
pack three scalar components into a vector
Link to routine vpack_c source file vpack_c.c
|