FleCSI User API Version: 2.3.0
 
Loading...
Searching...
No Matches

Spatial representation of a point based on dimensioned_array. More...

Typedefs

template<typename TYPE , Dimension DIMENSION>
using point = dimensioned_array< TYPE, DIMENSION, 1 >
 The point type defines an interface for storing and manipulating coordinate data.
 

Functions

template<template< typename... > class CONTAINER, typename TYPE , Dimension DIMENSION>
constexpr auto centroid (CONTAINER< point< TYPE, DIMENSION > > const &points)
 Return the centroid of the given set of points points.
 
template<typename TYPE , Dimension DIMENSION>
constexpr auto centroid (std::initializer_list< point< TYPE, DIMENSION > > points)
 Return the centroid of the given set of points points.
 
template<typename TYPE , Dimension DIMENSION>
constexpr TYPE distance (point< TYPE, DIMENSION > const &a, point< TYPE, DIMENSION > const &b)
 Return the distance between the given points a and b.
 
template<typename TYPE , Dimension DIMENSION>
constexpr point< TYPE, DIMENSION > midpoint (point< TYPE, DIMENSION > const &a, point< TYPE, DIMENSION > const &b)
 Return the midpoint between two points a and b.
 

Detailed Description

Spatial representation of a point based on dimensioned_array.

Typedef Documentation

◆ point

template<typename TYPE , Dimension DIMENSION>
using point = dimensioned_array<TYPE, DIMENSION, 1>

The point type defines an interface for storing and manipulating coordinate data.

The point type is implemented using dimensioned_array. Supports +, -, and *.

Template Parameters
TYPEThe type to use to represent coordinate values.
DIMENSIONThe dimension of the point.

Function Documentation

◆ distance()

template<typename TYPE , Dimension DIMENSION>
constexpr TYPE distance ( point< TYPE, DIMENSION > const &  a,
point< TYPE, DIMENSION > const &  b 
)
constexpr

Return the distance between the given points a and b.

Template Parameters
TYPEThe type to use to represent coordinate values.
DIMENSIONThe dimension of the point.

◆ midpoint()

template<typename TYPE , Dimension DIMENSION>
constexpr point< TYPE, DIMENSION > midpoint ( point< TYPE, DIMENSION > const &  a,
point< TYPE, DIMENSION > const &  b 
)
constexpr

Return the midpoint between two points a and b.

Template Parameters
TYPEThe type to use to represent coordinate values.
DIMENSIONThe dimension of the point.

◆ centroid() [1/2]

template<template< typename... > class CONTAINER, typename TYPE , Dimension DIMENSION>
constexpr auto centroid ( CONTAINER< point< TYPE, DIMENSION > > const &  points)
constexpr

Return the centroid of the given set of points points.

Template Parameters
TYPEThe type to use to represent coordinate values.
DIMENSIONThe dimension of the point.

◆ centroid() [2/2]

template<typename TYPE , Dimension DIMENSION>
constexpr auto centroid ( std::initializer_list< point< TYPE, DIMENSION > >  points)
constexpr

Return the centroid of the given set of points points.

Template Parameters
TYPEThe type to use to represent coordinate values.
DIMENSIONThe dimension of the point.