39 template<
typename TYPE,
size_t DIMENSION>
51 template<
typename TYPE,
size_t DIMENSION>
55 for(
size_t d(0); d < DIMENSION; ++d) {
74 template<
typename TYPE,
size_t DIMENSION>
78 for(
size_t d(0); d < DIMENSION; ++d) {
79 sum += (
square)(a[d] - b[d]);
82 return std::sqrt(sum);
97 template<
typename TYPE,
size_t DIMENSION>
114 template<
template<
typename...>
class CONTAINER,
typename TYPE,
size_t DIMENSION>
119 for(
auto p : points) {
123 tmp /= points.
size();
139 template<
typename TYPE,
size_t DIMENSION>
144 for(
auto p : points) {
148 tmp /= points.
size();
T square(const T &a)
P.O.D.
Definition: common.hh:72
constexpr auto centroid(CONTAINER< point< TYPE, DIMENSION >> const &points)
Definition: point.hh:116
constexpr point< TYPE, DIMENSION > operator*(TYPE const val, point< TYPE, DIMENSION > const &p)
Definition: point.hh:52
Definition: dimensioned_array.hh:58
constexpr point< TYPE, DIMENSION > midpoint(point< TYPE, DIMENSION > const &a, point< TYPE, DIMENSION > const &b)
Definition: point.hh:99
TYPE distance(point< TYPE, DIMENSION > const &a, point< TYPE, DIMENSION > const &b)
Definition: point.hh:76
static constexpr size_t size()
Return the size of the array.
Definition: dimensioned_array.hh:101
Definition: control.hh:31