Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!mcvax!ukc!msp From: msp@ukc.ac.uk (M.S.Parsons) Newsgroups: net.sources.bugs Subject: Bug in Miranda code (To generate Escher "Square Limit" picture) Message-ID: <1735@eagle.ukc.ac.uk> Date: Fri, 25-Jul-86 10:03:06 EDT Article-I.D.: eagle.1735 Posted: Fri Jul 25 10:03:06 1986 Date-Received: Sat, 26-Jul-86 06:06:51 EDT Reply-To: msp@ukc.ac.uk (M.S.Parsons) Organization: U of Kent at Canterbury, Canterbury, UK Lines: 24 Whoops! The Miranda code I recently sent to draw the M.C.Escher "squarelimit" picture had a bug. A classic case: a "+" instead of a "-". This is the correct version of the rot function (I hope): || rot rotates an image by th radians anti-clockwise, about the image centre. rot :: num -> image -> image rot th i = tr middle (imap rotp (tr (negpoint middle) i)) where rotp p = Pt (coord cos) (coord sin) where coord f = l * (f (a - th)) where (Po a l) = ctop p (Note for those running out of heap space: The only rotations involved in the drawing are multiples of 90 degrees, so this general rotate could be replaced by a much more efficient specific routine.) ------------------------------------------------------------------------------ Mike Parsons UUCP: ..!seismo!mcvax!ukc!msp JANET: msp@uk.ac.ukc MAIL: Computing Lab, University of Kent, Canterbury, Kent, UK.