33 template <
typename NumT>
37 "Template argument must be an arithmetic type");
61 : x(_x), y(std::forward<NumT>(_y))
67 : x(std::forward<NumT>(_x)), y(_y)
73 : x(std::forward<NumT>(_x)), y(std::forward<NumT>(_y))
162 return dx * dx + dy * dy;
172 return x * x + y *
y;
210 if (p.get_x() != q.get_x())
211 return ((p.get_x() <= this->
get_x()) and (this->
get_x() <= q.get_x()))
212 or ((p.get_x() >= this->
get_x()) and (this->
get_x() >= q.get_x()));
214 return ((p.get_y() <= this->
get_y()) and (this->
get_y() <= q.get_y()))
215 or ((p.get_y() >= this->
get_y()) and (this->
get_y() >= q.get_y()));
218 explicit operator bool()
const 230 return not (*
this == p);
236 s <<
'(' << x <<
',' << y <<
')';
255 # endif // DSGPOINT_H GenPoint2D(const NumT &_x, const NumT &_y)
Definition: point2D.H:54
GenPoint2D(NumT &&_x, NumT &&_y)
Definition: point2D.H:72
lint_t ComponentType
Definition: point2D.H:44
bool is_null() const
Definition: point2D.H:148
lint_t ValueType
Definition: point2D.H:46
NumT distance_to_origin() const
Definition: point2D.H:175
bool operator==(const GenPoint2D &p) const
Definition: point2D.H:223
double real_t
Definition: types.H:51
bool num_equal(T, T)
Definition: math.H:99
GenPoint2D(const GenPoint2D &p)
Definition: point2D.H:78
void set_x(const NumT &_x)
Definition: point2D.H:123
bool is_zero() const
Definition: point2D.H:153
void set_y(NumT &&_y)
Definition: point2D.H:138
lint_t NumberType
Definition: point2D.H:45
NumT x
Definition: point2D.H:37
NumT square_distance_with(const GenPoint2D &p) const
Definition: point2D.H:158
bool operator!=(const GenPoint2D &p) const
Definition: point2D.H:228
GenPoint2D(const NumT &_x, NumT &&_y)
Definition: point2D.H:60
NumT y
Definition: point2D.H:41
void nullify()
Definition: point2D.H:143
bool is_between(const GenPoint2D &p, const GenPoint2D &q) const
Definition: point2D.H:205
GenPoint2D()
Definition: point2D.H:48
real_t distance_with(const GenPoint2D &p) const
Definition: point2D.H:165
bool is_collinear_with(const GenPoint2D &p, const GenPoint2D &q) const
Definition: point2D.H:200
void set_x(NumT &&_x)
Definition: point2D.H:128
bool is_to_left_on_from(const GenPoint2D &p, const GenPoint2D &q) const
Definition: point2D.H:195
const NumT & get_x() const
Definition: point2D.H:113
bool is_to_right_from(const GenPoint2D &p, const GenPoint2D &q) const
Definition: point2D.H:180
bool is_to_left_from(const GenPoint2D &p, const GenPoint2D &q) const
Definition: point2D.H:190
Definition: point2D.H:241
GenPoint2D(GenPoint2D &&p)
Definition: point2D.H:84
Definition: point2D.H:247
GenPoint2D & operator=(const GenPoint2D &p)
Definition: point2D.H:90
NumT square_distance_to_origin() const
Definition: point2D.H:170
std::string to_string() const
Definition: point2D.H:233
Value & value(MapKey< Key, Value > &item)
Definition: map.H:77
bool is_to_right_on_from(const GenPoint2D &p, const GenPoint2D &q) const
Definition: point2D.H:185
void set_y(const NumT &_y)
Definition: point2D.H:133
const NumT & get_y() const
Definition: point2D.H:118
GenPoint2D(NumT &&_x, const NumT &_y)
Definition: point2D.H:66
void swap(GenPoint2D &p)
Definition: point2D.H:107
real_t area_of_parallelogram(const GenPoint2D< NumberType > &, const GenPoint2D< NumberType > &, const GenPoint2D< NumberType > &)
Definition: math.H:129