CSPICE_calculates the transformation matrix to the
right-handed reference frame having an input vector as a
specified axis and a second input vector lying in a
define coordinate plane.
axdef the principal axes of a coordinate frame.
[3,1] = size(axdef); double = class(axdef)
indexa the index signifying which of the three coordinate
axes contains 'axdef' (1, 2 or 3).
[1,1] = size(indexa); int32 = class(indexa)
If 'indexa' is 1 then axdef defines the X axis of the
If 'indexa' is 2 then axdef defines the Y axis of the
If 'indexa' is 3 then axdef defines the Z axis of the
plndef a vector in the same plane as 'axdef'. 'axdef' and
'plndef' must be linearly independent.
[3,1] = size(plndef); double = class(plndef)
indexp the index signifying the second principle axis,
orthogonal to 'axdef' (1, 2 or 3).
[1,1] = size(indexp); int32 = class(indexp)
If 'indexp' is 1, the second axis of the principal
plane is the X-axis.
If 'indexp' is 2, the second axis of the principal
plane is the Y-axis.
If 'indexp' is 3, the second axis of the principal plane
is the Z-axis.
mout = cspice_twovec( axdef, indexa, plndef, indexp)
mout a double precision 3x3 array defining a rotation matrix from
the frame of the original vectors to the new frame
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.
% A trivial example. Define the reference vectors...
% The i unit vector
axdef = [ 1.; 0; 0.];
indexa = 1 ;
% The -j unit vector. For this example, any vector
% in the x-y plane linearly independent of 'axdef'
% will suffice.
plndef = [ 0.; -1.; 0.];
indexp = 2;
% Calculate the transformation matrix. The new frame
% has 'axdef' as axis 'indexa', with 'plndef' in the same
% plane, the direction axis 'indexp' in that plane
% and orthogonal to 'axdef'. A third direction vector
% completes the right handed frame.
mout = cspice_twovec( axdef, indexa, plndef, indexp )
1 0 0
0 -1 0
0 0 -1
Given two linearly independent vectors there is a unique
right-handed coordinate frame having:
axdef lying along the indexa axis.
plndef lying in the axdef-indexp coordinate plane.
This routine determines the transformation matrix that transforms
from coordinates used to represent the input vectors to the
the system determined by axdef and plndef. Thus a vector
(x,y,z) in the input coordinate system will have coordinates
in the frame determined by axdef and plndef.
For important details concerning this module's function, please refer to
the CSPICE routine twovec_c.
-Mice Version 1.0.1, 12-MAR-2015, EDW (JPL)
Edited I/O section to conform to NAIF standard for Mice documentation.
-Mice Version 1.0.0, 10-JAN-2006, EDW (JPL)
define an orthonormal frame from two vectors