Tatooine
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
tatooine::geometry::hyper_ellipse< Real, NumDimensions > Struct Template Reference

#include <hyper_ellipse.h>

Inheritance diagram for tatooine::geometry::hyper_ellipse< Real, NumDimensions >:
[legend]
Collaboration diagram for tatooine::geometry::hyper_ellipse< Real, NumDimensions >:
[legend]

Public Types

using this_type = hyper_ellipse< Real, NumDimensions >
 
using vec_type = vec< Real, NumDimensions >
 
using pos_type = vec_type
 
using mat_type = mat< Real, NumDimensions, NumDimensions >
 
using real_type = Real
 

Public Member Functions

constexpr hyper_ellipse ()
 defaults to unit hypersphere More...
 
constexpr hyper_ellipse (hyper_ellipse const &)=default
 
constexpr hyper_ellipse (hyper_ellipse &&) noexcept=default
 
constexpr auto operator= (hyper_ellipse const &) -> hyper_ellipse &=default
 
constexpr auto operator= (hyper_ellipse &&) noexcept -> hyper_ellipse &=default
 
 ~hyper_ellipse ()=default
 
constexpr hyper_ellipse (Real const radius)
 Sets up a sphere with specified radius. More...
 
constexpr hyper_ellipse (Real const radius, vec_type const &center)
 Sets up a sphere with specified radius and origin point. More...
 
constexpr hyper_ellipse (vec_type const &center, Real const radius)
 Sets up a sphere with specified radius and origin point. More...
 
constexpr hyper_ellipse (fixed_size_vec< NumDimensions > auto const &center, fixed_size_quadratic_mat< NumDimensions > auto const &S)
 Sets up a sphere with specified radius and origin point. More...
 
constexpr hyper_ellipse (vec_type const &center, arithmetic auto const ... radii)
 Sets up a sphere with specified radii. More...
 
constexpr hyper_ellipse (arithmetic auto const ... radii)
 Sets up a sphere with specified radii. More...
 
constexpr hyper_ellipse (fixed_size_vec< NumDimensions > auto const &...points)
 Fits an ellipse through specified points. More...
 
constexpr hyper_ellipse (fixed_size_quadratic_mat< NumDimensions > auto const &H)
 Fits an ellipse through specified points. More...
 
auto S () const -> auto const &
 
auto S () -> auto &
 
auto center () const -> auto const &
 
auto center () -> auto &
 
auto center (std::size_t const i) const
 
auto center (std::size_t const i) -> auto &
 
auto local_coordinate (pos_type const &x) const
 
auto squared_euclidean_distance_to_center (pos_type const &x) const
 
auto euclidean_distance_to_center (pos_type const &x) const
 
auto squared_local_euclidean_distance_to_center (pos_type const &x) const
 
auto local_distance_to_center (pos_type const &x) const
 
constexpr auto distance_to_boundary (pos_type const &x) const
 Computes euclidean distance to nearest boundary point. More...
 
auto local_nearest_point_boundary (pos_type const &x) const
 
auto nearest_point_boundary (pos_type const &x) const
 
constexpr auto fit (fixed_size_vec< NumDimensions > auto const &...points)
 Fits an ellipse through specified points. More...
 
constexpr auto fit (fixed_size_quadratic_mat< NumDimensions > auto const &H)
 
template<typename V , typename VReal >
constexpr auto nearest_point_on_boundary (base_tensor< V, VReal, NumDimensions > const &x) const
 
constexpr auto is_inside (pos_type const &x) const
 
auto discretize (std::size_t const num_vertices=32) const
 
auto discretize (std::size_t const num_subdivisions=2) const
 
auto main_axes () const
 
auto radii () const
 Returns a the radii of the hyper ellipse as a vector. More...
 
auto base_coordinate_system () const
 Returns a the radii of the hyper ellipse as a vector. More...
 

Static Public Member Functions

static auto constexpr num_dimensions ()
 

Private Member Functions

template<std::size_t... Is>
constexpr auto fit (std::index_sequence< Is... >, fixed_size_vec< NumDimensions > auto const &...points)
 Fits an ellipse through specified points. More...
 

Private Attributes

vec_type m_center = vec_type::zeros()
 
mat_type m_S = mat_type::eye()
 

Member Typedef Documentation

◆ mat_type

template<floating_point Real, std::size_t NumDimensions>
using tatooine::geometry::hyper_ellipse< Real, NumDimensions >::mat_type = mat<Real, NumDimensions, NumDimensions>

◆ pos_type

template<floating_point Real, std::size_t NumDimensions>
using tatooine::geometry::hyper_ellipse< Real, NumDimensions >::pos_type = vec_type

◆ real_type

template<floating_point Real, std::size_t NumDimensions>
using tatooine::geometry::hyper_ellipse< Real, NumDimensions >::real_type = Real

◆ this_type

template<floating_point Real, std::size_t NumDimensions>
using tatooine::geometry::hyper_ellipse< Real, NumDimensions >::this_type = hyper_ellipse<Real, NumDimensions>

◆ vec_type

template<floating_point Real, std::size_t NumDimensions>
using tatooine::geometry::hyper_ellipse< Real, NumDimensions >::vec_type = vec<Real, NumDimensions>

Constructor & Destructor Documentation

◆ hyper_ellipse() [1/11]

template<floating_point Real, std::size_t NumDimensions>
constexpr tatooine::geometry::hyper_ellipse< Real, NumDimensions >::hyper_ellipse ( )
inlineconstexpr

defaults to unit hypersphere

◆ hyper_ellipse() [2/11]

template<floating_point Real, std::size_t NumDimensions>
constexpr tatooine::geometry::hyper_ellipse< Real, NumDimensions >::hyper_ellipse ( hyper_ellipse< Real, NumDimensions > const &  )
constexprdefault

◆ hyper_ellipse() [3/11]

template<floating_point Real, std::size_t NumDimensions>
constexpr tatooine::geometry::hyper_ellipse< Real, NumDimensions >::hyper_ellipse ( hyper_ellipse< Real, NumDimensions > &&  )
constexprdefaultnoexcept

◆ ~hyper_ellipse()

template<floating_point Real, std::size_t NumDimensions>
tatooine::geometry::hyper_ellipse< Real, NumDimensions >::~hyper_ellipse ( )
default

◆ hyper_ellipse() [4/11]

template<floating_point Real, std::size_t NumDimensions>
constexpr tatooine::geometry::hyper_ellipse< Real, NumDimensions >::hyper_ellipse ( Real const  radius)
inlineconstexpr

Sets up a sphere with specified radius.

◆ hyper_ellipse() [5/11]

template<floating_point Real, std::size_t NumDimensions>
constexpr tatooine::geometry::hyper_ellipse< Real, NumDimensions >::hyper_ellipse ( Real const  radius,
vec_type const &  center 
)
inlineconstexpr

Sets up a sphere with specified radius and origin point.

◆ hyper_ellipse() [6/11]

template<floating_point Real, std::size_t NumDimensions>
constexpr tatooine::geometry::hyper_ellipse< Real, NumDimensions >::hyper_ellipse ( vec_type const &  center,
Real const  radius 
)
inlineconstexpr

Sets up a sphere with specified radius and origin point.

◆ hyper_ellipse() [7/11]

template<floating_point Real, std::size_t NumDimensions>
constexpr tatooine::geometry::hyper_ellipse< Real, NumDimensions >::hyper_ellipse ( fixed_size_vec< NumDimensions > auto const &  center,
fixed_size_quadratic_mat< NumDimensions > auto const &  S 
)
inlineconstexpr

Sets up a sphere with specified radius and origin point.

◆ hyper_ellipse() [8/11]

template<floating_point Real, std::size_t NumDimensions>
constexpr tatooine::geometry::hyper_ellipse< Real, NumDimensions >::hyper_ellipse ( vec_type const &  center,
arithmetic auto const ...  radii 
)
inlineconstexpr

Sets up a sphere with specified radii.

◆ hyper_ellipse() [9/11]

template<floating_point Real, std::size_t NumDimensions>
constexpr tatooine::geometry::hyper_ellipse< Real, NumDimensions >::hyper_ellipse ( arithmetic auto const ...  radii)
inlineconstexpr

Sets up a sphere with specified radii.

◆ hyper_ellipse() [10/11]

template<floating_point Real, std::size_t NumDimensions>
constexpr tatooine::geometry::hyper_ellipse< Real, NumDimensions >::hyper_ellipse ( fixed_size_vec< NumDimensions > auto const &...  points)
inlineconstexpr

Fits an ellipse through specified points.

◆ hyper_ellipse() [11/11]

template<floating_point Real, std::size_t NumDimensions>
constexpr tatooine::geometry::hyper_ellipse< Real, NumDimensions >::hyper_ellipse ( fixed_size_quadratic_mat< NumDimensions > auto const &  H)
inlineconstexpr

Fits an ellipse through specified points.

Member Function Documentation

◆ base_coordinate_system()

template<floating_point Real, std::size_t NumDimensions>
auto tatooine::geometry::hyper_ellipse< Real, NumDimensions >::base_coordinate_system ( ) const
inline

Returns a the radii of the hyper ellipse as a vector.

◆ center() [1/4]

template<floating_point Real, std::size_t NumDimensions>
auto tatooine::geometry::hyper_ellipse< Real, NumDimensions >::center ( ) -> auto &
inline

◆ center() [2/4]

template<floating_point Real, std::size_t NumDimensions>
auto tatooine::geometry::hyper_ellipse< Real, NumDimensions >::center ( ) const -> auto const &
inline

◆ center() [3/4]

template<floating_point Real, std::size_t NumDimensions>
auto tatooine::geometry::hyper_ellipse< Real, NumDimensions >::center ( std::size_t const  i) -> auto &
inline

◆ center() [4/4]

template<floating_point Real, std::size_t NumDimensions>
auto tatooine::geometry::hyper_ellipse< Real, NumDimensions >::center ( std::size_t const  i) const
inline

◆ discretize() [1/2]

template<floating_point Real, std::size_t NumDimensions>
auto tatooine::geometry::hyper_ellipse< Real, NumDimensions >::discretize ( std::size_t const  num_subdivisions = 2) const
inline

◆ discretize() [2/2]

template<floating_point Real, std::size_t NumDimensions>
auto tatooine::geometry::hyper_ellipse< Real, NumDimensions >::discretize ( std::size_t const  num_vertices = 32) const
inline

◆ distance_to_boundary()

template<floating_point Real, std::size_t NumDimensions>
constexpr auto tatooine::geometry::hyper_ellipse< Real, NumDimensions >::distance_to_boundary ( pos_type const &  x) const
inlineconstexpr

Computes euclidean distance to nearest boundary point.

◆ euclidean_distance_to_center()

template<floating_point Real, std::size_t NumDimensions>
auto tatooine::geometry::hyper_ellipse< Real, NumDimensions >::euclidean_distance_to_center ( pos_type const &  x) const
inline

◆ fit() [1/3]

template<floating_point Real, std::size_t NumDimensions>
constexpr auto tatooine::geometry::hyper_ellipse< Real, NumDimensions >::fit ( fixed_size_quadratic_mat< NumDimensions > auto const &  H)
inlineconstexpr

Fits an ellipse through columns of H

Returns
main axes

◆ fit() [2/3]

template<floating_point Real, std::size_t NumDimensions>
constexpr auto tatooine::geometry::hyper_ellipse< Real, NumDimensions >::fit ( fixed_size_vec< NumDimensions > auto const &...  points)
inlineconstexpr

Fits an ellipse through specified points.

◆ fit() [3/3]

template<floating_point Real, std::size_t NumDimensions>
template<std::size_t... Is>
constexpr auto tatooine::geometry::hyper_ellipse< Real, NumDimensions >::fit ( std::index_sequence< Is... >  ,
fixed_size_vec< NumDimensions > auto const &...  points 
)
inlineconstexprprivate

Fits an ellipse through specified points.

◆ is_inside()

template<floating_point Real, std::size_t NumDimensions>
constexpr auto tatooine::geometry::hyper_ellipse< Real, NumDimensions >::is_inside ( pos_type const &  x) const
inlineconstexpr

Checks if a point x is inside the ellipse.

Parameters
xpoint to check
Returns
true if x is inside ellipse.

◆ local_coordinate()

template<floating_point Real, std::size_t NumDimensions>
auto tatooine::geometry::hyper_ellipse< Real, NumDimensions >::local_coordinate ( pos_type const &  x) const
inline

◆ local_distance_to_center()

template<floating_point Real, std::size_t NumDimensions>
auto tatooine::geometry::hyper_ellipse< Real, NumDimensions >::local_distance_to_center ( pos_type const &  x) const
inline

◆ local_nearest_point_boundary()

template<floating_point Real, std::size_t NumDimensions>
auto tatooine::geometry::hyper_ellipse< Real, NumDimensions >::local_nearest_point_boundary ( pos_type const &  x) const
inline

◆ main_axes()

template<floating_point Real, std::size_t NumDimensions>
auto tatooine::geometry::hyper_ellipse< Real, NumDimensions >::main_axes ( ) const
inline

Returns a the main axes of the hyper ellipse as a matrix and the lengths of the axes as a vector.

◆ nearest_point_boundary()

template<floating_point Real, std::size_t NumDimensions>
auto tatooine::geometry::hyper_ellipse< Real, NumDimensions >::nearest_point_boundary ( pos_type const &  x) const
inline

◆ nearest_point_on_boundary()

template<floating_point Real, std::size_t NumDimensions>
template<typename V , typename VReal >
constexpr auto tatooine::geometry::hyper_ellipse< Real, NumDimensions >::nearest_point_on_boundary ( base_tensor< V, VReal, NumDimensions > const &  x) const
inlineconstexpr

Computes the main axes of the ellipse.

Returns
main axes

◆ num_dimensions()

template<floating_point Real, std::size_t NumDimensions>
static auto constexpr tatooine::geometry::hyper_ellipse< Real, NumDimensions >::num_dimensions ( )
inlinestaticconstexpr

◆ operator=() [1/2]

template<floating_point Real, std::size_t NumDimensions>
constexpr auto tatooine::geometry::hyper_ellipse< Real, NumDimensions >::operator= ( hyper_ellipse< Real, NumDimensions > &&  ) -> hyper_ellipse &=default
constexprdefaultnoexcept

◆ operator=() [2/2]

template<floating_point Real, std::size_t NumDimensions>
constexpr auto tatooine::geometry::hyper_ellipse< Real, NumDimensions >::operator= ( hyper_ellipse< Real, NumDimensions > const &  ) -> hyper_ellipse &=default
constexprdefault

◆ radii()

template<floating_point Real, std::size_t NumDimensions>
auto tatooine::geometry::hyper_ellipse< Real, NumDimensions >::radii ( ) const
inline

Returns a the radii of the hyper ellipse as a vector.

◆ S() [1/2]

template<floating_point Real, std::size_t NumDimensions>
auto tatooine::geometry::hyper_ellipse< Real, NumDimensions >::S ( ) -> auto &
inline

◆ S() [2/2]

template<floating_point Real, std::size_t NumDimensions>
auto tatooine::geometry::hyper_ellipse< Real, NumDimensions >::S ( ) const -> auto const &
inline

◆ squared_euclidean_distance_to_center()

template<floating_point Real, std::size_t NumDimensions>
auto tatooine::geometry::hyper_ellipse< Real, NumDimensions >::squared_euclidean_distance_to_center ( pos_type const &  x) const
inline

◆ squared_local_euclidean_distance_to_center()

template<floating_point Real, std::size_t NumDimensions>
auto tatooine::geometry::hyper_ellipse< Real, NumDimensions >::squared_local_euclidean_distance_to_center ( pos_type const &  x) const
inline

Member Data Documentation

◆ m_center

template<floating_point Real, std::size_t NumDimensions>
vec_type tatooine::geometry::hyper_ellipse< Real, NumDimensions >::m_center = vec_type::zeros()
private

◆ m_S

template<floating_point Real, std::size_t NumDimensions>
mat_type tatooine::geometry::hyper_ellipse< Real, NumDimensions >::m_S = mat_type::eye()
private

The documentation for this struct was generated from the following file: