aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAkshay <[email protected]>2020-12-12 14:23:11 +0000
committerAkshay <[email protected]>2020-12-12 14:23:11 +0000
commite3d58e974a07b39922696697f23727c6ae333d04 (patch)
tree254d6ed6243f835303bb16356641d70f1e2726f2 /lib
parent15e54117f32d225f6a89320c0d80f45e55cc43bd (diff)
rotate is now a util
Diffstat (limited to 'lib')
-rw-r--r--lib/Utils.hs4
1 files changed, 4 insertions, 0 deletions
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)
52inside (p, q) (r, s) (a, b) = bet a (p, r) && bet b (q, s) 52inside (p, q) (r, s) (a, b) = bet a (p, r) && bet b (q, s)
53inside' (p, q) (r, s) (a, b) = bet' a (p, r) && bet' b (q, s) 53inside' (p, q) (r, s) (a, b) = bet' a (p, r) && bet' b (q, s)
54 54
55rotate (x, y) t = (nx, ny)
56 where nx = x*cos(pi*t/180) - y*sin(pi*t/180)
57 ny = x*sin(pi*t/180) + y*cos(pi*t/180)
58
55-- [f, f.f, f.f.f, ...] 59-- [f, f.f, f.f.f, ...]
56repeatF f = f : map (f .) (repeatF f) 60repeatF f = f : map (f .) (repeatF f)
57 61