diff --git a/opdracht2/GeoJsonParser.cs b/opdracht2/GeoJsonParser.cs index de86386..55e5fec 100644 --- a/opdracht2/GeoJsonParser.cs +++ b/opdracht2/GeoJsonParser.cs @@ -80,12 +80,20 @@ namespace opdracht2 { List returnWaarde = new List(); int i = 0; + int BACKUP = 0; + int BACKBACKUP = polygonLijst.Count; while (true) { if (i >= polygonLijst.Count) { i = 0; + if (polygonLijst.Count == BACKBACKUP) + { + BACKUP++; + } + + BACKBACKUP = polygonLijst.Count; } int punt1Index = i; @@ -107,13 +115,16 @@ namespace opdracht2 returnWaarde.Add(CreateNewPolygon(polygonLijst[punt1Index], polygonLijst[punt2Index], polygonLijst[punt3Index])); polygonLijst.RemoveAt(punt2Index); + Debug.WriteLine("added a triangle, polygonLijst count " + polygonLijst.Count); } + //Debug.WriteLine(hoek); i++; + if (BACKUP == 5) break; } return returnWaarde; @@ -122,7 +133,13 @@ namespace opdracht2 //https://stackoverflow.com/a/31334882 private static double GetAngle(Point p1, Point p2, Point p3) { - return Math.Atan2(p3.Y - p1.Y, p3.X - p1.X) - Math.Atan2(p2.Y - p1.Y, p2.X - p1.X); + double waarde = (Math.Atan2(p3.Y - p1.Y, p3.X - p1.X) - Math.Atan2(p2.Y - p1.Y, p2.X - p1.X)) * (180 / Math.PI); + if (waarde < -180) + { + waarde += 180; + } + + return waarde; } diff --git a/opdracht2/bin/Debug/netcoreapp3.1/opdracht2.dll b/opdracht2/bin/Debug/netcoreapp3.1/opdracht2.dll index 94a5658..a0c178c 100644 Binary files a/opdracht2/bin/Debug/netcoreapp3.1/opdracht2.dll and b/opdracht2/bin/Debug/netcoreapp3.1/opdracht2.dll differ diff --git a/opdracht2/bin/Debug/netcoreapp3.1/opdracht2.pdb b/opdracht2/bin/Debug/netcoreapp3.1/opdracht2.pdb index 4234adc..15deae8 100644 Binary files a/opdracht2/bin/Debug/netcoreapp3.1/opdracht2.pdb and b/opdracht2/bin/Debug/netcoreapp3.1/opdracht2.pdb differ diff --git a/opdracht2/obj/Debug/netcoreapp3.1/opdracht2.dll b/opdracht2/obj/Debug/netcoreapp3.1/opdracht2.dll index 94a5658..a0c178c 100644 Binary files a/opdracht2/obj/Debug/netcoreapp3.1/opdracht2.dll and b/opdracht2/obj/Debug/netcoreapp3.1/opdracht2.dll differ diff --git a/opdracht2/obj/Debug/netcoreapp3.1/opdracht2.g.resources b/opdracht2/obj/Debug/netcoreapp3.1/opdracht2.g.resources index 4bdd5c0..1791278 100644 Binary files a/opdracht2/obj/Debug/netcoreapp3.1/opdracht2.g.resources and b/opdracht2/obj/Debug/netcoreapp3.1/opdracht2.g.resources differ diff --git a/opdracht2/obj/Debug/netcoreapp3.1/opdracht2.pdb b/opdracht2/obj/Debug/netcoreapp3.1/opdracht2.pdb index 4234adc..15deae8 100644 Binary files a/opdracht2/obj/Debug/netcoreapp3.1/opdracht2.pdb and b/opdracht2/obj/Debug/netcoreapp3.1/opdracht2.pdb differ diff --git a/opdracht2/obj/Debug/netcoreapp3.1/opdracht2_MarkupCompile.cache b/opdracht2/obj/Debug/netcoreapp3.1/opdracht2_MarkupCompile.cache index a7c5bcc..ef536d7 100644 --- a/opdracht2/obj/Debug/netcoreapp3.1/opdracht2_MarkupCompile.cache +++ b/opdracht2/obj/Debug/netcoreapp3.1/opdracht2_MarkupCompile.cache @@ -10,10 +10,10 @@ none false TRACE;DEBUG;NETCOREAPP;NETCOREAPP3_1 C:\Users\Beppe\source\repos\opdracht2\opdracht2\App.xaml -1-673581283 +1-1960587782 -4543106357 -195-2120402724 +4-1321365794 +195-2056577357 MainWindow.xaml; False