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

Safe HaskellSafe
LanguageHaskell2010

ApproxEq

Description

Provides a typeclass for for comparing shapes that are approxmately the same size and have the same position in 2-d space.

Synopsis

Documentation

class Show s => ApproxEq s Source #

Minimal complete definition

approxEqual

Instances
ApproxEq Point Source # 
Instance details

Defined in Point

Methods

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

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

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

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

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 #

ApproxEq Rectangle Source # 
Instance details

Defined in Rectangle

ApproxEq Hexagon Source # 
Instance details

Defined in Hexagon

ApproxEq Circle Source # 
Instance details

Defined in Circle

Methods

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

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

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

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

ApproxEq Arc Source # 
Instance details

Defined in Arc

Methods

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

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

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

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

approxEqual :: ApproxEq s => s -> s -> Float -> Bool Source #

Are two shapes identical to within a given tolerance?

(=~) :: ApproxEq s => s -> s -> Bool Source #

Are two shapes identical to within a given tolerance? Infix version where epsilon is fixed at 0.0001.

assertApproxEqual :: (ApproxEq s, HasCallStack) => s -> s -> Float -> Assertion Source #

Helpful assertion for testing.

(@?~) :: ApproxEq s => s -> s -> Assertion Source #

Helpful assertion for testing. Infix version where epsilon is fixed at 0.01.