ViSP  2.8.0
vpRotationMatrix.h
1 /****************************************************************************
2  *
3  * $Id: vpRotationMatrix.h 4056 2013-01-05 13:04:42Z fspindle $
4  *
5  * This file is part of the ViSP software.
6  * Copyright (C) 2005 - 2013 by INRIA. All rights reserved.
7  *
8  * This software is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * ("GPL") version 2 as published by the Free Software Foundation.
11  * See the file LICENSE.txt at the root directory of this source
12  * distribution for additional information about the GNU GPL.
13  *
14  * For using ViSP with software that can not be combined with the GNU
15  * GPL, please contact INRIA about acquiring a ViSP Professional
16  * Edition License.
17  *
18  * See http://www.irisa.fr/lagadic/visp/visp.html for more information.
19  *
20  * This software was developed at:
21  * INRIA Rennes - Bretagne Atlantique
22  * Campus Universitaire de Beaulieu
23  * 35042 Rennes Cedex
24  * France
25  * http://www.irisa.fr/lagadic
26  *
27  * If you have questions regarding the use of this file, please contact
28  * INRIA at visp@inria.fr
29  *
30  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
31  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
32  *
33  *
34  * Description:
35  * Rotation matrix.
36  *
37  * Authors:
38  * Eric Marchand
39  *
40  *****************************************************************************/
41 
42 
43 #ifndef vpROTATIONMATRIX_H
44 #define vpROTATIONMATRIX_H
45 
51 #include <visp/vpMatrix.h>
52 #include <visp/vpRxyzVector.h>
53 #include <visp/vpRzyxVector.h>
54 #include <visp/vpRzyzVector.h>
55 #include <visp/vpThetaUVector.h>
56 #include <visp/vpTranslationVector.h>
57 #include <visp/vpQuaternionVector.h>
58 
72 class VISP_EXPORT vpRotationMatrix : public vpMatrix
73 {
74  friend class vpMatrix;
75  friend class vpRxyzVector;
76  friend class vpRzyzVector;
77  friend class vpRzyxVector;
78  friend class vpThetaUVector;
79  friend class vpTranslationVector;
80 public:
82  void init() ;
83 
85  void setIdentity() ;
86  void eye();
94  vpRotationMatrix(const vpRzyzVector &r) ;
96  vpRotationMatrix(const vpRxyzVector &r) ;
98  vpRotationMatrix(const vpRzyxVector &r) ;
100  vpRotationMatrix(const double tux, const double tuy, const double tuz) ;
101 
103 
104 
108  vpRotationMatrix &operator=(const vpMatrix &m) ;
114  vpMatrix operator*(const vpMatrix &B) const ;
115  // operation v2 = A * v1 (A is unchanged)
116  vpColVector operator*(const vpColVector &v) const ;
121 
123  vpRotationMatrix t() const ;
124 
126  vpRotationMatrix inverse() const ;
128  void inverse(vpRotationMatrix &M) const;
129 
131  bool isARotationMatrix() const ;
132 
134  void printVector() ;
135  friend VISP_EXPORT std::ostream &operator << (std::ostream &s, const vpRotationMatrix &m);
136 
138  vpRotationMatrix buildFrom(const vpThetaUVector &v) ;
141  vpRotationMatrix buildFrom(const vpRzyzVector &v) ;
143  vpRotationMatrix buildFrom(const vpRxyzVector &v) ;
145  vpRotationMatrix buildFrom(const vpRzyxVector &v) ;
147  vpRotationMatrix buildFrom(const double tux,
148  const double tuy,
149  const double tuz) ;
150 
151  vpRotationMatrix buildFrom(const vpQuaternionVector& q);
152 private:
153  static const double threshold;
154  static const double minimum; // useful only for debug
155  };
156 
157 #endif
158 
159 /*
160  * Local variables:
161  * c-basic-offset: 2
162  * End:
163  */
friend VISP_EXPORT std::ostream & operator<<(std::ostream &s, const vpMatrix &m)
std::cout a matrix
Definition: vpMatrix.cpp:2576
Definition of the vpMatrix class.
Definition: vpMatrix.h:96
void init()
Initialization of the object matrix.
Definition: vpMatrix.cpp:93
Class that consider the case of the Euler angle using the z-y-x convention, where are respectively ...
Definition: vpRzyxVector.h:151
The vpRotationMatrix considers the particular case of a rotation matrix.
void setIdentity(const double &val=1.0)
Definition: vpMatrix.cpp:1110
vpMatrix & operator=(const vpMatrix &B)
Copy operator. Allow operation such as A = B.
Definition: vpMatrix.cpp:316
vpMatrix operator+(const vpMatrix &B) const
Definition: vpMatrix.cpp:544
Defines a quaternion and its basic operations.
void eye(unsigned int n)
Definition: vpMatrix.cpp:1132
vpMatrix t() const
Definition: vpMatrix.cpp:1176
Class that provides a data structure for the column vectors as well as a set of operations on these v...
Definition: vpColVector.h:72
vpMatrix operator*(const vpMatrix &B) const
Definition: vpMatrix.cpp:436
Class that consider the case of the Euler angle using the x-y-z convention, where are respectively ...
Definition: vpRxyzVector.h:152
vpMatrix operator-() const
Definition: vpMatrix.cpp:751
Class that consider the case of the Euler angles using the z-y-z convention, where are respectively...
Definition: vpRzyzVector.h:150
Class that consider the case of a translation vector.
Class that consider the case of the parameterization for the rotation.