convex_hull

Function convex_hull 

Source
pub fn convex_hull(points: &ArrayView2<'_, f64>) -> SpatialResult<Array2<f64>>
Expand description

Compute the convex hull of a set of points using the default algorithm

This is the main convenience function that provides the same interface as the original monolithic implementation.

§Arguments

  • points - Input points (shape: npoints x n_dim)

§Returns

  • A result containing either the convex hull vertices (shape: n_vertices x n_dim) or an error

§Examples

use scirs2_spatial::convex_hull::convex_hull;
use scirs2_core::ndarray::array;

let points = array![[0.0, 0.0], [1.0, 0.0], [0.0, 1.0], [0.5, 0.5]];
let hull_vertices = convex_hull(&points.view()).unwrap();

// The hull vertices should be the corners, not the interior point
assert!(hull_vertices.nrows() >= 3);