Skip to content

Commit 9f89e8e

Browse files
authored
add specialized method for centroid of Ngons (#1337)
1 parent a4b4a80 commit 9f89e8e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/centroid.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ centroid(p::Point) = p
1313

1414
centroid(p::Polygon) = centroid(first(rings(p)))
1515

16+
centroid(n::Ngon) = coordmean(vertices(n))
17+
1618
centroid(p::Polytope) = coordmean(vertices(p))
1719

1820
centroid(b::Box) = coordmean(extrema(b))

0 commit comments

Comments
 (0)