geom2d-0.2.2: package for geometry in euklidean 2d space

Geom2d.Shape

Synopsis

# Documentation

data Shape p a Source

`Shape` describes geometric shapes in the euklidean plain.

Instances

 (Rotation p, Point p) => Rotation (Shape p) Source Translate p => Translate (Shape p) Source Point p => Spatial (Shape p) Source (Floating a, Eq (p a), Num (p a), Ord a, Point p, Distance p p) => Intersect (p a) (Shape p a) Source (Eq a, Eq (p a)) => Eq (Shape p a) Source (Read a, Read (p a)) => Read (Shape p a) Source (Show a, Show (p a)) => Show (Shape p a) Source (Eq (p a), RealFloat a, Num (p a), Point p, Arbitrary a, Arbitrary (p a), Scale p) => Arbitrary (Shape p a) Source (Floating a, Eq (p a), Num (p a), Ord a, Point p, Distance p p) => Intersect (Shape p a) (p a) Source (Point p, RealFloat a, Ord a, Eq (p a)) => Intersect (FinLine p a) (Shape p a) Source (Point p, RealFloat a, Ord a, Eq (p a)) => Intersect (Shape p a) (FinLine p a) Source (Ord a, Distance p p, Eq (p a), Num (p a), Point p, RealFloat a) => Intersect (Shape p a) (Shape p a) Source

class Spatial s where Source

Methods

area :: (Floating a, Ord a) => s a -> a Source

minX :: (Floating a, Ord a) => s a -> a Source

maxX :: (Floating a, Ord a) => s a -> a Source

minY :: (Floating a, Ord a) => s a -> a Source

maxY :: (Floating a, Ord a) => s a -> a Source

Instances

 Point p => Spatial (Shape p) Source Point p => Spatial (Polygon p) Source Point p => Spatial (Circle p) Source

circle :: Num a => p a -> a -> Shape p a Source

rectangle :: (Translate p, Eq a, RealFloat a, Point p, Rotation p) => p a -> a -> a -> Maybe (Shape p a) Source

convexHull :: (Num (p a), Fractional a, Ord a, Scale p, Point p) => [p a] -> Maybe (Shape p a) Source

centerPoint :: (Fractional a, Scale p, Num (p a)) => Shape p a -> p a Source