@@ -5,6 +5,7 @@
5module Graphics.Geometry where
5module Graphics.Geometry where
8+import Native.Utils (toFloat)
9type Path = [(Float,Float)]
10type Path = [(Float,Float)]
@@ -19,12 +20,16 @@ rect w h = [ (0-w/2,0-h/2), (0-w/2,h/2), (w/2,h/2), (w/2,0-h/2) ]
21 let n = 50
22 let n = 50
22− f i = (w/2 * Math.cos (2*Math.pi/n * i), h/2 * Math.sin (2*Math.pi/n * i))
26+ f i = (hw * Math.cos (t*i), hh * Math.sin (t*i))
23 in map f [0..n-1]
27 in map f [0..n-1]
25circle r = oval (2*r) (2*r)
29circle r = oval (2*r) (2*r)
28 let m = toFloat n
32 let m = toFloat n
29− f i = ( r * Math.cos (2*Math.pi/m * i), r * Math.sin (2*Math.pi/m * i))
34+ f i = ( r * Math.cos (t*i), r * Math.sin (t*i) )
30 in map f [0..n-1]
35 in map f [0..n-1]