Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
QuaternionOperators.hh
1 /*
2 This file is part of the BIAS library (Basic ImageAlgorithmS).
3 
4 Copyright (C) 2003-2009 (see file CONTACT for details)
5  Multimediale Systeme der Informationsverarbeitung
6  Institut fuer Informatik
7  Christian-Albrechts-Universitaet Kiel
8 
9 
10 BIAS is free software; you can redistribute it and/or modify
11 it under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
13 (at your option) any later version.
14 
15 BIAS is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU Lesser General Public License for more details.
19 
20 You should have received a copy of the GNU Lesser General Public License
21 along with BIAS; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 */
24 
25 
26 #ifndef __QuaternionOperators_hh__
27 #define __QuaternionOperators_hh__
28 
29 namespace BIAS {
30 
31  // forward declarations to avoid nested includes
32  template<class T> class Quaternion;
33 
34  ////////////////////////////////////////////////////////////////////////////
35  // quaternion operators
36  ////////////////////////////////////////////////////////////////////////////
37 
38  /** @relates Quaternion
39  what it stands for (wraps Mult())
40  @author herzog 2005-07-15 */
41  template<class T>
43  const Quaternion<T>& r)
44  {
45  Quaternion<T> q = l;
46  q.Mult(r);
47  return q;
48  }
49 
50  /** @relates Quaternion
51  what it stands for (wraps Mult())
52  @author herzog 2005-07-15 */
53  template<class T>
55  const Quaternion<T>& r)
56  {
57  l.Mult(r);
58  return l;
59  }
60 
61  /** @relates Quaternion
62  what it stands for (wraps Mult() and Inverse())
63  @author herzog 2005-07-15 */
64  template<class T>
66  const Quaternion<T>& r)
67  {
68  Quaternion<T> q = l;
69  q.Mult(r.Inverse());
70  return q;
71  }
72 
73  /** @relates Quaternion
74  what it stands for (wraps Mult() and Inverse())
75  @author herzog 2005-07-15 */
76  template<class T>
78  const Quaternion<T>& r)
79  {
80  l.Mult(r.Inverse());
81  return l;
82  }
83 
84 } // namespace
85 
86 #endif // __QuaternionOperators_hh__
DualQuaternion< T > operator/(const DualQuaternion< T > &l, const T &scalar)
BIASMathBase_EXPORT Vector2< T > & operator/=(Vector2< T > &vec, const Vector2< T > &argvec)
elementwise division
Definition: Vector2.hh:846
class BIASGeometryBase_EXPORT Quaternion
Definition: RMatrixBase.hh:37
Vector2< T > & operator*=(Vector2< T > &vec, const T &scalar)
Multiplication operator with scalar argument.
Definition: Vector2.hh:873
Quaternion< QUAT_TYPE > Inverse() const
returns the Inverse rotation Quaternion
Definition: Quaternion.hh:42
void Mult(const Quaternion< QUAT_TYPE > &quat)
quaternion multiplication: this= this * quat
Definition: Quaternion.hh:73
DualQuaternion< T > operator*(const DualQuaternion< T > &l, const T &scalar)
class for rotation with axis and angle