Index Page
cspice_diags2
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_DIAGS2 diagonalizes a symmetric, double precision,
   2x2 matrix.

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

I/O

   
   Given a 2x2 matrix of double precision values, 'symmat':
   
      cspice_diags2, symmat, diag, rotate
   
   returns the 2x2, double precision matrices, 'diag' and
   'rotate' which satisfy the equation:
                T
   diag = rotate * symmat * rotate
   

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.

   
      ;;
      ;; Define a symmetric matrix.
      ;;
      mat = [ [1.d, 4.d], [4.d, -5.d]]
   
      ;; 
      ;; Diagonalize mat.
      ;;
      cspice_diags2, mat, diag, rot
   
      ;;
      ;; Print the diagonal form of mat and
      ;; the corresponding rotation matrix.
      print, diag
      print, rot
   
   IDL outputs for diag:
          3.0000000       0.0000000
          0.0000000      -7.0000000
   
   
   IDL outputs for rot:
         0.89442719     -0.44721360
         0.44721360      0.89442719
   
      ;;
      ;; Confirm 'diag' and 'rot'.
      ;;
      diag2 = transpose(rot) ## mat ## rot
      print, diag - diag2
   
   IDL outputs:
      4.4408921e-16  -3.1924302e-17
      8.2303996e-17       0.0000000
   
   The zero matrix to double precision round-off error.

Particulars


   None.

Required Reading


   ICY.REQ

Version


   -Icy Version 1.0.0, 16-JUN-2003, EDW (JPL)

Index_Entries

 
   diagonalize symmetric 2x2_matrix 
 



Wed Apr  5 17:57:59 2017