Permalink
Browse files

polygon type sig problem fix.

  • Loading branch information...
colah committed Oct 31, 2011
1 parent 4af4edb commit 04cd08c4b0d8e5a6893717eeb18d026552e63f3d
Showing with 2 additions and 2 deletions.
  1. +2 −2 Graphics/Implicit/Primitives.hs
@@ -90,8 +90,8 @@ regularPolygon ::
-- ^ number of sides
-> -- ^ radius
-> Obj2 -- ^ resulting regular polygon
-regularPolygon sides r =
- \(x,y) -> maximum [ x*cos(2*pi*m/sides) + y*sin(2*pi*m/sides) | m <- [0.. sides -1]] - r
+regularPolygon sides r = let sidesr = fromIntegral sides in
+ \(x,y) -> maximum [ x*cos(2*pi*m/sidesr) + y*sin(2*pi*m/sidesr) | m <- [0.. sidesr -1]] - r
zsurface ::

0 comments on commit 04cd08c

Please sign in to comment.