6 #ifndef DECOMP_ELLIPSOID_H 7 #define DECOMP_ELLIPSOID_H 11 #include <decomp_geometry/polyhedron.h> 20 return (C_.inverse() * (pt - d_)).norm();
31 for (
const auto &it : O) {
41 decimal_t min_dist = std::numeric_limits<decimal_t>::max();
42 for (
const auto &it : O) {
55 const auto n = C_.inverse() * C_.inverse().transpose() *
62 typename std::enable_if<U == 2, vec_Vecf<U>>::type
66 for(
decimal_t yaw = 0; yaw < M_PI*2; yaw+=dyaw) {
68 pt << cos(yaw), sin(yaw);
69 pts.push_back(C_ * pt + d_);
75 std::cout <<
"C: " << C_ << std::endl;
76 std::cout <<
"d: " << d_ << std::endl;
81 return C_.determinant();
vec_E< Vecf< N >> vec_Vecf
Vector of Eigen 1D float vector.
Definition: data_type.h:69
bool inside(const Vecf< Dim > &pt) const
Check if the point is inside, non-exclusive.
Definition: ellipsoid.h:24
decimal_t dist(const Vecf< Dim > &pt) const
Calculate distance to the center.
Definition: ellipsoid.h:19
Definition: ellipsoid.h:14
vec_Vecf< Dim > points_inside(const vec_Vecf< Dim > &O) const
Calculate points inside ellipsoid, non-exclusive.
Definition: ellipsoid.h:29
Hyperplane< Dim > closest_hyperplane(const vec_Vecf< Dim > &O) const
Find the closest hyperplane from the closest point.
Definition: ellipsoid.h:53
Vecf< Dim > closest_point(const vec_Vecf< Dim > &O) const
Find the closest point.
Definition: ellipsoid.h:39
Eigen::Matrix< decimal_t, M, N > Matf
MxN Eigen matrix.
Definition: data_type.h:63
double decimal_t
Rename the float type used in lib.
Definition: data_type.h:50
std::enable_if< U==2, vec_Vecf< U > >::type sample(int num) const
Sample n points along the contour.
Definition: ellipsoid.h:63
Defines all data types used in this lib.
Eigen::Matrix< decimal_t, N, 1 > Vecf
Eigen 1D float vector.
Definition: data_type.h:57
Hyperplane class.
Definition: polyhedron.h:13
Vecf< Dim > d() const
Get center.
Definition: ellipsoid.h:90
Matf< Dim, Dim > C() const
Get C matrix.
Definition: ellipsoid.h:85
decimal_t volume() const
Get ellipsoid volume.
Definition: ellipsoid.h:80