Skip to content

Commit

Permalink
Add some docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomas Lycken committed Sep 12, 2016
1 parent 2bbb071 commit 80e2eb1
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/QuickHull.jl
Original file line number Diff line number Diff line change
@@ -1,16 +1,43 @@
"""
Find the convex hull of a set of points in 2D.
Usage:
```
using QuickHull, FixedSizeArrays
points = map(Vec, rand(10), rand(10))
hull = qhull(points)
```
or
```
using QuickHull
xs, ys = rand(10), rand(10)
hullx, hully = qhull(xs, ys)
```
Documentation is available at https://tlycken.github.io/QuickHull.jl/latest
"""
module QuickHull

using FixedSizeArrays

export qhull

"""
`hullx, hully = qhull(xs, ys)`
"""
function qhull(xs, ys)
points = map(Vec, xs, ys)
hull = qhull(points)
x, y = collect(zip(map(p -> (p...), hull)...))
collect(x), collect(y)
end

"""
`hull = qhull(points::Vector{Vec{2,T}})`
"""
function qhull{T<:Vec{2}}(points::Vector{T})
hull = Vector{T}(0)

Expand All @@ -30,6 +57,11 @@ function qhull{T<:Vec{2}}(points::Vector{T})
hull
end

"""
Find the convex hull of a set of points in 2D.
"""
qhull

function qhull!(hull, P, Q, points)
length(points) == 0 && return

Expand Down

0 comments on commit 80e2eb1

Please sign in to comment.