Reorganise geometry modules slightly

This commit is contained in:
2021-12-15 10:59:06 +00:00
parent e3402bacf1
commit 9333d9497e
10 changed files with 198 additions and 160 deletions
+3 -4
View File
@@ -5,7 +5,7 @@ module Geometry.ConvexPoly
, cpPoints
, cpCen
, cpRad
, centroid
-- , centroid
, pointsToPoly
, convexPolysOverlap
, pointInPolyPoints
@@ -14,9 +14,10 @@ import Geometry.Data
import Geometry.Vector
import Geometry.LHS
import Geometry.Intersect
import Geometry.Polygon
import Control.Lens
import qualified Control.Foldl as L
--import qualified Control.Foldl as L
data ConvexPoly = ConvexPoly
{ _cpPoints :: [Point2]
, _cpCen :: Point2
@@ -68,7 +69,5 @@ pairPolyPointsIntersect a' b' (c':d':xs') = go c' a' b' (c':d':xs')
go _ _ _ _ = False
pairPolyPointsIntersect _ _ _ = False
centroid :: Foldable t => t Point2 -> Point2
centroid = L.fold $ (/) <$> L.Fold (+.+) (V2 0 0) id <*> L.genericLength
makeLenses ''ConvexPoly