removing unneeded code

This commit is contained in:
nek0 2018-07-08 07:56:13 +02:00
parent bfccf32451
commit b04ae8759b

View file

@ -134,23 +134,6 @@ manhattan graph input =
(M.safeGet (r + 1) c mat /= Just Wall) = M.setElem Wall (r, c) mat (M.safeGet (r + 1) c mat /= Just Wall) = M.setElem Wall (r, c) mat
| otherwise = mat | otherwise = mat
calculDelta :: AG.Graph MMNode -> MMNode -> (Int, V2 Double)
calculDelta graph node =
let accel = foldl sproing (V2 0 0 :: V2 Double) (vertexList graph)
sproing acc a
| mmId a == mmId node =
acc + V2 0 0
| a `elem` map snd (filter ((== node) . fst) $ edgeList graph) =
acc + fmap (* (springKonst * (distance (mmPos a) (mmPos node) - l0)))
(normv (mmPos a - mmPos node))
| node `elem` map snd (filter ((== a) . fst) $ edgeList graph) =
acc - fmap (* (springKonst * (distance (mmPos a) (mmPos node) - l0)))
(normv (mmPos node - mmPos a))
| otherwise =
acc - fmap (* (1000 / ((distance (mmPos node) (mmPos a)) ^ (2 :: Int))))
(normv (mmPos a - mmPos node))
in (mmId node, fmap (* friction) accel)
calculDelta2 :: AG.Graph MMNode -> [(Int, V2 Double)] calculDelta2 :: AG.Graph MMNode -> [(Int, V2 Double)]
calculDelta2 graph = calculDelta2 graph =
let accel2 = sproing2 (zip (vertexList graph) (repeat $ V2 0 0)) let accel2 = sproing2 (zip (vertexList graph) (repeat $ V2 0 0))