diff options
author | sternenseemann <git@lukasepple.de> | 2019-05-20 12:59:19 +0200 |
---|---|---|
committer | sternenseemann <git@lukasepple.de> | 2019-05-20 13:20:41 +0200 |
commit | 860e7370aa50d20f85709f62406ea115ea06bc62 (patch) | |
tree | 843953933f9a14063e71eacb5beebb2998d3e3b0 | |
parent | 87971e2174df14a511f5788334a27630cf0037ae (diff) |
structure documentation for Grav2ty.Simulation
-rw-r--r-- | lib/Grav2ty/Simulation.hs | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/lib/Grav2ty/Simulation.hs b/lib/Grav2ty/Simulation.hs index 1027d3f..39e2883 100644 --- a/lib/Grav2ty/Simulation.hs +++ b/lib/Grav2ty/Simulation.hs @@ -1,4 +1,20 @@ -module Grav2ty.Simulation where +module Grav2ty.Simulation + ( + -- * Objects + Object (..) + , Modifier (..) + , World (..) + , updateObject + , gravitationForces + -- * Hitboxes + , Hitbox (..) + , shipHitbox + , centeredCircle + , translateHitbox + , rotateHitbox + , collision + , collisionWithWorld + ) where import Control.Lens import Data.Complex @@ -47,7 +63,9 @@ rotateHitbox angle box = where rotator = cos angle :+ sin angle rotate = (^. complexV2) . (* rotator) . (^. from complexV2) --- | Based on <https://de.wikipedia.org/wiki/Cramersche_Regel> +-- | Implementation of +-- [Cramer's rule](https://en.wikipedia.org/wiki/Cramer%27s_rule) for solving +-- a system of two linear equations. cramer2 :: (Eq a, Fractional a) => M22 a -> V2 a -> Maybe (a, a) cramer2 coeff res = if detA == 0 then Nothing |