47 template <
typename T >
56 template < index_t DIMENSION >
67 for(
auto i :
range( DIMENSION ) )
69 min_[i] = std::min( min_[i], p[i] );
70 max_[i] = std::max( max_[i], p[i] );
75 template < index_t DIMENSION >
80 for(
auto c :
range( DIMENSION ) )
85 result += sqr( p[c] - min()[c] );
87 else if( p[c] > max()[c] )
90 result += sqr( p[c] - max()[c] );
95 result = sqr( p[0] - min()[0] );
96 result = std::min( result, sqr( p[0] - max()[0] ) );
97 for(
auto c :
range( 1, DIMENSION ) )
99 result = std::min( result, sqr( p[c] - min()[c] ) );
100 result = std::min( result, sqr( p[c] - max()[c] ) );
107 template < index_t DIMENSION >
111 double result{ 0.0 };
112 for(
auto c :
range( DIMENSION ) )
114 double d = p[c] - 0.5 * ( min()[c] + max()[c] );
GEO::vecng< DIMENSION, double > vecn
void add_point(const vecn< DIMENSION > &p)
Classes to build GeoModel from various inputs.
double distance_to_center(const vecn< DIMENSION > &p) const
double signed_distance(const vecn< DIMENSION > &p) const