mirror of
https://github.com/bvanroll/cs-map-project.git
synced 2025-08-29 03:42:42 +00:00
morge nog es kijke
This commit is contained in:
@@ -80,12 +80,20 @@ namespace opdracht2
|
||||
{
|
||||
List<System.Windows.Shapes.Polygon> returnWaarde = new List<System.Windows.Shapes.Polygon>();
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -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
|
||||
|
Reference in New Issue
Block a user