Skip to content

Instantly share code, notes, and snippets.

@Agnishom
Created June 22, 2018 09:04
Show Gist options
  • Select an option

  • Save Agnishom/073adc119f7df50558eb96df95c91dfc to your computer and use it in GitHub Desktop.

Select an option

Save Agnishom/073adc119f7df50558eb96df95c91dfc to your computer and use it in GitHub Desktop.
Code for creating an circle with spokes
{-# LANGUAGE NoMonomorphismRestriction #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeFamilies #-}
import Diagrams.Prelude
import Diagrams.Backend.SVG.CmdLine
rules :: Diagram B
rules = foldr1 (<>) hands
where
hands = [ (vrule 0.5 # translateY 0.75 # rotateBy (n/10)) | n <- [1..10]]
myCircle :: Diagram B
myCircle = circle 1 <> (circle 0.5 # fc grey) <> rules
main = mainWith myCircle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment