Fawkes API  Fawkes Development Version
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
fawkes::HomPolar Class Reference

A homogeneous representation of a polar coordinate. More...

#include <>>

Inheritance diagram for fawkes::HomPolar:

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 HomPolarrotate_x (float rad)
 Convenience function to rotate the HomCoord around the x-axis. More...
 
virtual HomPolarrotate_y (float rad)
 Convenience function to rotate the HomCoord around the y-axis. More...
 
virtual HomPolarrotate_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 HomPolaroperator-= (const HomPolar &h)
 Subtraction-assignment operator. More...
 
virtual HomPolar operator+ (const HomPolar &h) const
 Addition operator. More...
 
virtual HomPolaroperator+= (const HomPolar &h)
 Addition-assignment operator. More...
 
virtual HomPolaroperator= (const HomPolar &h)
 Assignemnt operator. More...
 
HomVector get_vector () const
 Convert the polar coordinate to a cartesian coordinate. More...
 
- Public Member Functions inherited from fawkes::HomVector
 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...
 
HomVectorset_length (float length)
 Scales the vector such that it has the given length. More...
 
HomVectorunit ()
 Brings the vector to unit-length. More...
 
float angle_xy (const HomVector &h) const
 Compute the angle between two vectors. More...
 
- Public Member Functions inherited from fawkes::HomCoord
 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 HomCoordx (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 HomCoordy (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 HomCoordz (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 HomCoordw (float w)
 Setter function for w. More...
 
HomCoordtransform (const HomTransform &t)
 Transform the vector with the given transform. More...
 
virtual HomCoord operator- (const HomCoord &h) const
 Subtraction operator. More...
 
virtual HomCoordoperator-= (const HomCoord &h)
 Substraction-assignment operator. More...
 
virtual HomCoord operator+ (const HomCoord &h) const
 Addition operator. More...
 
virtual HomCoordoperator+= (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 HomCoordoperator*= (const float s)
 Multiplication-assignment operator. More...
 
virtual HomCoordoperator= (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...
 
- Public Member Functions inherited from fawkes::Printable
 Printable ()
 Constructor. More...
 
virtual ~Printable ()
 Destructor. More...
 

Additional Inherited Members

- Protected Member Functions inherited from fawkes::HomCoord
 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...
 
- Protected Attributes inherited from fawkes::HomCoord
Vectorm_vector
 The internal data container. More...
 

Detailed Description

A homogeneous representation of a polar coordinate.

Author
Daniel Beck

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
rthe radius
phithe 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).

Parameters
rthe radius
phi_zthe rotation around the z-axis
phi_ythe 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.

Parameters
ha 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

Desctructor.

Definition at line 78 of file hom_polar.cpp.

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().

HomPolar fawkes::HomPolar::operator+ ( const HomPolar p) const
virtual

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
panother 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().

HomPolar & fawkes::HomPolar::operator+= ( const HomPolar p)
virtual

Addition-assignment operator.

Parameters
pthe other polar position
Returns
reference of the result

Definition at line 305 of file hom_polar.cpp.

HomPolar fawkes::HomPolar::operator- ( const HomPolar p) const
virtual

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
panother 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().

HomPolar & fawkes::HomPolar::operator-= ( const HomPolar p)
virtual

Subtraction-assignment operator.

Parameters
pthe other polar position
Returns
reference of the result

Definition at line 275 of file hom_polar.cpp.

HomPolar & fawkes::HomPolar::operator= ( const HomPolar p)
virtual

Assignemnt operator.

Parameters
pthe other polar position
Returns
reference of the result

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.

Returns
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.

Parameters
phithe 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.

Parameters
phi_zthe rotation angle around the z-axis
phi_ythe 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.

Returns
the rotation angle around the y-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.

Parameters
phi_ythe 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.

Returns
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.

Parameters
phi_zthe 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.

Returns
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.

Parameters
rthe 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().

HomPolar & fawkes::HomPolar::rotate_x ( float  rad)
virtual

Convenience function to rotate the HomCoord around the x-axis.

Parameters
radthe roation angle in rad
Returns
reference to this

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().

HomPolar & fawkes::HomPolar::rotate_y ( float  rad)
virtual

Convenience function to rotate the HomCoord around the y-axis.

Parameters
radthe roation angle in rad
Returns
reference to this

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().

HomPolar & fawkes::HomPolar::rotate_z ( float  rad)
virtual

Convenience function to rotate the HomCoord around the z-axis.

Parameters
radthe roation angle in rad
Returns
reference to this

Reimplemented from fawkes::HomCoord.

Definition at line 244 of file hom_polar.cpp.

References fawkes::HomCoord::rotate_z().

Referenced by r().


The documentation for this class was generated from the following files: