IDS peak ICV v1.5.0
Loading...
Searching...
No Matches
PointXd< T, dimension > Class Template Reference

#include <peak_common/types/geometry/peak_common_point.hpp>

Public Member Functions

constexpr PointXd ()=default
 Default constructor for PointXd.
 
constexpr PointXd (std::array< T, dimension > coordinates)
 Constructs a PointXd from an array of coordinates.
 
constexpr T GetX () const
 Returns the x-coordinate (first component).
 
constexpr T GetY () const
 Returns the y-coordinate (second component).
 
template<typename H , size_t d>
constexpr bool operator== (const PointXd< H, d > &rhs) const
 Equality operator for comparing integral coordinates.
 
template<typename H , size_t d>
constexpr bool operator!= (const PointXd< H, d > &rhs) const
 Inequality operator for comparing coordinates.
 
template<typename H , size_t d>
constexpr bool operator== (const PointXd< H, d > &rhs) const
 Equality operator for comparing floating-point coordinates.
 
constexpr std::array< T, dimension > GetCoordinates () const
 Returns the coordinates of the point as an array.
 

Detailed Description

template<typename T, size_t dimension>
class peak::common::detail::PointXd< T, dimension >

A point in space with configurable dimensionality and coordinate type.

Represents a mathematical point consisting of at least two coordinates (e.g., x and y). The number of dimensions and the data type of the coordinates are defined by the template parameters.

Template Parameters
TThe coordinate data type. Must be an arithmetic type.
dimensionThe number of dimensions. Must be 2 or greater.
Since
ids_peak_common 1.0

Constructor & Destructor Documentation

◆ PointXd() [1/2]

template<typename T , size_t dimension>
PointXd ( )
constexprdefault

Default constructor for PointXd.

Initializes the point with default-initialized coordinates.

Since
ids_peak_common 1.0

◆ PointXd() [2/2]

template<typename T , size_t dimension>
PointXd ( std::array< T, dimension > coordinates)
inlineexplicitconstexpr

Constructs a PointXd from an array of coordinates.

Parameters
coordinatesAn array containing the coordinates of the point.
Since
ids_peak_common 1.0

Member Function Documentation

◆ GetCoordinates()

template<typename T , size_t dimension>
std::array< T, dimension > GetCoordinates ( ) const
inlineconstexpr

Returns the coordinates of the point as an array.

Returns
A copy of the internal coordinate array.
Since
ids_peak_common 1.0

◆ GetX()

template<typename T , size_t dimension>
T GetX ( ) const
inlineconstexpr

Returns the x-coordinate (first component).

Returns
The value of the first coordinate.
Since
ids_peak_common 1.0

◆ GetY()

template<typename T , size_t dimension>
T GetY ( ) const
inlineconstexpr

Returns the y-coordinate (second component).

Returns
The value of the second coordinate.
Since
ids_peak_common 1.0

◆ operator!=()

template<typename T , size_t dimension>
template<typename H , size_t d>
bool operator!= ( const PointXd< H, d > & rhs) const
inlineconstexpr

Inequality operator for comparing coordinates.

Returns true if any coordinates of this point are not equal to the corresponding coordinates of the other point.

Template Parameters
HThe type of the other point's coordinates.
dThe dimensionality of the point.
Since
ids_peak_common 1.0

◆ operator==() [1/2]

template<typename T , size_t dimension>
template<typename H , size_t d>
bool operator== ( const PointXd< H, d > & rhs) const
inlineconstexpr

Equality operator for comparing integral coordinates.

Returns true if all coordinates of this point are exactly equal to the corresponding coordinates of the other point. This overload is used for integral coordinate types.

Template Parameters
HThe type of the other point's coordinates.
dThe dimensionality of the point.
Since
ids_peak_common 1.0

◆ operator==() [2/2]

template<typename T , size_t dimension>
template<typename H , size_t d>
bool operator== ( const PointXd< H, d > & rhs) const
inlineconstexpr

Equality operator for comparing floating-point coordinates.

Returns true if all coordinates of this point are approximately equal to the corresponding coordinates of the other point. Comparison is performed using a tolerance based on units in the last place (ULP), allowing for small floating-point inaccuracies.

Template Parameters
HThe type of the other point's coordinates.
dThe dimensionality of the point.
Since
ids_peak_common 1.0