15 #include "../tools/MathToolbox.hpp" 16 #include "../tools/toolbox.hpp" 17 #include "../BasicDatatypes.hpp" 77 value_type
dist()
const;
88 value_type
angle()
const;
98 void toPolar(value_type& dist, value_type& angle)
const;
110 std::pair<value_type, value_type>
toPolar()
const;
140 void setX(value_type x) { m_x = x; }
143 void setY(value_type y) { m_y = y; }
147 void setXY(value_type x, value_type y) { m_x = x; m_y = y; }
159 void rotate(value_type angle);
163 void setPolar(value_type dist, value_type angle);
213 std::istream&
read (std::istream& is,
UINT32 version);
227 std::ostream&
write (std::ostream& os,
UINT32 version)
const;
263 m_x = r * std::cos(angle);
264 m_y = r * std::sin(angle);
365 const double divisor(
dist() * point.
dist());
368 return acos( (*
this * point) / divisor );
std::string toString(UINT16 digits=2) const
Text output for debugging.
friend const Point2D operator*(value_type, const Point2D &)
std::ostream & write(std::ostream &os, UINT32 version) const
Writes a Point2D to an output stream.
Point2D(value_type x, value_type y)
value_type getDist() const
void rotate(value_type angle)
static Point2D fromPolar(value_type dist, value_type angle)
Point2D & operator-=(const Point2D &point)
friend bool operator!=(const Point2D &, const Point2D &)
void setPolar(value_type dist, value_type angle)
Point2D rotated(value_type angle_rad) const
Point2D normalized() const
Point2D & operator+=(const Point2D &point)
void setXY(value_type x, value_type y)
Point2D & operator/=(value_type divisor)
value_type floatingpoint_type
The type of the stored x and y coordinates. An alias for value_type.
friend const Point2D operator-(const Point2D &, const Point2D &)
std::istream & read(std::istream &is, UINT32 version)
Reads a Point2D from an input stream.
value_type length() const
double value_type
The type of the stored x and y coordinates.
friend const Point2D operator+(const Point2D &, const Point2D &)
value_type getAngle() const
friend const Point2D operator/(const Point2D &, value_type)
virtual const UINT32 getUsedMemory() const
friend bool operator==(const Point2D &, const Point2D &)
value_type distSquare(const Point2D &point) const
std::ostream & operator<<(std::ostream &os, const EvalCaseResult &result)
std::pair< value_type, value_type > toPolar() const
Point2D & operator*=(value_type factor)