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

Safe HaskellSafe
LanguageHaskell2010

Point

Contents

Synopsis

Documentation

data Point Source #

A point in 2-d space:

Point 3 4
Instances
Eq Point Source # 
Instance details

Defined in Point

Methods

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

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

Floating Point Source # 
Instance details

Defined in Point

Fractional Point Source # 
Instance details

Defined in Point

Num Point Source # 
Instance details

Defined in Point

Ord Point Source # 
Instance details

Defined in Point

Methods

compare :: Point -> Point -> Ordering #

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

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

(>) :: Point -> Point -> Bool #

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

max :: Point -> Point -> Point #

min :: Point -> Point -> Point #

Show Point Source # 
Instance details

Defined in Point

Methods

showsPrec :: Int -> Point -> ShowS #

show :: Point -> String #

showList :: [Point] -> ShowS #

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 #

pattern Point :: !Float -> !Float -> Point Source #

xVal :: Point -> Float Source #

Extract the x axis value from a point

yVal :: Point -> Float Source #

Extract the y axis value from a point

fromFloat :: Float -> Point Source #

Construct a point from a scalar value.

pointMap :: (Float -> Float) -> Point -> Point Source #

Map a float -> float function over a point.

pointAsTuple :: Point -> (Float, Float) Source #

Convert a point to a 2-tuple representation.

Operators for doing arithmetic on a point with a scalar float value

(|+|) :: Point -> Float -> Point Source #

Add a scalar value to a point:

>>> Point 1 2 |+| 5
Point 6 7

(|*|) :: Point -> Float -> Point Source #

Multiply a point by a scalar value:

>>> Point 1 2 |*| 5
Point 5 10

(|/|) :: Point -> Float -> Point Source #

Divide a point by a scalar value:

>>> Point 10 10 |/| 5
Point 2 2

Geometric point manipulation functions

mirrorP :: Point -> Point -> Point -> Point Source #

Mirror point a about a line through point p along vector v

rotateP :: Point -> Point -> Float -> Point Source #

Rotate point a about a line through point p along vector t

cartesianProduct :: [Float] -> [Float] -> [Point] Source #

Return the cartesian product of a set of coordinates on the X axis and a set of coordinates on the Y axis as a series of points.