geom2d-0.1.3.1: Geom2d/Shape.hs
module Geom2d.Shape
( Shape
, Spatial (..)
, circle
, rectangle
, convexHull
)
where
import Geom2d.Point
import Geom2d.Rotation
import Geom2d.Shape.Internal
import Geom2d.Translate
circle :: Num a => p a -> a -> Shape p a
circle m r = ShapeCircle $ mkCircleInt m r
rectangle :: (Translate p, Eq a, RealFloat a, Point p, Rotation p) =>
p a -> a -> a -> Maybe (Shape p a)
rectangle m a b = ShapePolygon <$> rectangleInt m a b
convexHull :: (Num (p a), Fractional a, Ord a, Scale p, Point p) =>
[p a] -> Maybe (Shape p a)
convexHull list = ShapePolygon <$> convexHull' list