|Maintainer||Andy Gill <firstname.lastname@example.org>|
This module contains some general utilties.
- innerSteps :: Int -> [R]
- outerSteps :: Int -> [R]
- fracPart :: R -> R
- fromPolar :: (R, Radian) -> Point
- toPolar :: Point -> (R, Radian)
- angleOfLine :: (Point, Point) -> Radian
- interpBool :: Bool -> UI
- sampleUI :: UI -> Bool
- withMask :: a -> Bool -> Maybe a
- withDefault :: a -> Maybe a -> a
- choose :: a -> a -> Bool -> a
- insideRegion :: (Point, Point) -> Point -> Bool
- insideCircle :: Point -> R -> Point -> Bool
- distance :: Point -> Point -> R
- intervalOnLine :: (Point, Point) -> Point -> R
- circleOfDots :: Int -> [Point]
innerSteps takes n even steps from 0 .. 1, by not actually touching 0 or 1. The first and last step are 1/2 the size of the others, so that repeated innerSteps can be tiled neatly.
outerSteps takes n even steps from 0 .. 1, starting with 0, and ending with 1, returning n+1 elements.
Point inside a circle, where the first two arguments are the center of the circle,
and the radius.
What is the
distance between two points in R2?
This is optimised for the normal form
distance p1 p2 <= v, which avoids using
intervalOnLine find the place on a line (between 0 and 1) that is closest to the given point.