Fawkes API  Fawkes Development Version
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_ */
HomVector get_vector() const
Convert the polar coordinate to a cartesian coordinate.
Definition: hom_polar.cpp:332
float phi_z() const
Get the rotation angle around the z-axis.
Definition: hom_polar.cpp:143
A homogeneous representation of a polar coordinate.
Definition: hom_polar.h:31
Fawkes library namespace.
virtual ~HomPolar()
Desctructor.
Definition: hom_polar.cpp:78
float r() const
Obtain the radius.
Definition: hom_polar.cpp:86
float phi_y() const
Obtain the rotation angle around the y-axis after rotating around the z-axis.
Definition: hom_polar.cpp:174
virtual HomPolar operator+(const HomPolar &h) const
Addition operator.
Definition: hom_polar.cpp:290
virtual HomPolar & rotate_x(float rad)
Convenience function to rotate the HomCoord around the x-axis.
Definition: hom_polar.cpp:222
virtual HomPolar & rotate_z(float rad)
Convenience function to rotate the HomCoord around the z-axis.
Definition: hom_polar.cpp:244
float phi() const
Get the rotation angle around the z-axis.
Definition: hom_polar.cpp:112
virtual HomPolar & operator=(const HomPolar &h)
Assignemnt operator.
Definition: hom_polar.cpp:317
Base class for homogeneous primitives (vector and point).
Definition: hom_coord.h:34
virtual HomPolar & operator-=(const HomPolar &h)
Subtraction-assignment operator.
Definition: hom_polar.cpp:275
A homogeneous vector.
Definition: hom_vector.h:31
virtual HomPolar & rotate_y(float rad)
Convenience function to rotate the HomCoord around the y-axis.
Definition: hom_polar.cpp:233
HomPolar(float r=0.0, float phi=0.0)
Constructor (two-dimensional).
Definition: hom_polar.cpp:40
virtual HomPolar & operator+=(const HomPolar &h)
Addition-assignment operator.
Definition: hom_polar.cpp:305
virtual HomPolar operator-(const HomPolar &h) const
Substraction operator.
Definition: hom_polar.cpp:260