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:

List of all members.

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 HomPolarrotate_x (float rad)
 Convenience function to rotate the HomCoord around the x-axis.
virtual HomPolarrotate_y (float rad)
 Convenience function to rotate the HomCoord around the y-axis.
virtual HomPolarrotate_z (float rad)
 Convenience function to rotate the HomCoord around the z-axis.
virtual HomPolar operator- (const HomPolar &h) const
 Substraction operator.
virtual HomPolaroperator-= (const HomPolar &h)
 Subtraction-assignment operator.
virtual HomPolar operator+ (const HomPolar &h) const
 Addition operator.
virtual HomPolaroperator+= (const HomPolar &h)
 Addition-assignment operator.
virtual HomPolaroperator= (const HomPolar &h)
 Assignemnt operator.
HomVector get_vector () const
 Convert the polar coordinate to a cartesian coordinate.
- Public Member Functions inherited from fawkes::HomVector
 HomVector (float x=0, float y=0, float z=0)
 Constructor.
 HomVector (const HomCoord &h)
 Constructor.
virtual ~HomVector ()
 Destructor.
float length () const
 Calculates the length of the vector.
float length_square () const
 Calculates the squared length length of the vector (faster than length.
HomVectorset_length (float length)
 Scales the vector such that it has the given length.
HomVectorunit ()
 Brings the vector to unit-length.
float angle_xy (const HomVector &h) const
 Compute the angle between two vectors.
- Public Member Functions inherited from fawkes::HomCoord
 HomCoord (const HomCoord &c)
 Copy constructor.
virtual ~HomCoord ()
 Destructor.
virtual float x () const
 RO-getter for x.
virtual float & x ()
 RW-getter for x.
virtual HomCoordx (float x)
 Setter function for x.
virtual float y () const
 RO-getter for y.
virtual float & y ()
 RW-getter for y.
virtual HomCoordy (float y)
 Setter function for y.
virtual float z () const
 RO-getter for z.
virtual float & z ()
 RW-getter for z.
virtual HomCoordz (float z)
 Setter function for z.
virtual float w () const
 RO-getter for w.
virtual float & w ()
 RW-getter for w.
virtual HomCoordw (float w)
 Setter function for w.
HomCoordtransform (const HomTransform &t)
 Transform the vector with the given transform.
virtual HomCoord operator- (const HomCoord &h) const
 Subtraction operator.
virtual HomCoordoperator-= (const HomCoord &h)
 Substraction-assignment operator.
virtual HomCoord operator+ (const HomCoord &h) const
 Addition operator.
virtual HomCoordoperator+= (const HomCoord &h)
 Addition-assignment operator.
virtual float operator* (const HomCoord &h) const
 Calculates the dot product of two coords.
virtual HomCoord operator* (const float s) const
 Mulitplication operator.
virtual HomCoordoperator*= (const float s)
 Multiplication-assignment operator.
virtual HomCoordoperator= (const HomCoord &h)
 Assignment operator.
virtual bool operator== (const HomCoord &h) const
 Comparison operator.
virtual bool operator!= (const HomCoord &h) const
 Inequality operator.
- Public Member Functions inherited from fawkes::Printable
 Printable ()
 Constructor.
virtual ~Printable ()
 Destructor.

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 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(), rotate_y(), and 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.

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::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::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:
radthe roation angle in rad
Returns:
reference to this

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: