56 constexpr
TPose2D(
double xx,
double yy,
double Phi) :
x(xx),
y(yy),
phi(Phi)
75 throw std::out_of_range(
"index out of range");
90 throw std::out_of_range(
"index out of range");
141 return (p1.
x == p2.
x) && (p1.
y == p2.
y) &&
148 return (p1.
x != p2.
x) || (p1.
y != p2.
y) ||
double norm() const
Returns the norm of the (x,y) vector (phi is not used)
T hypot_fast(const T x, const T y)
Faster version of std::hypot(), to use when overflow is not an issue and we prefer fast code...
void normalizePhi()
Forces "phi" to be in the range [-pi,pi].
mrpt::math::TPoint2D composePoint(const TPoint2D l) const
Base type of all TPoseXX and TPointXX classes in mrpt::math.
constexpr const double & operator[](size_t i) const
Coordinate access using operator[].
void fromString(const std::string &s)
Set the current object value from a string generated by 'asString' (eg: "[0.02 1.04 -45...
This base provides a set of functions for maths stuff.
void asVector(std::vector< double > &v) const
Transformation into vector.
mrpt::math::TPose2D operator+(const mrpt::math::TPose2D &b) const
Operator "oplus" pose composition: "ret=this \oplus b".
mrpt::math::TPoint2D inverseComposePoint(const TPoint2D g) const
constexpr TPose2D()=default
Default fast constructor.
T wrapTo2Pi(T a)
Modifies the given angle to translate it into the [0,2pi[ range.
#define MRPT_DECLARE_TTYPENAME_NO_NAMESPACE(_TYPE, __NS)
Declares a typename to be "type" (without the NS prefix)
GLsizei const GLchar ** string
T wrapToPi(T a)
Modifies the given angle to translate it into the ]-pi,pi] range.
static constexpr TPose2D Identity()
Returns the identity transformation.
Provided for STL and matrices/vectors compatibility.
constexpr TPose2D(double xx, double yy, double Phi)
Constructor from coordinates.
Lightweight 3D pose (three spatial coordinates, plus three angular coordinates).
std::string asString() const
mrpt::math::TPose2D operator-(const mrpt::math::TPose2D &b) const
Operator "ominus" pose composition: "ret=this \ominus b".
constexpr bool operator==(const TPoint2D &p1, const TPoint2D &p2)
Exact comparison between 2D points.
constexpr bool operator!=(const TPoint2D &p1, const TPoint2D &p2)
Exact comparison between 2D points.
double phi
Orientation (rads)
double & operator[](size_t i)
Coordinate access using operator[].