52 cout <<
"[Aleph Geometry Example] " << title <<
"\n";
53 cout <<
"============================================================\n";
75 const auto sep =
gjk(a, b);
77 cout <<
"Separated case:\n";
78 cout <<
" intersects = " << (
sep.intersects ?
"true" :
"false") <<
"\n";
79 cout <<
" distance^2 = " <<
sep.distance_squared <<
"\n";
80 cout <<
" distance = " <<
sep.distance <<
"\n";
81 cout <<
" closest A = (" <<
sep.closest_on_first.get_x() <<
", "
82 <<
sep.closest_on_first.get_y() <<
")\n";
83 cout <<
" closest B = (" <<
sep.closest_on_second.get_x() <<
", "
84 <<
sep.closest_on_second.get_y() <<
")\n";
102 const auto ov =
gjk(c, d);
103 cout <<
"\nOverlapping case:\n";
104 cout <<
" intersects = " << (
ov.intersects ?
"true" :
"false") <<
"\n";
105 cout <<
" distance^2 = " <<
ov.distance_squared <<
"\n";
109 cout <<
"STATUS: OK\n";
Distance between two closed convex polygons using GJK.
Represents a point with rectangular coordinates in a 2D plane.
A general (irregular) 2D polygon defined by a sequence of vertices.
void add_vertex(const Point &point)
Add a vertex to the polygon.
void close()
Close the polygon.
static void print_banner(const char *title)
Computational geometry algorithms.
Main namespace for Aleph-w library functions.
Divide_Conquer_DP_Result< Cost > divide_and_conquer_partition_dp(const size_t groups, const size_t n, Transition_Cost_Fn transition_cost, const Cost inf=dp_optimization_detail::default_inf< Cost >())
Optimize partition DP using divide-and-conquer optimization.