Reorganise geometry modules slightly
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user