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

Core.Geometry

Description

Module for geometrical shapes.

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

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

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 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.