Small inputs / visible answers
Algorithms,
in two dimensions.
See what goes in, what comes out, and why. Start with hull vertices, then intersect two simple sets.
These are educational illustrations of reviewed saved outputs, not an execution trace or new performance measurements. All configurations are complete and every result links back to native records.
Example 01 / 2D geometry
Find the convex hull
Stretch a rubber band around these points. The band touches only the extreme vertices; the center point does not change the hull. Coincident input rows share one location.
Returned original vertex IDs: [0, 1, 2, 3].
| Original point ID | x | y | Role |
|---|---|---|---|
| 0 | 0 | 0 | hull vertex |
| 1 | 1 | 0 | hull vertex |
| 2 | 1 | 1 | hull vertex |
| 3 | 0 | 1 | hull vertex |
| 4 | 0.5 | 0.5 | interior / omitted |
| 5 | 0 | 0 | duplicate of point 0 |
| 6 | 1 | 0 | duplicate of point 1 |
Complete minimal input
{
"points": [
[
0,
0
],
[
1,
0
],
[
1,
1
],
[
0,
1
],
[
0.5,
0.5
],
[
0,
0
],
[
1,
0
]
]
}Minimal public C++ call
#include <csl/geometry/quickhull_2d.hpp>
#include <iostream>
#include <vector>
int main() {
const std::vector<csl::Vector> points = {{0, 0}, {1, 0}, {1, 1}, {0, 1}, {0.5, 0.5}, {0, 0}, {1, 0}};
auto result = csl::geometry::quickhull_2d(points);
const auto* hull = std::get_if<csl::geometry::QuickHull2D>(&result);
if (!hull) return 1;
for (auto id : hull->vertex_indices) std::cout << id << " ";
}
// Link the installed target CSL::quickhull_2d (C++20).
Reproduce the native functional example
From a checkout of harness commit 74651cb028b9c2359d666ae5f141c66e0b03708b, using CMake 3.31+ and a C++20 compiler:
cmake -S . -B build/visual-geo06 -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DCSL_BUILD_GEO06_REPORT=ON -DCSL_ENABLE_HIGHS=OFF -DCSL_ENABLE_QHULL=OFF
cmake --build build/visual-geo06 --config Release --target csl_geo06_quickhull_report --parallel 2
./build/visual-geo06/csl_geo06_quickhull_report --smokeFor Visual Studio, use its developer shell, configure with its generator, and run Release/csl_geo06_quickhull_report.exe --smoke in the build directory. This is a functional smoke, not a new benchmark; discard smoke timing values.
The first input ID wins for coincident points. Polygon vertices start at the lexicographically smallest point and continue counterclockwise, without repeating the closing vertex. QuickHull uses exact orientation for the supplied binary64 coordinates; these small cases do not establish general performance.
Algorithm source ce63bff5a0face88c3c5e977f7d96337e8cbe948
Example 02 / 2D geometry
When the hull is a line
All points lie on y = x. The convex hull is the segment from (0, 0) to (3, 3), so only its two endpoints are retained. Intermediate collinear points are omitted.
Returned original vertex IDs: [1, 3].
| Original point ID | x | y | Role |
|---|---|---|---|
| 0 | 2 | 2 | interior / omitted |
| 1 | 0 | 0 | hull vertex |
| 2 | 1 | 1 | interior / omitted |
| 3 | 3 | 3 | hull vertex |
| 4 | 2 | 2 | duplicate of point 0 |
Complete minimal input
{
"points": [
[
2,
2
],
[
0,
0
],
[
1,
1
],
[
3,
3
],
[
2,
2
]
]
}Minimal public C++ call
#include <csl/geometry/quickhull_2d.hpp>
#include <iostream>
#include <vector>
int main() {
const std::vector<csl::Vector> points = {{2, 2}, {0, 0}, {1, 1}, {3, 3}, {2, 2}};
auto result = csl::geometry::quickhull_2d(points);
const auto* hull = std::get_if<csl::geometry::QuickHull2D>(&result);
if (!hull) return 1;
for (auto id : hull->vertex_indices) std::cout << id << " ";
}
// Link the installed target CSL::quickhull_2d (C++20).
Reproduce the native functional example
From a checkout of harness commit 74651cb028b9c2359d666ae5f141c66e0b03708b, using CMake 3.31+ and a C++20 compiler:
cmake -S . -B build/visual-geo06 -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DCSL_BUILD_GEO06_REPORT=ON -DCSL_ENABLE_HIGHS=OFF -DCSL_ENABLE_QHULL=OFF
cmake --build build/visual-geo06 --config Release --target csl_geo06_quickhull_report --parallel 2
./build/visual-geo06/csl_geo06_quickhull_report --smokeFor Visual Studio, use its developer shell, configure with its generator, and run Release/csl_geo06_quickhull_report.exe --smoke in the build directory. This is a functional smoke, not a new benchmark; discard smoke timing values.
The first input ID wins for coincident points. Polygon vertices start at the lexicographically smallest point and continue counterclockwise, without repeating the closing vertex. QuickHull uses exact orientation for the supplied binary64 coordinates; these small cases do not establish general performance.
Algorithm source ce63bff5a0face88c3c5e977f7d96337e8cbe948
Example 03 / 2D geometry
Intersect two sets
Keep points that satisfy both shapes: the square −1 ≤ x,y ≤ 1 and the diamond |x| + |y| ≤ 1.5. Each shape cuts off four corners of the other. The shared region is an octagon.
Expected vertices: (±1, ±0.5) and (±0.5, ±1), all sign combinations.
| Saved output row ID | x | y | Role |
|---|---|---|---|
| 0 | -1 | -0.5 | intersection vertex |
| 1 | -0.5 | -1 | intersection vertex |
| 2 | 1 | -0.5 | intersection vertex |
| 3 | 0.5 | -1 | intersection vertex |
| 4 | -1 | 0.5 | intersection vertex |
| 5 | -0.5 | 1 | intersection vertex |
| 6 | 1 | 0.5 | intersection vertex |
| 7 | 0.5 | 1 | intersection vertex |
Complete minimal input
{
"left_A": [
[
1,
0
],
[
-1,
0
],
[
0,
1
],
[
0,
-1
]
],
"left_b": [
1,
1,
1,
1
],
"right_A": [
[
1,
1
],
[
1,
-1
],
[
-1,
1
],
[
-1,
-1
]
],
"right_b": [
1.5,
1.5,
1.5,
1.5
]
}The complete inputs below use A·[x,y] ≤ b for each shape. The driver links CSL::polyhedral, CSL::qhull_conversion and CSL::highs_lp.
Reproduce the native functional example
From a checkout of harness commit b83b8dc415dbe5811371b8446931ae4c6f3d2e28, using CMake 3.31+ and a C++20 compiler:
cmake -S . -B build/visual-geo04 -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DCSL_BUILD_GEO04_REPORT=ON
cmake --build build/visual-geo04 --config Release --target csl_geo04_intersection_report --parallel 2
./build/visual-geo04/csl_geo04_intersection_report --smokeFor Visual Studio, use its developer shell, configure with its generator, and run Release/csl_geo04_intersection_report.exe --smoke in the build directory. This is a functional smoke, not a new benchmark; discard smoke timing values.
The plot uses the saved native vertex coordinates, not idealized oracle replacements. Qhull/HiGHS outputs match this fixture within absolute tolerance 1e−7; they are numerical geometry, not a validated exact enclosure. Vertex row order is not a promised cyclic boundary order.
Algorithm source 9579f9e936d85d66c59003b2a04157c153df6b63
Next: control in the plane
Position/velocity trajectories and reachable sets are a planned extension. The true two-state scenario is tracked in #421; current scalar integrator examples do not establish a two-state demonstration.