Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Synopsis
- data Point
- pattern Point :: !Float -> !Float -> Point
- xVal :: Point -> Float
- yVal :: Point -> Float
- fromFloat :: Float -> Point
- pointMap :: (Float -> Float) -> Point -> Point
- pointAsTuple :: Point -> (Float, Float)
- (|+|) :: Point -> Float -> Point
- (|*|) :: Point -> Float -> Point
- (|/|) :: Point -> Float -> Point
- cross :: Point -> Point -> Float
- dot :: Point -> Point -> Float
- angleBetween :: Point -> Point -> Float
- mag :: Point -> Float
- magSquared :: Point -> Float
- mirrorP :: Point -> Point -> Point -> Point
- rotateP :: Point -> Point -> Float -> Point
- cartesianProduct :: [Float] -> [Float] -> [Point]
Documentation
A point in 2-d space:
Point 3 4
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
magSquared :: Point -> Float Source #
mirrorP :: Point -> Point -> Point -> Point Source #
Mirror point a about a line through point p along vector v