| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
SvgIcons.Core.Geometry
Description
Module for geometrical shapes.
Documentation
Arguments
| :: Int | number of vertices |
| -> Float | circumradius |
| -> (Float, Float) | coordinates of the central point |
| -> Svg | resulting svg path |
regularPolygon builds a regular polygon.
You can customize fill and stroke using the usual blaze-svg functions. For example:
regularPolygon 5 100 (200,300) ! A.fill "pink" ! A.stroke "#0000FF" ! A.strokeWidth "10"
will return a path element corresponding to a regular pentagon of radius 100 centered at point (200,300) filled in pink, green stroke and stroke width 10.
starPolygonFirstSpecies Source #
Arguments
| :: Int | number of vertices |
| -> Float | circumradius |
| -> (Float, Float) | coordinates of the central point |
| -> Svg | resulting svg path |
starPolygonFirstSpecies builds a first species regular star polygon.
First species means that one vertice is skipped when joining vertices. The number of vertices must be strictly greater than 4. Can be customized with the usual blaze-svg functions.
Returns a path
Arguments
| :: Int | number of vertices |
| -> Float | circumradius |
| -> Float | inner radius (circumradius of the inner polygon) |
| -> (Float, Float) | coordinates of the central point |
| -> Svg | resulting path |
starOutline builds a first species irregular star polygon.
The difference with the previous function is the stroke: the previous function's stroke runs inside the figure (so it would draw a pentagram), while this function's stroke runs outside the shape (so it would draw a star). There is no visual difference if you only fill the paths (with no stroke).
Returns a path
starFat :: Int -> Float -> (Float, Float) -> Svg Source #
starFat builds a first species irregular star polygon.
Works as starOutline but you don't need to specify
the inner radius, it is already coded so that you get a
"fat" star.
starRegular :: Int -> Float -> (Float, Float) -> Svg Source #
starRegular builds a first species regular star polygon.
Works as starOutline but you don't need to specify
the inner radius, and you will get a regular star.