Partial fix to static wall generation, add haddocks
This commit is contained in:
@@ -57,14 +57,6 @@ pointInPolygon :: Point2 -> [Point2] -> Bool
|
||||
pointInPolygon !p [] = False
|
||||
pointInPolygon !p (x:xs) = all (\l -> uncurry (errorIsLHS 1) l p) $ zip (x:xs) (xs ++ [x])
|
||||
|
||||
pointInsidePolygon :: Point2 -> [Point2] -> Bool
|
||||
pointInsidePolygon !p (x:xs) = all (\l -> not (uncurry isRHS l (p +.+ normalizeV s))) pairs
|
||||
|| any (\l -> uncurry isOnLine l p) pairs
|
||||
where
|
||||
pairs = zip (x:xs) (xs ++ [x])
|
||||
s = ((1/fromIntegral (length (x:xs))) *.* (foldr1 (+.+) (x:xs))) -.- p
|
||||
|
||||
|
||||
errorPointInPolygon :: Int -> Point2 -> [Point2] -> Bool
|
||||
errorPointInPolygon !i !p xs
|
||||
| length xs == 1 = error "one point polygon"
|
||||
|
||||
Reference in New Issue
Block a user