Implement poking using Verx lists

This commit is contained in:
jgk
2021-07-30 20:04:55 +02:00
parent 834464db51
commit d7649b951b
12 changed files with 109 additions and 155 deletions
+3 -3
View File
@@ -255,10 +255,10 @@ anyPolyssIntersect x y = or $ polysIntersect <$> x <*> y
-- split a list into triples, forms triangles from a polygon
polyToTris :: [s] -> [s]
{-# INLINE polyToTris #-}
polyToTris (a:as) = f a as
polyToTris (a:as) = go a as
where
f x (y:z:ys) = x : y : z : f x (z:ys)
f _ _ = []
go !x (y:z:ys) = x : y : z : go x (z:ys)
go _ _ = []
polyToTris _ = []
-- | Return n equidistant points on a circle with a radius of 600.