Refactor bouncing bullets

This commit is contained in:
2022-07-18 09:44:25 +01:00
parent ce3154d311
commit ce36aa8295
4 changed files with 81 additions and 84 deletions
+3
View File
@@ -115,6 +115,9 @@ difference x y
reflectIn :: Point2 -> Point2 -> Point2
reflectIn line vec = rotateV (2 * angleBetween line vec) vec
reflectIn' :: Point2 -> Point2 -> Point2
reflectIn' line vec = rotateV (2 * angleBetween vec line) vec
-- | Find angle between two points.
-- Not normalised, ranges from -2*pi to 2*pi.
angleBetween :: Point2 -> Point2 -> Float