Commit before removing pressplates
This commit is contained in:
@@ -9,6 +9,7 @@ import Geometry.Data
|
||||
import Geometry.LHS
|
||||
import Geometry.Vector
|
||||
import ListHelp
|
||||
import Linear
|
||||
|
||||
-- | Draw an anticlockwise rectangle based on maximal N S W E values.
|
||||
rectNSWE :: Float -> Float -> Float -> Float -> [Point2]
|
||||
@@ -153,7 +154,7 @@ convexHullSafe _ = []
|
||||
grahamScan :: [Point2] -> [Point2]
|
||||
grahamScan = foldr push []
|
||||
where
|
||||
push point stack = grahamEliminate (point : stack)
|
||||
push p stack = grahamEliminate (p : stack)
|
||||
|
||||
{- | Remove second element if top three elements are not counterclockwise.
|
||||
Repeat if necessary. See
|
||||
@@ -164,8 +165,8 @@ grahamEliminate (x : y : z : xs)
|
||||
| not $ isLHS x y z = grahamEliminate (x : z : xs)
|
||||
grahamEliminate xs = xs
|
||||
|
||||
centroid :: Foldable t => t Point2 -> Point2
|
||||
centroid = L.fold $ (/) <$> L.Fold (+.+) (V2 0 0) id <*> L.genericLength
|
||||
centroid :: (Num (f a),Functor f, Fractional a,Foldable t) => t (f a) -> f a
|
||||
centroid = L.fold $ (^/) <$> L.Fold (+) 0 id <*> L.genericLength
|
||||
|
||||
centroidNum :: (Fractional a, Foldable t) => t a -> a
|
||||
centroidNum = L.fold $ (/) <$> L.Fold (+) 0 id <*> L.genericLength
|
||||
|
||||
Reference in New Issue
Block a user