Permalink
Browse files

Change dilated to take one parameter.

Function is nearly unused, so I'm not concerned about breakage.
This new version better aligns with standard educational usage,
in which "dilation" means uniform scaling.  Taken as a separate
operation, it commutes with rotation, and preserves similarity
of shapes, neither of which is true of scaling in general.
  • Loading branch information...
cdsmith committed Jun 21, 2017
1 parent 083355d commit 054c811b494746ec7304c3d495675046727ab114
Showing with 4 additions and 4 deletions.
  1. +2 −2 codeworld-api/src/CodeWorld/Picture.hs
  2. +2 −2 codeworld-base/src/Internal/Picture.hs
@@ -181,8 +181,8 @@ scaled :: Double -> Double -> Picture -> Picture
scaled = Scale
-- | A picture scaled by these factors.
dilated :: Double -> Double -> Picture -> Picture
dilated = scaled
dilated :: Double -> Picture -> Picture
dilated k = scaled k k
-- | A picture rotated by this angle.
--
@@ -184,8 +184,8 @@ scaled :: (Picture, Number, Number) -> Picture
scaled (p, x, y) = CWPic (CW.scaled (toDouble x) (toDouble y) (toCWPic p))
-- | A picture scaled by these factors.
dilated :: (Picture, Number, Number) -> Picture
dilated = scaled
dilated :: (Picture, Number) -> Picture
dilated (p, k) = CWPic (CW.dilated (toDouble k) (toCWPic p))
-- | A picture rotated by this angle.
rotated :: (Picture, Number) -> Picture

0 comments on commit 054c811

Please sign in to comment.