hgeometry-0.1.0.0: Geometry types in Haskell

Safe HaskellNone

Data.Geometry.Circle

Synopsis

Documentation

data Circle2' a Source

A circle in the plane

Constructors

Circle2 (Point2' a) a 

Instances

HasPoints Circle2' 
IsCircleLike Circle2' 
(Ord a, Floating a) => AreIntersectable Circle2' Polyline2' a 
(Ord a, Floating a) => AreIntersectable Circle2' Line2' a 
(Ord a, Floating a) => AreIntersectable Circle2' LineSegment2' a

Intersection is symetrical instance AreIntersectable g h a => AreIntersectable h g a where intersectionPoints h g = intersectionPoints g h

Eq a => Eq (Circle2' a) 
(Eq (Circle2' a), Ord a) => Ord (Circle2' a) 
Read a => Read (Circle2' a) 
Show a => Show (Circle2' a) 

newtype Disc2' a Source

A disc in the plane (i.e. a circle inclusiding its contents)

Constructors

Disc2 

Fields

border :: Circle2' a
 

Instances

HasPoints Disc2' 
IsCircleLike Disc2' 
Eq a => Eq (Disc2' a) 
(Eq (Disc2' a), Ord a) => Ord (Disc2' a) 
Read a => Read (Disc2' a) 
Show a => Show (Disc2' a) 

class IsCircleLike t whereSource

functions on circles

Class expressing functions that circlelike objects all have. Like a center and a radius. Minimal implementation is either getCircle or center and radius

Methods

getCircle :: t a -> Circle2' aSource

center :: t a -> Point2' aSource

radius :: t a -> aSource

distance :: Floating a => Point2' a -> t a -> aSource

distanceToCenter :: Floating a => Point2' a -> t a -> aSource

inCircle :: (Ord a, Floating a) => Point2' a -> Circle2' a -> BoolSource

Checking if points lie in or on a circle/disc

whether or not p lies in OR on the circle c

insideCircle :: (Floating a, Ord a) => Point2' a -> Circle2' a -> BoolSource

whether or not p lies strictly inside the circle c

onCircle :: (Eq a, Floating a) => Point2' a -> Circle2' a -> BoolSource

whether or not p lies on the circle

inDisc :: (Floating a, Ord a) => Point2' a -> Disc2' a -> BoolSource

whether or not a point lies in a disc: this includes its border

insideDisc :: (Floating a, Ord a) => Point2' a -> Disc2' a -> BoolSource

whether or not a point lies strictly inside a disc.