cnc-pattern-lib-0.1.0.0: Haskell library for creating SVG patterns for CNC routers

Safe HaskellNone
LanguageHaskell2010

Line

Description

A type representing a line.

Synopsis

Documentation

data Line Source #

Instances
Eq Line Source # 
Instance details

Defined in Line

Methods

(==) :: Line -> Line -> Bool #

(/=) :: Line -> Line -> Bool #

Ord Line Source # 
Instance details

Defined in Line

Methods

compare :: Line -> Line -> Ordering #

(<) :: Line -> Line -> Bool #

(<=) :: Line -> Line -> Bool #

(>) :: Line -> Line -> Bool #

(>=) :: Line -> Line -> Bool #

max :: Line -> Line -> Line #

min :: Line -> Line -> Line #

Show Line Source # 
Instance details

Defined in Line

Methods

showsPrec :: Int -> Line -> ShowS #

show :: Line -> String #

showList :: [Line] -> ShowS #

ApproxEq Line Source # 
Instance details

Defined in Line

Methods

approxEqual :: Line -> Line -> Float -> Bool Source #

(=~) :: Line -> Line -> Bool Source #

assertApproxEqual :: Line -> Line -> Float -> Assertion Source #

(@?~) :: Line -> Line -> Assertion Source #

Mergable Line Source # 
Instance details

Defined in Line

Methods

merge :: Line -> Line -> Float -> Maybe Line Source #

optimize :: [Line] -> Float -> [Line] Source #

Transformable Line Source # 
Instance details

Defined in Line

SvgShape Line Source # 
Instance details

Defined in Line

Methods

toSvg :: Line -> Svg Source #

pattern Line :: Point -> Point -> Line Source #

mkLine :: Float -> Float -> Float -> Float -> Line Source #

Short-form constructor for a line.

asTuple :: Line -> (Float, Float, Float, Float) Source #

Represent a line as a 4-tuple.

lineLength :: Line -> Float Source #

Calculate the length of a line.

slope :: Line -> Either String Float Source #

Calculate the slope of a line.

areParallel :: Line -> Line -> Float -> Bool Source #

Are two lines parallel?

containsPoint :: Point -> Line -> Bool Source #

Does the given point lie inside the given line segment?

overlappingSegments :: Line -> Line -> Bool Source #

Are two line (segments) overlapping? (i.e. are collinear and the enpoint of one is contained within length of the other)