24 #include <geometry/hom_polar.h> 25 #include <geometry/hom_transform.h> 72 m_r = sqrt(
x() *
x() +
y() *
y() +
z() *
z() );
73 m_phi_z = atan2f(
y(),
x());;
74 m_phi_y = atan2f(
z(), sqrt(
x() *
x() +
y() *
y() ) );
97 if (
x() == 0.0 &&
y() == 0.0 &&
z() == 0.0 )
123 float phi_y = m_phi_y;
154 float phi_y = m_phi_y;
185 float phi_z = m_phi_z;
226 m_phi_z = atan2f(
y(),
x());
227 m_phi_y = atan2f(
z(), sqrt(
x() *
x() +
y() *
y() ) );
237 m_phi_z = atan2f(
y(),
x());
238 m_phi_y = atan2f(
z(), sqrt(
x() *
x() +
y() *
y() ) );
264 ret.m_phi_z = atan2f(ret.
y(), ret.
x());
265 ret.m_phi_y = atan2f(ret.
z(), sqrt( ret.
x() * ret.
x() + ret.
y() * ret.
y() ) );
294 ret.m_phi_z = atan2f(ret.
y(), ret.
x());
295 ret.m_phi_y = atan2f(ret.
z(), sqrt( ret.
x() * ret.
x() + ret.
y() * ret.
y() ) );
HomVector get_vector() const
Convert the polar coordinate to a cartesian coordinate.
float phi_z() const
Get the rotation angle around the z-axis.
virtual float y() const
RO-getter for y.
virtual HomCoord & rotate_x(float rad)
Convenience function to rotate the HomCoord around the x-axis.
virtual HomCoord & operator=(const HomCoord &h)
Assignment operator.
A homogeneous representation of a polar coordinate.
Fawkes library namespace.
virtual ~HomPolar()
Desctructor.
float r() const
Obtain the radius.
HomVector & set_length(float length)
Scales the vector such that it has the given length.
float phi_y() const
Obtain the rotation angle around the y-axis after rotating around the z-axis.
virtual HomPolar operator+(const HomPolar &h) const
Addition operator.
virtual HomPolar & rotate_x(float rad)
Convenience function to rotate the HomCoord around the x-axis.
virtual HomPolar & rotate_z(float rad)
Convenience function to rotate the HomCoord around the z-axis.
float phi() const
Get the rotation angle around the z-axis.
virtual HomCoord & rotate_y(float rad)
Convenience function to rotate the HomCoord around the y-axis.
virtual HomPolar & operator=(const HomPolar &h)
Assignemnt operator.
virtual float z() const
RO-getter for z.
Base class for homogeneous primitives (vector and point).
virtual HomPolar & operator-=(const HomPolar &h)
Subtraction-assignment operator.
virtual HomCoord & rotate_z(float rad)
Convenience function to rotate the HomCoord around the z-axis.
virtual HomPolar & rotate_y(float rad)
Convenience function to rotate the HomCoord around the y-axis.
virtual float x() const
RO-getter for x.
HomPolar(float r=0.0, float phi=0.0)
Constructor (two-dimensional).
virtual HomPolar & operator+=(const HomPolar &h)
Addition-assignment operator.
virtual HomPolar operator-(const HomPolar &h) const
Substraction operator.