94 return *
this ==
point();
159 return static_cast<T
>(std::sqrt(_x * _x + _y * _y));
171 return static_cast<T
>(std::sqrt(
dx *
dx +
dy *
dy));
223 template <
typename ScalarT>
226 _x =
static_cast<T
>(_x *
scalar);
227 _y =
static_cast<T
>(_y *
scalar);
236 template <
typename ScalarT>
247 template <
typename ScalarT>
250 _x =
static_cast<T
>(_x /
scalar);
251 _y =
static_cast<T
>(_y /
scalar);
260 template <
typename ScalarT>
272 return std::string(
"(" + std::to_string(_x) +
", " + std::to_string(_y) +
")");
283 return stream <<
p.to_string();
Thread safe, blocking queue.
2D point specified by a pair of (x,y) coordinates.
constexpr T x() const noexcept
X coordinate getter.
void add_delta(T delta_x, T delta_y) noexcept
Increments point's coordinate of delta_x and delta_y values.
constexpr T distance_from_origin() const noexcept
Distance between the current point and the origin.
constexpr point(const point &)=default
Copy Constructor. Copy a tc::sdk::point instance into another one.
constexpr T y() const noexcept
Y coordinate getter.
constexpr point(point &&)=default
Move Constructor. Copy a tc::sdk::point instance into another one.
constexpr point operator/(ScalarT scalar) const
Divide a point by a given scalar value.
constexpr point()=default
Default Constructor. Creates a default tc::sdk::point instance.
void set_y(T y) noexcept
Y coordinate setter. Set the Y coordinate of the point.
constexpr point operator-(point other) const noexcept
Subtract two points.
constexpr std::string to_string() const
Get the point string representation.
constexpr bool operator==(const point &other) const noexcept
Equality operator.
void set_x(T x) noexcept
X coordinate setter. Set the X coordinate of the point.
point & operator-=(point other) noexcept
Subtract another point's coordinate to the current one.
constexpr point(T x, T y) noexcept
Constructor. Creates tc::sdk::point instance with given X and Y coordinates.
constexpr bool operator!=(const point &other) const noexcept
Inequality operator.
constexpr point operator*(ScalarT scalar) const noexcept
Multiply a point by a given scalar value.
point & operator+=(point other) noexcept
Add another point's coordinate to the current one.
point & operator=(const point &)=default
Assignment operator. Assign a tc::sdk::point instance to another one.
constexpr bool is_origin() const noexcept
Check if the point is the origin.
constexpr T distance(point other) const noexcept
Distance between the current point and another one.
point & operator/=(ScalarT scalar)
Divide current point's coordinate by a scalar value.
constexpr point operator+(point other) const noexcept
Add two points.
void sub_delta(T delta_x, T delta_y) noexcept
Decrements point's coordinate of delta_x and delta_y values.
point & operator=(point &&)=default
Move assignment operator. Assign a tc::sdk::point instance to another one.
point & operator*=(ScalarT scalar) noexcept
Multiply current point's coordinate by a scalar value.
friend std::ostream & operator<<(std::ostream &stream, const point &p)
Output stream operator.