29#ifndef NOMLIB_MATH_POINT2_HEADERS
30#define NOMLIB_MATH_POINT2_HEADERS
34#include "nomlib/config.hpp"
39const std::string POINT_DELIMITER =
", ";
74 x { static_cast<T> ( copy.
x ) },
75 y { static_cast<T> ( copy.
y ) }
109inline std::ostream& operator << ( std::ostream& os,
const Point2<T>& pos )
128inline bool operator == (
const Point2<T>& lhs,
const Point2<T>& rhs )
130 return ( lhs.x == rhs.x ) && ( lhs.y == rhs.y );
140 return ( lhs.x < rhs.x ) && ( lhs.y < rhs.y );
150 return ( rhs.x < lhs.x ) && ( rhs.y < lhs.y );
160 return ( lhs.x <= rhs.x ) && ( lhs.y <= rhs.y );
170 return ( rhs.x <= lhs.x ) && ( rhs.y <= lhs.y );
184 return ! ( lhs == rhs );
210 return Point2<T>(lhs + rhs.x, lhs + rhs.y);
222 return Point2<T>(lhs.x + rhs, lhs.y + rhs);
274 return Point2<T>(lhs - rhs.x, lhs - rhs.y);
286 return Point2<T>(lhs.x - rhs, lhs.y - rhs);
325 return Point2<T>(lhs * rhs.x, lhs * rhs.y);
337 return Point2<T>(lhs.x * rhs, lhs.y * rhs);
367 return Point2<T>(lhs / rhs.x, lhs / rhs.y);
381 return Point2<T>(lhs.x / rhs, lhs.y / rhs);
Point2(const Point2< U > ©)
Copy constructor.
Point2(void)
Default constructor; initialize values to Point2<T>::null.
Point2(T x, T y)
Constructor variant for initializing x, y at construction.
const Point2< T > & get(void) const
Obtain a reference of the object.