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

Geom2d.Shape.Internal

Synopsis

# Documentation

data Circle p a Source

Constructors

 Circle (p a) a

Instances

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

mkCircleInt :: Num a => p a -> a -> Circle p a Source

radius :: Circle p a -> a Source

center :: Circle p a -> p a Source

data Polygon p a Source

A Polygon is meant to describe a convex 2-dimensional shape.

Constructors

 Polygon (p a) [p a] The point (first argument) should be inside the polygon, otherwise weird stuff will happen. Also you must not specify the same vector (second argument) twice.

Instances

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

convexHull' :: forall p a. (Num (p a), Fractional a, Ord a, Scale p, Point p) => [p a] -> Maybe (Polygon p a) Source

Calculate the convex hull of an arbitrary number of points.

Arguments

 :: (Point p, RealFloat a, Eq a, Translate p, Rotation p) => p a -> a length of one side -> a length of the other side -> Maybe (Polygon p a)

data Shape p a Source

`Shape` describes geometric shapes in the euklidean plain.

Constructors

 ShapeCircle (Circle p a) ShapePolygon (Polygon p a)

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

data Box a Source

Constructors

 Box (a, a) (a, a)

Instances

 Ord a => Intersect (Box a) (Box a) Source

spatialBox :: (Floating a, Ord a, Spatial s) => s a -> Box a Source