1.8 |
Simple x,y coordinate. More...
Public Types | |
using | DimType = Dim |
Helper to reference the dimension type. More... | |
Public Member Functions | |
constexpr | PointType () noexcept=default |
template<class Dim2 > | |
constexpr | PointType (const PointType< Dim2 > &p) |
constexpr | PointType (Dim x, Dim y) noexcept |
template<class T > | |
EGT_NODISCARD T | angle_to (const PointType &point) const noexcept |
Return the angle in radians from this point to get to another. More... | |
EGT_NODISCARD Dim | distance_to (const PointType &point) const noexcept |
Calculate the straight line distance to another point. More... | |
constexpr PointType & | operator*= (const PointType &rhs) noexcept |
PointType operator. More... | |
template<class T > | |
constexpr PointType & | operator*= (const T &rhs) noexcept |
PointType operator. More... | |
constexpr PointType & | operator+= (const PointType &rhs) noexcept |
PointType operator. More... | |
template<class T > | |
constexpr PointType & | operator+= (const T &rhs) noexcept |
PointType operator. More... | |
constexpr PointType & | operator-= (const PointType &rhs) noexcept |
PointType operator. More... | |
template<class T > | |
constexpr PointType & | operator-= (const T &rhs) noexcept |
PointType operator. More... | |
constexpr PointType & | operator/= (const PointType &rhs) noexcept |
PointType operator. More... | |
template<class T > | |
constexpr PointType & | operator/= (const T &rhs) noexcept |
PointType operator. More... | |
template<class T > | |
PointType | point_on_circumference (T radius, T angle) const noexcept |
If this point is the center of a circle, return a new point that is on the circumference of the circle at the specified angle. More... | |
constexpr EGT_NODISCARD Dim | x () const noexcept |
Get the x value. More... | |
constexpr void | x (Dim x) noexcept |
Set the x value. More... | |
constexpr EGT_NODISCARD Dim | y () const noexcept |
Get the y value. More... | |
constexpr void | y (Dim y) noexcept |
Set the y value. More... | |
Protected Attributes | |
Dim | m_x {0} |
X value. More... | |
Dim | m_y {0} |
Y value. More... | |
Simple x,y coordinate.
Typically Point, PointF, DisplayPoint are used as aliases.
using DimType = Dim |
Helper to reference the dimension type.
|
constexprdefaultnoexcept |
|
inlineconstexprnoexcept |
[in] | x | X value. |
[in] | y | Y value. |
|
inlinenoexcept |
Return the angle in radians from this point to get to another.
point | The other point. |
|
inlinenoexcept |
Calculate the straight line distance to another point.
point | The other point. |
PointType operator.
PointType operator.
PointType operator.
PointType operator.
|
inlinenoexcept |
If this point is the center of a circle, return a new point that is on the circumference of the circle at the specified angle.
radius | The radius of the circle. |
angle | The angle in radians. |
|
inlineconstexprnoexcept |
Get the x value.
|
inlineconstexprnoexcept |
Set the x value.
|
inlineconstexprnoexcept |
Get the y value.
|
inlineconstexprnoexcept |
Set the y value.
|
protected |
X value.
|
protected |
Y value.