Table of contents
CSPICE_VPACK packs three scalar components into a vector.
Given:
x,
y,
z the scalar components of a 3-dimensional vector.
help, x
DOUBLE = Scalar
help, y
DOUBLE = Scalar
help, z
DOUBLE = Scalar
the call:
cspice_vpack, x, y, z, v
returns:
v the equivalent vector, such that
v = [ x, y, z ]
help, v
DOUBLE = Array[3]
None.
Any numerical results shown for this example may differ between
platforms as the results depend on the SPICE kernels used as input
and the machine specific arithmetic implementation.
1) Compute an upward normal of an equilateral triangle lying
in the x-y plane and centered at the origin.
Example code begins here.
PRO vpack_ex1
s = sqrt(3.D0)/2L
;;
;; Define the three corners of the triangle.
;;
cspice_vpack, s, -0.5D0, 0.D0, v1
cspice_vpack, 0.D0, 1.D0, 0.D0, v2
cspice_vpack, -s, -0.5D0, 0.D0, v3
;;
;; Compute an upward normal of the triangle.
;;
cspice_pltnrm, v1, v2, v3, normal
print, format='(A,3F17.13)', 'NORMAL = ', normal
END
When this program was executed on a Mac/Intel/IDL8.x/64-bit
platform, the output was:
NORMAL = 0.0000000000000 0.0000000000000 2.5980762113533
Native IDL code to perform the same operation:
v = [ x, y, z ]
1) If any of the input arguments, `x', `y' or `z', is undefined,
an error is signaled by the IDL error handling system.
2) If any of the input arguments, `x', `y' or `z', is not of the
expected type, or it does not have the expected dimensions and
size, an error is signaled by the Icy interface.
3) If the output argument `v' is not a named variable, an error
is signaled by the Icy interface.
None.
None.
ICY.REQ
None.
J. Diaz del Rio (ODC Space)
E.D. Wright (JPL)
-Icy Version 1.0.2, 10-AUG-2021 (JDR)
Edited the header to comply with NAIF standard. Added complete
code example.
Added -Parameters, -Exceptions, -Files, -Restrictions,
-Literature_References and -Author_and_Institution sections. Moved the
existing contents of -Examples section to -Particulars.
Removed reference to the routine's corresponding CSPICE header from
-Abstract section.
Added arguments' type and size information in the -I/O section.
-Icy Version 1.0.1, 09-DEC-2005 (EDW)
Added -Examples section.
-Icy Version 1.0.0, 16-JUN-2003 (EDW)
pack three scalar components into a vector
|