fawkes::HomPolar Class Reference
A homogeneous representation of a polar coordinate. More...
#include <geometry/hom_polar.h>

Public Member Functions | |
| HomPolar (float r=0.0, float phi=0.0) | |
| Constructor (two-dimensional). | |
| HomPolar (float r, float phi_x, float phi_y) | |
| Constructor (three-dimensional). | |
| HomPolar (const HomCoord &h) | |
| Copy constructor. | |
| virtual | ~HomPolar () |
| Desctructor. | |
| float | r () const |
| Obtain the radius. | |
| void | r (float r) |
| Set the radius. | |
| float | phi () const |
| Get the rotation angle around the z-axis. | |
| void | phi (float phi) |
| Set the rotation angle around the z-axis. | |
| float | phi_z () const |
| Get the rotation angle around the z-axis. | |
| void | phi_z (float phi_z) |
| Set the rotation angle around the z-axis. | |
| float | phi_y () const |
| Obtain the rotation angle around the y-axis after rotating around the z-axis. | |
| void | phi_y (float phi_y) |
| Set the rotation angle around the y-axis after rotating around the z-axis. | |
| void | phi (float phi_x, float phi_y) |
| Set both rotation angles. | |
| virtual HomPolar & | rotate_x (float rad) |
| Convenience function to rotate the HomCoord around the x-axis. | |
| virtual HomPolar & | rotate_y (float rad) |
| Convenience function to rotate the HomCoord around the y-axis. | |
| virtual HomPolar & | rotate_z (float rad) |
| Convenience function to rotate the HomCoord around the z-axis. | |
| virtual HomPolar | operator- (const HomPolar &h) const |
| Substraction operator. | |
| virtual HomPolar & | operator-= (const HomPolar &h) |
| Subtraction-assignment operator. | |
| virtual HomPolar | operator+ (const HomPolar &h) const |
| Addition operator. | |
| virtual HomPolar & | operator+= (const HomPolar &h) |
| Addition-assignment operator. | |
| virtual HomPolar & | operator= (const HomPolar &h) |
| Assignemnt operator. | |
| HomVector | get_vector () const |
| Convert the polar coordinate to a cartesian coordinate. | |
Detailed Description
A homogeneous representation of a polar coordinate.
Definition at line 31 of file hom_polar.h.
Constructor & Destructor Documentation
| fawkes::HomPolar::HomPolar | ( | float | r = 0.0, |
|
| float | phi = 0.0 | |||
| ) |
Constructor (two-dimensional).
- Parameters:
-
r the radius phi the rotation around the z-axis
Definition at line 40 of file hom_polar.cpp.
References rotate_z().
Referenced by operator+(), and operator-().
| fawkes::HomPolar::HomPolar | ( | float | r, | |
| float | phi_z, | |||
| float | phi_y | |||
| ) |
Constructor (three-dimensional).
- Parameters:
-
r the radius phi_z the rotation around the z-axis phi_y the rotation around the new y-axis (after rotating around the z-axis)
Definition at line 55 of file hom_polar.cpp.
References rotate_y(), and rotate_z().
| fawkes::HomPolar::HomPolar | ( | const HomCoord & | h | ) |
Copy constructor.
- Parameters:
-
h a HomCoord
Definition at line 69 of file hom_polar.cpp.
References fawkes::HomCoord::x(), fawkes::HomCoord::y(), and fawkes::HomCoord::z().
| fawkes::HomPolar::~HomPolar | ( | ) | [virtual] |
Member Function Documentation
| HomVector fawkes::HomPolar::get_vector | ( | ) | const |
Convert the polar coordinate to a cartesian coordinate.
- Returns:
- the cartesian coordinate
Definition at line 332 of file hom_polar.cpp.
References fawkes::HomCoord::x(), fawkes::HomCoord::y(), and fawkes::HomCoord::z().
Addition operator.
The result of adding two polar positions from each other is another polar position that represent the cartesian vector which is the result of adding the corresponding cartesian vectors to each other.
- Parameters:
-
p another polar position
- Returns:
- the result of the substraction
Definition at line 290 of file hom_polar.cpp.
References HomPolar(), fawkes::HomCoord::x(), fawkes::HomCoord::y(), and fawkes::HomCoord::z().
Addition-assignment operator.
- Parameters:
-
p the other polar position
- Returns:
- reference of the result
Definition at line 305 of file hom_polar.cpp.
Substraction operator.
The result of subtracting two polar positions from each other is another polar position that represent the cartesian vector which is the result of subtracting the corresponding cartesian vectors from each other.
- Parameters:
-
p another polar position
- Returns:
- the result of the substraction
Definition at line 260 of file hom_polar.cpp.
References HomPolar(), fawkes::HomCoord::x(), fawkes::HomCoord::y(), and fawkes::HomCoord::z().
Subtraction-assignment operator.
- Parameters:
-
p the other polar position
- Returns:
- reference of the result
Definition at line 275 of file hom_polar.cpp.
Assignemnt operator.
- Parameters:
-
p the other polar position
- Returns:
- reference of the result
Definition at line 317 of file hom_polar.cpp.
| void fawkes::HomPolar::phi | ( | float | phi_z, | |
| float | phi_y | |||
| ) |
Set both rotation angles.
- Parameters:
-
phi_z the rotation angle around the z-axis phi_y the rotation angle around the y-axis
Definition at line 205 of file hom_polar.cpp.
References fawkes::HomTransform::rotate_y(), fawkes::HomTransform::rotate_z(), fawkes::HomCoord::x(), fawkes::HomCoord::y(), and fawkes::HomCoord::z().
| void fawkes::HomPolar::phi | ( | float | phi | ) |
Set the rotation angle around the z-axis.
- Parameters:
-
phi the rotation angle around the z-axis
Definition at line 121 of file hom_polar.cpp.
References phi_y(), fawkes::HomTransform::rotate_y(), fawkes::HomTransform::rotate_z(), fawkes::HomCoord::x(), fawkes::HomCoord::y(), and fawkes::HomCoord::z().
| float fawkes::HomPolar::phi | ( | ) | const |
Get the rotation angle around the z-axis.
- Returns:
- the rotation angle around the z-axis
Definition at line 112 of file hom_polar.cpp.
| void fawkes::HomPolar::phi_y | ( | float | phi_y | ) |
Set the rotation angle around the y-axis after rotating around the z-axis.
- Parameters:
-
phi_y the new rotation angle around the y-axis
Definition at line 183 of file hom_polar.cpp.
References phi_z(), fawkes::HomTransform::rotate_y(), fawkes::HomTransform::rotate_z(), fawkes::HomCoord::x(), fawkes::HomCoord::y(), and fawkes::HomCoord::z().
| float fawkes::HomPolar::phi_y | ( | ) | const |
Obtain the rotation angle around the y-axis after rotating around the z-axis.
- Returns:
- the rotation angle around the y-axis
Definition at line 174 of file hom_polar.cpp.
| void fawkes::HomPolar::phi_z | ( | float | phi_z | ) |
Set the rotation angle around the z-axis.
- Parameters:
-
phi_z the rotation angle around the z-axis
Definition at line 152 of file hom_polar.cpp.
References phi_y(), fawkes::HomTransform::rotate_y(), fawkes::HomTransform::rotate_z(), fawkes::HomCoord::x(), fawkes::HomCoord::y(), and fawkes::HomCoord::z().
| float fawkes::HomPolar::phi_z | ( | ) | const |
Get the rotation angle around the z-axis.
- Returns:
- the rotation angle around the z-axis
Definition at line 143 of file hom_polar.cpp.
Referenced by phi_y().
| void fawkes::HomPolar::r | ( | float | r | ) |
Set the radius.
- Parameters:
-
r the new radius
Definition at line 95 of file hom_polar.cpp.
References rotate_y(), rotate_z(), fawkes::HomVector::set_length(), fawkes::HomCoord::x(), fawkes::HomCoord::y(), and fawkes::HomCoord::z().
| float fawkes::HomPolar::r | ( | ) | const |
| HomPolar & fawkes::HomPolar::rotate_x | ( | float | rad | ) | [virtual] |
Convenience function to rotate the HomCoord around the x-axis.
- Parameters:
-
rad the roation angle in rad
Reimplemented from fawkes::HomCoord.
Definition at line 222 of file hom_polar.cpp.
References fawkes::HomCoord::x(), fawkes::HomCoord::y(), and fawkes::HomCoord::z().
| HomPolar & fawkes::HomPolar::rotate_y | ( | float | rad | ) | [virtual] |
Convenience function to rotate the HomCoord around the y-axis.
- Parameters:
-
rad the roation angle in rad
Reimplemented from fawkes::HomCoord.
Definition at line 233 of file hom_polar.cpp.
References fawkes::HomCoord::x(), fawkes::HomCoord::y(), and fawkes::HomCoord::z().
Referenced by HomPolar(), and r().
| HomPolar & fawkes::HomPolar::rotate_z | ( | float | rad | ) | [virtual] |
Convenience function to rotate the HomCoord around the z-axis.
- Parameters:
-
rad the roation angle in rad
Reimplemented from fawkes::HomCoord.
Definition at line 244 of file hom_polar.cpp.
Referenced by HomPolar(), and r().
The documentation for this class was generated from the following files:
- src/libs/geometry/hom_polar.h
- src/libs/geometry/hom_polar.cpp

