Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
DualQuaternionOperators.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 __DualQuaternionOperators_hh__
27 #define __DualQuaternionOperators_hh__
28 
29 namespace BIAS {
30 
31  // forward declarations to avoid nested includes
32  template<class T> class Quaternion;
33  template<class T> class DualQuaternion;
34 
35  ////////////////////////////////////////////////////////////////////////////
36  // dual quaternion operators
37  ////////////////////////////////////////////////////////////////////////////
38 
39  template<class T>
41  const DualQuaternion<T>& r)
42  {
43  DualQuaternion<T> d(l);
44  d.Add(r);
45  return d;
46  }
47 
48  template<class T>
50  const DualQuaternion<T>& r)
51  {
52  DualQuaternion<T> d(l);
53  d.Sub(r);
54  return d;
55  }
56 
57  template<class T>
59  const T& scalar)
60  {
61  DualQuaternion<T> d(l);
62  d.Mult(scalar);
63  return d;
64  }
65 
66  template<class T>
68  const T& scalar)
69  {
70  DualQuaternion<T> d(l);
71  d.Div(scalar);
72  return d;
73  }
74 
75  /** @relates DualQuaternion
76  what it stands for (wraps Mult())
77  @author esquivel 02/2011 */
78  template<class T>
80  const DualQuaternion<T>& r)
81  {
82  DualQuaternion<T> d(l);
83  d.Mult(r);
84  return d;
85  }
86 
87  /** @relates DualQuaternion
88  what it stands for (wraps Mult() and Inverse())
89  @author esquivel 02/2011 */
90  template<class T>
92  const DualQuaternion<T>& r)
93  {
94  DualQuaternion<T> d(l);
95  d.Mult(r.Inverse());
96  return d;
97  }
98 
99 }
100 
101 #endif // __DualQuaternionOperators_hh__
void Div(const QUAT_TYPE &scalar)
DualQuaternion< T > operator/(const DualQuaternion< T > &l, const T &scalar)
DualQuaternion< T > operator-(const DualQuaternion< T > &l, const DualQuaternion< T > &r)
class representing rigid motion by dual quaternions
DualQuaternion< QUAT_TYPE > Inverse() const
DualQuaternion< T > operator+(const DualQuaternion< T > &l, const DualQuaternion< T > &r)
DualQuaternion< T > operator*(const DualQuaternion< T > &l, const T &scalar)
void Add(const DualQuaternion< QUAT_TYPE > &r)
void Sub(const DualQuaternion< QUAT_TYPE > &r)
void Mult(const QUAT_TYPE &scalar)
class for rotation with axis and angle