Data.Geometry.Line

Synopsis

Documentation

data LineSegment2' a Source

A simple line segment in 2D consisint of a start and an end-point

Constructors

 LineSegment2 FieldsstartPoint :: Point2' a endPoint :: Point2' a

Instances

 Functor LineSegment2' HasPoints LineSegment2' IsPoint2Functor LineSegment2' LineLike LineSegment2' (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 (LineSegment2' a) Ord a => Ord (LineSegment2' a) Read a => Read (LineSegment2' a) Show a => Show (LineSegment2' a) Floating a => HasLength (LineSegment2' a)

newtype Line2' a Source

An infinite line

Constructors

 Line2 (LineSegment2' a)

Instances

 Functor Line2' HasPoints Line2' IsPoint2Functor Line2' (Ord a, Floating a) => AreIntersectable Circle2' Line2' a Eq a => Eq (Line2' a) Ord a => Ord (Line2' a) Read a => Read (Line2' a) Show a => Show (Line2' a)

newtype Polyline2' a Source

Polylines

Constructors

 Polyline2 [LineSegment2' a]

Instances

 HasPoints Polyline2' IsPoint2Functor Polyline2' (Ord a, Floating a) => AreIntersectable Circle2' Polyline2' a Eq a => Eq (Polyline2' a) Read a => Read (Polyline2' a) Show a => Show (Polyline2' a) Floating a => HasLength (Polyline2' a)

polyLine :: [Point2' a] -> Polyline2' aSource

Constructing polylines

functions on Linesegments and Polylines

linear :: Num a => a -> a -> a -> aSource

Linear interpolation / points on line segments etc.

simple linear interpolation, assuming t in [0,1]

inRange :: Ord a => a -> (a, a) -> BoolSource

class HasLength c whereSource

Associated Types

type PM c Source

Methods

length :: c -> PM cSource

The length of the line-like segment

Instances

 Floating a => HasLength (Polyline2' a) Floating a => HasLength (LineSegment2' a)

class LineLike c whereSource

Methods

pointAt :: Num a => a -> c a -> Point2' aSource

get the point at `time` t (t in [0,1])

Instances

 LineLike LineSegment2'