svg-icons-0.1.0.0: Svg Icons and more
Safe HaskellSafe-Inferred
LanguageHaskell2010

Core.Geometry

Synopsis

Documentation

regularPolygon Source #

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

starOutline Source #

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 funtion'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).

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.