Fawkes API  Fawkes Development Version
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
hom_polar.h
1 
2 /***************************************************************************
3  * hom_polar.h - A polar coordinate
4  *
5  * Created: Tue April 22 22:42:38 2008
6  * Copyright 2008 Daniel Beck
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version. A runtime exception applies to
14  * this software (see LICENSE.GPL_WRE file mentioned below for details).
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Library General Public License for more details.
20  *
21  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22  */
23 
24 #ifndef __GEOMETRY_HOM_POLAR_H_
25 #define __GEOMETRY_HOM_POLAR_H_
26 
27 #include <geometry/hom_vector.h>
28 
29 namespace fawkes {
30 
31 class HomPolar : public HomVector
32 {
33  public:
34  HomPolar(float r = 0.0, float phi = 0.0);
35  HomPolar(float r, float phi_x, float phi_y);
36  HomPolar(const HomCoord& h);
37  virtual ~HomPolar();
38 
39  float r() const;
40  void r(float r);
41 
42  float phi() const;
43  void phi(float phi);
44  float phi_z() const;
45  void phi_z(float phi_z);
46  float phi_y() const;
47  void phi_y(float phi_y);
48  void phi(float phi_x, float phi_y);
49 
50  virtual HomPolar& rotate_x(float rad);
51  virtual HomPolar& rotate_y(float rad);
52  virtual HomPolar& rotate_z(float rad);
53 
54  virtual HomPolar operator-(const HomPolar& h) const;
55  virtual HomPolar& operator-=(const HomPolar& h);
56 
57  virtual HomPolar operator+(const HomPolar& h) const;
58  virtual HomPolar& operator+=(const HomPolar& h);
59 
60  virtual HomPolar& operator=(const HomPolar& h);
61 
62  HomVector get_vector() const;
63 
64  private:
65  float m_r;
66  float m_phi_z;
67  float m_phi_y;
68 };
69 
70 } // end namespace fawkes
71 
72 #endif /* __GEOMETRY_HOM_POLART_H_ */