convex_hull_with_algorithm

Function convex_hull_with_algorithm 

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

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

This function provides algorithm selection while maintaining the same interface as the original implementation.

§Arguments

  • points - Input points (shape: npoints x n_dim)
  • algorithm - Algorithm to use for convex hull computation

§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_with_algorithm, ConvexHullAlgorithm};
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_with_algorithm(&points.view(), ConvexHullAlgorithm::GrahamScan).unwrap();
assert!(hull_vertices.nrows() >= 3);