Skip to content

jw3126/ConvexHulls2d.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ConvexHulls2d

Stable Dev Build Status Coverage

Zero dependency convex hulls in 2d.

Usage

using ConvexHulls2d
pts = [randn(2) for _ in 1:50]
h = CH.ConvexHull(pts)
CH.area(h)
CH.circumference(h)
CH.vertices(h) # corner points that span the convex hull
CH.indices(h)  # indices of the corner points as elements of pts

using GLMakie # requires >= julia 1.9

fap = scatter(first.(pts), last.(pts), label="points", color=:blue)
lines!(h, label="ConvexHull", color=:red)
scatter!(h, label="vertices", color=:red)
axislegend()
fap

image

Alternatives

There are many packages in julia capapable of computing convex hulls. Some examples are:

All of these packages offer much more than this package, however they are more heavy depependencies. Also this package is faster then most of them for small to medium numbers of points.

About

Simple and lightweight convex hull in 2d

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages