|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Smallest circle enclosing a point set (Welzl's algorithm). More...
#include <geom_algorithms.H>
Classes | |
| struct | Circle |
| Result type: a circle defined by center and squared radius. More... | |
Public Member Functions | |
| Circle | operator() (const DynList< Point > &points) const |
| Compute the minimum enclosing circle of a point set. | |
| Circle | operator() (std::initializer_list< Point > points) const |
| Convenience overload accepting an initializer list. | |
Static Public Member Functions | |
| static Circle | from_one_point (const Point &a) |
| Circle through a single point (degenerate, radius = 0). | |
| static Circle | from_two_points (const Point &a, const Point &b) |
Smallest circle with a and b on its boundary (diameter). | |
| static Circle | from_three_points (const Point &a, const Point &b, const Point &c) |
| Circumscribed circle through three points. | |
Static Private Member Functions | |
| static Circle | mec_with_point (const Array< Point > &pts, size_t n, const Point &p1) |
Minimum enclosing circle with boundary point p1. | |
| static Circle | mec_with_two_points (const Array< Point > &pts, size_t n, const Point &p1, const Point &p2) |
Minimum enclosing circle with boundary points p1 and p2. | |
| static Circle | welzl_iterative (const Array< Point > &pts) |
| Iterative Welzl: three nested loops. | |
Smallest circle enclosing a point set (Welzl's algorithm).
Given a set of 2D points, computes the minimum enclosing circle (MEC) using an iterative version of Welzl's randomized incremental algorithm.
Definition at line 1090 of file geom_algorithms.H.
Circle through a single point (degenerate, radius = 0).
Definition at line 1113 of file geom_algorithms.H.
Referenced by mec_with_point(), and welzl_iterative().
|
inlinestatic |
Circumscribed circle through three points.
If the three points are collinear, returns the diameter circle of the farthest pair.
Definition at line 1130 of file geom_algorithms.H.
References Aleph::Point::distance_squared_to(), Aleph::divide_and_conquer_partition_dp(), from_two_points(), Aleph::Point::get_x(), and Aleph::Point::get_y().
Referenced by mec_with_two_points(), and TEST_F().
|
inlinestatic |
Smallest circle with a and b on its boundary (diameter).
Definition at line 1119 of file geom_algorithms.H.
References Aleph::Point::distance_squared_to(), and Aleph::Point::midpoint().
Referenced by from_three_points(), mec_with_two_points(), and TEST_F().
|
inlinestaticprivate |
Minimum enclosing circle with boundary point p1.
Definition at line 1212 of file geom_algorithms.H.
References Aleph::MinimumEnclosingCircle::Circle::contains(), Aleph::divide_and_conquer_partition_dp(), from_one_point(), and mec_with_two_points().
Referenced by welzl_iterative().
|
inlinestaticprivate |
Minimum enclosing circle with boundary points p1 and p2.
Definition at line 1224 of file geom_algorithms.H.
References Aleph::MinimumEnclosingCircle::Circle::contains(), Aleph::divide_and_conquer_partition_dp(), from_three_points(), from_two_points(), and k.
Referenced by mec_with_point().
Compute the minimum enclosing circle of a point set.
| points | Input point set (unmodified; a working copy is made). |
| std::domain_error | if the point set is empty. |
Definition at line 1177 of file geom_algorithms.H.
References ah_domain_error_if, Aleph::Array< T >::append(), Aleph::divide_and_conquer_partition_dp(), Aleph::HTList::Iterator::has_curr(), and welzl_iterative().
|
inline |
Convenience overload accepting an initializer list.
Definition at line 1202 of file geom_algorithms.H.
References Aleph::DynList< T >::append(), and l.
|
inlinestaticprivate |
Iterative Welzl: three nested loops.
Definition at line 1237 of file geom_algorithms.H.
References Aleph::MinimumEnclosingCircle::Circle::contains(), Aleph::divide_and_conquer_partition_dp(), from_one_point(), and mec_with_point().
Referenced by operator()().