diff --git a/Pathfinding/Pathfinder.cs b/Pathfinding/Pathfinder.cs index 3736c08..ccf0464 100644 --- a/Pathfinding/Pathfinder.cs +++ b/Pathfinding/Pathfinder.cs @@ -205,6 +205,8 @@ public class Pathfinder double v1L = Math.Sqrt(v1.x * v1.x + v1.y * v1.y); double v2L = Math.Sqrt(v2.x * v2.x + v2.y * v2.y); double ang = Math.Acos(dotProd / (v1L * v2L)); + if (ang.Equals(double.NaN)) + return 0; double angle = Utils.RadiansToDegrees(ang); return angle; } diff --git a/RenderPath/Renderer.cs b/RenderPath/Renderer.cs index ac7db4f..a7d8788 100644 --- a/RenderPath/Renderer.cs +++ b/RenderPath/Renderer.cs @@ -131,11 +131,9 @@ public static class Renderer } [SuppressMessage("Interoperability", "CA1416:Plattformkompatibilität überprüfen")] - public static ValueTuple DrawGScores(Dictionary gScoreDict, Image? renderOver = null, + public static ValueTuple DrawGScores(Dictionary gScore, Image? renderOver = null, Bounds? bounds = null) { - Dictionary gScore = - gScoreDict.Where(kv => kv.Value < double.MaxValue).ToDictionary(pair => pair.Key, pair => pair.Value); float minLat = bounds?.minLat ?? gScore.Min(kv => kv.Key.coordinates.latitude); float minLon = bounds?.minLon ?? gScore.Min(kv => kv.Key.coordinates.longitude);