dvm3_rotmat.h

00001 #ifndef dvm3_rotmat_h_INCLUDED
00002 #define dvm3_rotmat_h_INCLUDED
00003 
00004 // File:    dvm3_rotmat.h
00005 // Author:  Terry Gaetz
00006 
00007 /* --8<--8<--8<--8<--
00008  *
00009  * Copyright (C) 2006 Smithsonian Astrophysical Observatory
00010  *
00011  * This file is part of dvm3
00012  *
00013  * dvm3 is free software; you can redistribute it and/or
00014  * modify it under the terms of the GNU General Public License
00015  * as published by the Free Software Foundation; either version 2
00016  * of the License, or (at your option) any later version.
00017  *
00018  * dvm3 is distributed in the hope that it will be useful,
00019  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00020  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00021  * GNU General Public License for more details.
00022  *
00023  * You should have received a copy of the GNU General Public License
00024  * along with this program; if not, write to the 
00025  *       Free Software Foundation, Inc. 
00026  *       51 Franklin Street, Fifth Floor
00027  *       Boston, MA  02110-1301, USA
00028  *
00029  * -->8-->8-->8-->8-- */
00030 
00031 #include <dvm3/dvm3_matrix.h>           // dvm3_Matrix
00032 #include <cfloat>                       // DBL_EPSILON
00033 
00034 //########################################################################
00035 // dvm3_RotMat
00036 //########################################################################
00037 
00069 class dvm3_RotMat
00070   : public dvm3_Matrix
00071 {
00072 public:
00073 
00115   enum EEulerAngleType { EOSAC_az_el_clock = 0, 
00116                          EX_convention = 1,  
00117                          EY_convention = 2 };
00118 
00132   enum EInputVecPair { E_XY, E_YZ, E_ZX, E_XZ, E_ZY, E_YX };
00133 
00137  ~dvm3_RotMat();
00138 
00142   dvm3_RotMat();
00143 
00149   dvm3_RotMat( dvm3_RotMat const& m );
00150 
00169   dvm3_RotMat( dvm3_Vector const& x,
00170                dvm3_Vector const& y, 
00171                dvm3_Vector const& z,
00172                double const tol = 100.0 * DBL_EPSILON );
00173 
00192   dvm3_RotMat( double const x[],
00193                double const y[],
00194                double const z[],
00195                double const tol = 100.0 * DBL_EPSILON );
00196 
00235   dvm3_RotMat( double angle0, double angle1, double angle2,
00236                EEulerAngleType angle_type = EOSAC_az_el_clock );
00237 
00285   dvm3_RotMat( dvm3_Vector const& v0,
00286                dvm3_Vector const& v1,
00287                EInputVecPair      type
00288             );
00289 
00337   dvm3_RotMat( double const v0[],
00338                double const v1[],
00339                EInputVecPair      type
00340             );
00341 
00378   void init( double angle0, double angle1, double angle2,
00379              EEulerAngleType angle_type = EOSAC_az_el_clock );
00380 
00426   void init( dvm3_Vector const& v0,
00427              dvm3_Vector const& v1,
00428              EInputVecPair      type
00429            );
00430 
00476   void init( double const v0[],
00477              double const v1[],
00478              EInputVecPair      type
00479            );
00480 
00488   dvm3_RotMat& operator=( dvm3_RotMat const& rhs );
00489 
00490   // /*
00491   //  * Assignment operator; set each element to value of rhs.
00492   //  */
00493   // dvm3_RotMat& operator=( double             rhs );
00494 
00498   void invert();
00499 
00507   int is_rotation_matrix( double const tol = 100.0 * DBL_EPSILON ) const;
00508 
00509   // friend std::ostream& operator<<( std::ostream& os, dvm3_RotMat const& );
00510 };
00511 
00512 //########################################################################
00513 //########################################################################
00514 //
00515 //    #    #    #  #          #    #    #  ######   ####
00516 //    #    ##   #  #          #    ##   #  #       #
00517 //    #    # #  #  #          #    # #  #  #####    ####
00518 //    #    #  # #  #          #    #  # #  #            #
00519 //    #    #   ##  #          #    #   ##  #       #    #
00520 //    #    #    #  ######     #    #    #  ######   ####
00521 //
00522 //########################################################################
00523 //########################################################################
00524 
00525 //=========================================================================
00526 inline dvm3_RotMat::
00527 ~dvm3_RotMat()
00528 {}
00529 
00530 //=========================================================================
00531 inline dvm3_RotMat::
00532 dvm3_RotMat( dvm3_RotMat const& other )
00533   : dvm3_Matrix( other )
00534 {}
00535 
00536 //=========================================================================
00537 inline dvm3_RotMat& dvm3_RotMat::
00538 operator=( dvm3_RotMat const& m )
00539 { data_ = m.data_;   return *this; }
00540 
00541 #endif

Generated on Tue Dec 2 15:44:47 2008 for dvm3 by  doxygen 1.5.6