Skip to content
FutureBlitz

    Install

    Import std.math.polygon

    ConvexHull

    std.math.polygon

    function

    @PanicsAtCaller Public Function ConvexHull(points: Vec2[]): Vec2[]

    The smallest convex polygon holding every point, counterclockwise from the lowest of the leftmost, with no corner on a straight edge: Andrew's monotone chain. Fewer than three points that aren't on one line give those of them that are its ends. A corner that isn't finite panics.

    Examples

    
    Local points = [Vec2(0, 0), Vec2(2, 0), Vec2(1, 1), Vec2(2, 2), Vec2(0, 2)]
    Expect(ConvexHull(points).Count == 4)

    std/math/polygon.fb, line 159

    Report an issue with this page or with FutureBlitz on GitHub.