![]() |
Trax3 3.1.0
trax track library
|
Implements a 2D - position in cartesian coordinates. More...
#include <C:/Trend/Development/Trax3/Code/spat/Position2D.h>

Public Types | |
| typedef Valtype | value_type |
Public Member Functions | |||||||||||
| Position2D & | Init () noexcept | ||||||||||
| Initialisation to origin. | |||||||||||
| Position2D & | Transport (const Vector2D< Valtype > &v) noexcept | ||||||||||
| Moves the Position2D by v. | |||||||||||
| constexpr bool | Equals (const Position2D &p, Valtype epsilon=0) const noexcept | ||||||||||
| Comparison within some range. The area within two Position2Ds regarded as equal is a sphere with radius epsilon. | |||||||||||
Construction | |||||||||||
| |||||||||||
| constexpr | Position2D () noexcept=default | ||||||||||
| Does not initialize the members. | |||||||||||
| constexpr | Position2D (Valtype x, Valtype y) noexcept | ||||||||||
| Does not initialize the members. | |||||||||||
| Position2D (const Vector2D< Valtype > &)=delete | |||||||||||
| Conversions between Vector and Position2D shouldn't be necessary. | |||||||||||
| constexpr | Position2D (const Position< Valtype > &pos) noexcept | ||||||||||
| Does not initialize the members. | |||||||||||
| template<typename Valtype2> | |||||||||||
| Position2D (const Valtype2 *pVal) noexcept | |||||||||||
| Does not initialize the members. | |||||||||||
Assignment | |||||||||||
| Position2D & | operator= (const Position< Valtype > &p) noexcept | ||||||||||
Subscripting. | |||||||||||
| |||||||||||
| const Valtype & | operator[] (size_t index) const | ||||||||||
| Valtype & | operator[] (size_t index) | ||||||||||
Public Attributes | |
| Valtype | x |
| cartesian x coordinate | |
| Valtype | y |
| cartesian y coordinate | |
Implements a 2D - position in cartesian coordinates.
Specifies the coordinates of a point in 2D space. For Vectors, like e.g. distances, use the Vector type.
|
inlineconstexprnoexcept |
Comparison within some range. The area within two Position2Ds regarded as equal is a sphere with radius epsilon.
| p | Position2D to compare with. |
| epsilon | Distance <= wich two Position2Ds are regarded as equal. |