-- | Circle approximated with 4 cubic bezier curves
circlePath :: Point -> Expr -> Path
circlePath center r =
  Path (pt r zero)
  [CurveTo (pt r k) (pt k r) (pt zero r),
   CurveTo (pt (negate k) r) (pt (negate r) k) (pt (negate r) zero),
   CurveTo (pt (negate r) (negate k)) (pt (negate k) (negate r)) (pt zero (negate r)),
   CurveTo (pt k (negate r)) (pt r (negate k)) (pt r zero),
   Cycle]
 where k1 :: Double
       k1 = fromInteger 4 * (sqrt (fromInteger 2) - (fromInteger 1)) / fromInteger 3
       k = k1 *^ r
       pt x y = center + (Point x y)
circlePath :: Point -> Expr -> Path
circlePath center r =
  Path (pt r zero)
  [CurveTo (pt r k) (pt k r) (pt zero r),
   CurveTo (pt (negate k) r) (pt (negate r) k) (pt (negate r) zero),
   CurveTo (pt (negate r) (negate k)) (pt (negate k) (negate r)) (pt zero (negate r)),
   CurveTo (pt k (negate r)) (pt r (negate k)) (pt r zero),
   Cycle]
 where k1 :: Double
       k1 = fromInteger 4 * (sqrt (fromInteger 2) - (fromInteger 1)) / fromInteger 3
       k = k1 *^ r
       pt x y = center + (Point x y)
circlePath center r =
  Path (pt r zero)
  [CurveTo (pt r k) (pt k r) (pt zero r),
   CurveTo (pt (negate k) r) (pt (negate r) k) (pt (negate r) zero),
   CurveTo (pt (negate r) (negate k)) (pt (negate k) (negate r)) (pt zero (negate r)),
   CurveTo (pt k (negate r)) (pt r (negate k)) (pt r zero),
   Cycle]
 where k1 :: Double
       k1 = fromInteger 4 * (sqrt (fromInteger 2) - (fromInteger 1)) / fromInteger 3
       k = k1 *^ r
       pt x y = center + (Point x y)