Fawkes API
Fawkes Development Version
|
A homogeneous representation of a polar coordinate. More...
#include <>>
Public Member Functions | |
HomPolar (float r=0.0, float phi=0.0) | |
Constructor (two-dimensional). More... | |
HomPolar (float r, float phi_x, float phi_y) | |
Constructor (three-dimensional). More... | |
HomPolar (const HomCoord &h) | |
Copy constructor. More... | |
virtual | ~HomPolar () |
Desctructor. More... | |
float | r () const |
Obtain the radius. More... | |
void | r (float r) |
Set the radius. More... | |
float | phi () const |
Get the rotation angle around the z-axis. More... | |
void | phi (float phi) |
Set the rotation angle around the z-axis. More... | |
float | phi_z () const |
Get the rotation angle around the z-axis. More... | |
void | phi_z (float phi_z) |
Set the rotation angle around the z-axis. More... | |
float | phi_y () const |
Obtain the rotation angle around the y-axis after rotating around the z-axis. More... | |
void | phi_y (float phi_y) |
Set the rotation angle around the y-axis after rotating around the z-axis. More... | |
void | phi (float phi_x, float phi_y) |
Set both rotation angles. More... | |
virtual HomPolar & | rotate_x (float rad) |
Convenience function to rotate the HomCoord around the x-axis. More... | |
virtual HomPolar & | rotate_y (float rad) |
Convenience function to rotate the HomCoord around the y-axis. More... | |
virtual HomPolar & | rotate_z (float rad) |
Convenience function to rotate the HomCoord around the z-axis. More... | |
virtual HomPolar | operator- (const HomPolar &h) const |
Substraction operator. More... | |
virtual HomPolar & | operator-= (const HomPolar &h) |
Subtraction-assignment operator. More... | |
virtual HomPolar | operator+ (const HomPolar &h) const |
Addition operator. More... | |
virtual HomPolar & | operator+= (const HomPolar &h) |
Addition-assignment operator. More... | |
virtual HomPolar & | operator= (const HomPolar &h) |
Assignemnt operator. More... | |
HomVector | get_vector () const |
Convert the polar coordinate to a cartesian coordinate. More... | |
![]() | |
HomVector (float x=0, float y=0, float z=0) | |
Constructor. More... | |
HomVector (const HomCoord &h) | |
Constructor. More... | |
virtual | ~HomVector () |
Destructor. More... | |
float | length () const |
Calculates the length of the vector. More... | |
float | length_square () const |
Calculates the squared length length of the vector (faster than length. More... | |
HomVector & | set_length (float length) |
Scales the vector such that it has the given length. More... | |
HomVector & | unit () |
Brings the vector to unit-length. More... | |
float | angle_xy (const HomVector &h) const |
Compute the angle between two vectors. More... | |
![]() | |
HomCoord (const HomCoord &c) | |
Copy constructor. More... | |
virtual | ~HomCoord () |
Destructor. More... | |
virtual float | x () const |
RO-getter for x. More... | |
virtual float & | x () |
RW-getter for x. More... | |
virtual HomCoord & | x (float x) |
Setter function for x. More... | |
virtual float | y () const |
RO-getter for y. More... | |
virtual float & | y () |
RW-getter for y. More... | |
virtual HomCoord & | y (float y) |
Setter function for y. More... | |
virtual float | z () const |
RO-getter for z. More... | |
virtual float & | z () |
RW-getter for z. More... | |
virtual HomCoord & | z (float z) |
Setter function for z. More... | |
virtual float | w () const |
RO-getter for w. More... | |
virtual float & | w () |
RW-getter for w. More... | |
virtual HomCoord & | w (float w) |
Setter function for w. More... | |
HomCoord & | transform (const HomTransform &t) |
Transform the vector with the given transform. More... | |
virtual HomCoord | operator- (const HomCoord &h) const |
Subtraction operator. More... | |
virtual HomCoord & | operator-= (const HomCoord &h) |
Substraction-assignment operator. More... | |
virtual HomCoord | operator+ (const HomCoord &h) const |
Addition operator. More... | |
virtual HomCoord & | operator+= (const HomCoord &h) |
Addition-assignment operator. More... | |
virtual float | operator* (const HomCoord &h) const |
Calculates the dot product of two coords. More... | |
virtual HomCoord | operator* (const float s) const |
Mulitplication operator. More... | |
virtual HomCoord & | operator*= (const float s) |
Multiplication-assignment operator. More... | |
virtual HomCoord & | operator= (const HomCoord &h) |
Assignment operator. More... | |
virtual bool | operator== (const HomCoord &h) const |
Comparison operator. More... | |
virtual bool | operator!= (const HomCoord &h) const |
Inequality operator. More... | |
![]() | |
Printable () | |
Constructor. More... | |
virtual | ~Printable () |
Destructor. More... | |
Additional Inherited Members | |
![]() | |
HomCoord (float x=0.0, float y=0.0, float z=0.0, float w=0.0) | |
Constructor. More... | |
HomCoord (const Vector &v) | |
Constructor. More... | |
virtual std::ostream & | print (std::ostream &stream) const |
Appends the components of the HomCoord to the ostream. More... | |
![]() | |
Vector * | m_vector |
The internal data container. More... | |
A homogeneous representation of a polar coordinate.
Definition at line 31 of file hom_polar.h.
fawkes::HomPolar::HomPolar | ( | float | r = 0.0 , |
float | phi = 0.0 |
||
) |
Constructor (two-dimensional).
r | the radius |
phi | the rotation around the z-axis |
Definition at line 40 of file hom_polar.cpp.
References phi(), r(), and fawkes::HomCoord::rotate_z().
Referenced by operator+(), and operator-().
fawkes::HomPolar::HomPolar | ( | float | r, |
float | phi_z, | ||
float | phi_y | ||
) |
Constructor (three-dimensional).
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 phi_y(), phi_z(), r(), fawkes::HomCoord::rotate_y(), and fawkes::HomCoord::rotate_z().
fawkes::HomPolar::HomPolar | ( | const HomCoord & | h | ) |
Copy constructor.
h | a HomCoord |
Definition at line 69 of file hom_polar.cpp.
References fawkes::HomCoord::x(), fawkes::HomCoord::y(), and fawkes::HomCoord::z().
|
virtual |
Desctructor.
Definition at line 78 of file hom_polar.cpp.
HomVector fawkes::HomPolar::get_vector | ( | ) | const |
Convert the polar coordinate to a 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.
p | another polar position |
Definition at line 290 of file hom_polar.cpp.
References HomPolar(), fawkes::HomCoord::x(), fawkes::HomCoord::y(), and fawkes::HomCoord::z().
Addition-assignment operator.
p | the other polar position |
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.
p | another polar position |
Definition at line 260 of file hom_polar.cpp.
References HomPolar(), fawkes::HomCoord::x(), fawkes::HomCoord::y(), and fawkes::HomCoord::z().
Subtraction-assignment operator.
p | the other polar position |
Definition at line 275 of file hom_polar.cpp.
Assignemnt operator.
p | the other polar position |
Definition at line 317 of file hom_polar.cpp.
References fawkes::HomCoord::operator=().
float fawkes::HomPolar::phi | ( | ) | const |
Get the rotation angle around the z-axis.
Definition at line 112 of file hom_polar.cpp.
Referenced by HomPolar(), and phi().
void fawkes::HomPolar::phi | ( | float | phi | ) |
Set the rotation angle around the z-axis.
phi | the rotation angle around the z-axis |
Definition at line 121 of file hom_polar.cpp.
References phi(), phi_y(), fawkes::HomTransform::rotate_y(), fawkes::HomTransform::rotate_z(), fawkes::HomCoord::x(), fawkes::HomCoord::y(), and fawkes::HomCoord::z().
void fawkes::HomPolar::phi | ( | float | phi_z, |
float | phi_y | ||
) |
Set both rotation angles.
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 phi_y(), 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.
Definition at line 174 of file hom_polar.cpp.
Referenced by HomPolar(), phi(), phi_y(), and phi_z().
void fawkes::HomPolar::phi_y | ( | float | phi_y | ) |
Set the rotation angle around the y-axis after rotating around the z-axis.
phi_y | the new rotation angle around the y-axis |
Definition at line 183 of file hom_polar.cpp.
References phi_y(), phi_z(), 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.
Definition at line 143 of file hom_polar.cpp.
Referenced by HomPolar(), phi(), phi_y(), and phi_z().
void fawkes::HomPolar::phi_z | ( | float | phi_z | ) |
Set the rotation angle around the z-axis.
phi_z | the rotation angle around the z-axis |
Definition at line 152 of file hom_polar.cpp.
References phi_y(), phi_z(), fawkes::HomTransform::rotate_y(), fawkes::HomTransform::rotate_z(), fawkes::HomCoord::x(), fawkes::HomCoord::y(), and fawkes::HomCoord::z().
float fawkes::HomPolar::r | ( | ) | const |
Obtain the radius.
Definition at line 86 of file hom_polar.cpp.
Referenced by HomPolar(), and r().
void fawkes::HomPolar::r | ( | float | r | ) |
Set the radius.
r | the new radius |
Definition at line 95 of file hom_polar.cpp.
References r(), rotate_y(), rotate_z(), fawkes::HomVector::set_length(), fawkes::HomCoord::x(), fawkes::HomCoord::y(), and fawkes::HomCoord::z().
|
virtual |
Convenience function to rotate the HomCoord around the x-axis.
rad | the roation angle in rad |
Reimplemented from fawkes::HomCoord.
Definition at line 222 of file hom_polar.cpp.
References fawkes::HomCoord::rotate_x(), fawkes::HomCoord::x(), fawkes::HomCoord::y(), and fawkes::HomCoord::z().
|
virtual |
Convenience function to rotate the HomCoord around the y-axis.
rad | the roation angle in rad |
Reimplemented from fawkes::HomCoord.
Definition at line 233 of file hom_polar.cpp.
References fawkes::HomCoord::rotate_y(), fawkes::HomCoord::x(), fawkes::HomCoord::y(), and fawkes::HomCoord::z().
Referenced by r().
|
virtual |
Convenience function to rotate the HomCoord around the z-axis.
rad | the roation angle in rad |
Reimplemented from fawkes::HomCoord.
Definition at line 244 of file hom_polar.cpp.
References fawkes::HomCoord::rotate_z().
Referenced by r().