70 throw std::out_of_range(
"index out of range");
83 throw std::out_of_range(
"index out of range");
129 return {
x +
p.
x,
y +
p.y};
134 return {
x -
p.
x,
y -
p.y};
168 return (p1.
x == p2.
x) && (p1.
y == p2.
y);
173 return (p1.
x != p2.
x) || (p1.
y != p2.
y);
TPoint2D & operator+=(const TPoint2D &p)
double & operator[](size_t i)
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]" ) ...
constexpr TPoint2D(const TPoint2D_data &d)
TPoint2D & operator*=(double d)
void asString(std::string &s) const
Returns a human-readable textual representation of the object (eg: "[0.02 1.04]" ) ...
constexpr const double & operator[](size_t i) const
Coordinate access using operator[].
Base type of all TPoseXX and TPointXX classes in mrpt::math.
constexpr TPoint2D operator/(double d) const
constexpr TPoint2D operator-(const TPoint2D &p) const
constexpr TPoint2D operator+(const TPoint2D &p) const
This base provides a set of functions for maths stuff.
constexpr TPoint2D(double xx, double yy)
Constructor from coordinates.
std::string asString() const
double sqrNorm() const
Squared norm: |v|^2 = x^2+y^2.
#define MRPT_DECLARE_TTYPENAME_NO_NAMESPACE(_TYPE, __NS)
Declares a typename to be "type" (without the NS prefix)
constexpr TPoint2D()
Default constructor.
GLsizei const GLchar ** string
double norm() const
Point norm: |v| = sqrt(x^2+y^2)
Provided for STL and matrices/vectors compatibility.
void asVector(std::vector< double > &v) const
Transformation into vector.
std::string format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
TPoint2D & operator-=(const TPoint2D &p)
constexpr bool operator==(const TPoint2D &p1, const TPoint2D &p2)
Exact comparison between 2D points.
constexpr TPoint2D operator*(double d) const
constexpr bool operator!=(const TPoint2D &p1, const TPoint2D &p2)
Exact comparison between 2D points.
bool operator<(const TPoint2D &p) const
TPoint2D & operator/=(double d)