From e3d58e974a07b39922696697f23727c6ae333d04 Mon Sep 17 00:00:00 2001 From: Akshay Date: Sat, 12 Dec 2020 19:53:11 +0530 Subject: rotate is now a util --- lib/Utils.hs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/Utils.hs') diff --git a/lib/Utils.hs b/lib/Utils.hs index 6358230..56d9c69 100644 --- a/lib/Utils.hs +++ b/lib/Utils.hs @@ -52,6 +52,10 @@ shear c (x, y) = (c * x, c * y) inside (p, q) (r, s) (a, b) = bet a (p, r) && bet b (q, s) inside' (p, q) (r, s) (a, b) = bet' a (p, r) && bet' b (q, s) +rotate (x, y) t = (nx, ny) + where nx = x*cos(pi*t/180) - y*sin(pi*t/180) + ny = x*sin(pi*t/180) + y*cos(pi*t/180) + -- [f, f.f, f.f.f, ...] repeatF f = f : map (f .) (repeatF f) -- cgit v1.2.3