Index Page
cspice_frame
A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X 

Abstract
I/O
Examples
Particulars
Required Reading
Version
Index_Entries

Abstract


   CSPICE_FRAME builds a right handed orthonormal frame x, y, z,
   given an input vector 'vec' where the output vector 'x'
   is parallel to the original input vector.

I/O


   Given:

      vec   the vector used to form the first vector of a right-handed
            orthonormal triple.

            [3,1] = size(vec); double = class(vec)

   the call:

      [ x, y, z ] = cspice_frame( vec )

   returns:

      x   
      y   
      z   [3,1] = size(x); double = class(x)
          [3,1] = size(y); double = class(y)
          [3,1] = size(z); double = class(z)

          the vectors that form a right handed orthonormal frame, with
          output 'x' parallel to the input 'vec'.

Examples


   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.

      %
      % Given some arbitrary vector
      %
      vec = [ 23., -3., 18. ]';

      %
      % Create an orthonormal frame with the
      % x axis parallel to vec.
      %
      disp( 'Input vector parallel to output X vector' )

      [ x, y, z ] = cspice_frame( vec );
      fprintf( 'x  %16.8e   %16.8e   %16.8e\n', x )
      fprintf( 'y  %16.8e   %16.8e   %16.8e\n', y )
      fprintf( 'z  %16.8e   %16.8e   %16.8e\n\n', z )



      %
      % Alternative, make a frame with y parallel to
      % vec...
      %
      disp( 'Input vector parallel to output Y vector' )

      [ y, z, x ] = cspice_frame( vec );
      fprintf( 'x  %16.8e   %16.8e   %16.8e\n', x )
      fprintf( 'y  %16.8e   %16.8e   %16.8e\n', y )
      fprintf( 'z  %16.8e   %16.8e   %16.8e\n\n', z )



      %
      % ...or a frame with z parallel to vec.
      %
      disp( 'Input vector parallel to output Z vector' )

      [ z, x, y ] = cspice_frame( vec );
      fprintf( 'x  %16.8e   %16.8e   %16.8e\n', x )
      fprintf( 'y  %16.8e   %16.8e   %16.8e\n', y )
      fprintf( 'z  %16.8e   %16.8e   %16.8e\n\n', z )

   MATLAB outputs:

      Input vector parallel to output X vector
      x    7.83383109e-01    -1.02180405e-01     6.13082433e-01
      y    6.16308262e-01     0.00000000e+00    -7.87505001e-01
      z    8.04675803e-02     9.94765884e-01     6.29746281e-02

      Input vector parallel to output Y vector
      x    8.04675803e-02     9.94765884e-01     6.29746281e-02
      y    7.83383109e-01    -1.02180405e-01     6.13082433e-01
      z    6.16308262e-01     0.00000000e+00    -7.87505001e-01

      Input vector parallel to output Z vector
      x    6.16308262e-01     0.00000000e+00    -7.87505001e-01
      y    8.04675803e-02     9.94765884e-01     6.29746281e-02
      z    7.83383109e-01    -1.02180405e-01     6.13082433e-01

Particulars


    Given an input vector x, this routine returns unit vectors x,
    y, and z such that xyz forms a right-handed orthonormal frame
    where the output x is parallel to the input x.

    This routine is intended primarily to provide a basis for
    the plane orthogonal to x.  There are no special properties
    associated with y and z other than that the resulting xyz frame
    is right handed and orthonormal. There are an infinite
    collection of pairs (y,z) that could be used to this end.
    Even though for a given x, y and z are uniquely determined, users
    should regard the pair (y,z) as a random selection from this
    infinite collection.

Required Reading


   For important details concerning this module's function, please refer to
   the CSPICE routine frame_c.

   MICE.REQ
   FRAMES.REQ

Version


   -Mice Version 1.0.0, 12-MAR-2012, EDW (JPL), SCK (JPL)

Index_Entries


   build a right handed coordinate frame


Wed Apr  5 18:00:31 2017