2D point specified by a pair of (x,y) coordinates. More...
#include <point.hpp>
Public Member Functions | |
constexpr | point ()=default |
Default Constructor. Creates a default tc::sdk::point instance. | |
constexpr | point (const point &)=default |
Copy Constructor. Copy a tc::sdk::point instance into another one. | |
constexpr | point (point &&)=default |
Move Constructor. Copy a tc::sdk::point instance into another one. | |
constexpr | point (T x, T y) noexcept |
Constructor. Creates tc::sdk::point instance with given X and Y coordinates. | |
point & | operator= (const point &)=default |
Assignment operator. Assign a tc::sdk::point instance to another one. | |
point & | operator= (point &&)=default |
Move assignment operator. Assign a tc::sdk::point instance to another one. | |
constexpr bool | operator== (const point &other) const noexcept |
Equality operator. | |
constexpr bool | operator!= (const point &other) const noexcept |
Inequality operator. | |
constexpr bool | is_origin () const noexcept |
Check if the point is the origin. | |
constexpr T | x () const noexcept |
X coordinate getter. | |
constexpr T | y () const noexcept |
Y coordinate getter. | |
void | set_x (T x) noexcept |
X coordinate setter. Set the X coordinate of the point. | |
void | set_y (T y) noexcept |
Y coordinate setter. Set the Y coordinate of the point. | |
void | add_delta (T delta_x, T delta_y) noexcept |
Increments point's coordinate of delta_x and delta_y values. | |
void | sub_delta (T delta_x, T delta_y) noexcept |
Decrements 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 T | distance (point other) const noexcept |
Distance between the current point and another one. | |
constexpr point | operator+ (point other) const noexcept |
Add two points. | |
point & | operator+= (point other) noexcept |
Add another point's coordinate to the current one. | |
constexpr point | operator- (point other) const noexcept |
Subtract two points. | |
point & | operator-= (point other) noexcept |
Subtract another point's coordinate to the current one. | |
template<typename ScalarT > | |
point & | operator*= (ScalarT scalar) noexcept |
Multiply current point's coordinate by a scalar value. | |
template<typename ScalarT > | |
constexpr point | operator* (ScalarT scalar) const noexcept |
Multiply a point by a given scalar value. | |
template<typename ScalarT > | |
point & | operator/= (ScalarT scalar) |
Divide current point's coordinate by a scalar value. | |
template<typename ScalarT > | |
constexpr point | operator/ (ScalarT scalar) const |
Divide a point by a given scalar value. | |
constexpr std::string | to_string () const |
Get the point string representation. | |
Friends | |
std::ostream & | operator<< (std::ostream &stream, const point &p) |
Output stream operator. | |
2D point specified by a pair of (x,y) coordinates.
T | Coordinates type |
|
inlineexplicitconstexprnoexcept |
Constructor. Creates tc::sdk::point instance with given X and Y coordinates.
x | the X coordinate of the point |
y | the Y coordinate of the point |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlinenoexcept |
|
inlineconstexprnoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlineconstexprnoexcept |
|
inline |
|
inlineconstexpr |
|
inlineconstexpr |