twovec_c

Index Page twovec_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 twovec_c ( ConstSpiceDouble    axdef  [3],
                       SpiceInt            indexa,
                       ConstSpiceDouble    plndef [3],
                       SpiceInt            indexp,
                       SpiceDouble         mout   [3][3] )
#### Abstract
        Find the transformation to the right-handed frame having a
        given vector as a specified axis and having a second given
        vector lying in a specified coordinate plane.
#### Required_Reading
       None.
#### Keywords
        AXES,  FRAME,  ROTATION,  TRANSFORMATION
#### Brief_I/O
        VARIABLE  I/O  DESCRIPTION
        --------  ---  -------------------------------------------------
        axdef      I   Vector defining a principal axis.
        indexa     I   Principal axis number of axdef (X=1, Y=2, Z=3).
        plndef     I   Vector defining (with axdef) a principal plane.
        indexp     I   Second axis number (with indexa) of principal
                       plane.
        mout       O   Output rotation matrix.
#### Detailed_Input
        axdef      is a vector defining one of the principal axes of a
                   coordinate frame.

        indexa     is a number that determines which of the three
                   coordinate axes contains axdef.

                   If indexa is 1 then axdef defines the X axis of the
                   coordinate frame.

                   If indexa is 2 then axdef defines the Y axis of the
                   coordinate frame.

                   If indexa is 3 then axdef defines the Z axis of the
                   coordinate frame

        plndef     is a vector defining (with axdef) a principal plane of
                   the coordinate frame.

        indexp     is the second axis of the principal frame determined
                   by axdef and plndef.

                   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.
#### Detailed_Output
        mout       is a rotation matrix that transforms coordinates given
                   in the input frame to the frame determined by axdef,
                   plndef, indexa and indexp.
#### Parameters
        None.
#### Exceptions
       1) If indexa or indexp is not in the set {1,2,3} the error
          SPICE(BADINDEX) will be signalled.

       2) If indexa and indexp are the same the error
          SPICE(UNDEFINEDFRAME) will be signalled.

       3) If the cross product of the vectors axdef and plndef is zero,
          the error SPICE(DEPENDENTVECTORS) will be signalled.
#### Files
        None.
#### Particulars
        Given two linearly independent vectors there is a unique
        right-handed coordinate frame having:

           1) axdef lying along the indexa axis.

           2) plndef lying in the indexa-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

                                 t
                   mout * (x,y,z)

        in the frame determined by axdef and plndef.
#### Examples
        The rotation matrix ticc from inertial to Sun-Canopus
        (celestial) coordinates is found by the call

           twovec_c ( Sun_vector, 3, Canopus_vector, 1, ticc );
#### Restrictions
        indexa, indexp must be different and be integers from 1 to 3.

        axdef and plndef must be linearly independent.
#### Literature_References
        None.
#### Author_and_Institution
        W.M. Owen       (JPL)
        W.L. Taber      (JPL)
#### Version
       -CSPICE Version 1.1.0, 22-OCT-1998 (NJB)

          Made input matrices const.

       -CSPICE Version 1.0.0, 2-MAR-1998
#### Index_Entries
       define an orthonormal frame from two vectors
#### Link to routine twovec_c source file twovec_c.c

    Thu Apr 16 08:59:25 2009