mirror of
https://github.com/bvanroll/cs-map-project.git
synced 2025-08-29 20:02:43 +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>();
|
List<System.Windows.Shapes.Polygon> returnWaarde = new List<System.Windows.Shapes.Polygon>();
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
int BACKUP = 0;
|
||||||
|
int BACKBACKUP = polygonLijst.Count;
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (i >= polygonLijst.Count)
|
if (i >= polygonLijst.Count)
|
||||||
{
|
{
|
||||||
i = 0;
|
i = 0;
|
||||||
|
if (polygonLijst.Count == BACKBACKUP)
|
||||||
|
{
|
||||||
|
BACKUP++;
|
||||||
|
}
|
||||||
|
|
||||||
|
BACKBACKUP = polygonLijst.Count;
|
||||||
}
|
}
|
||||||
|
|
||||||
int punt1Index = i;
|
int punt1Index = i;
|
||||||
@@ -107,13 +115,16 @@ namespace opdracht2
|
|||||||
returnWaarde.Add(CreateNewPolygon(polygonLijst[punt1Index], polygonLijst[punt2Index],
|
returnWaarde.Add(CreateNewPolygon(polygonLijst[punt1Index], polygonLijst[punt2Index],
|
||||||
polygonLijst[punt3Index]));
|
polygonLijst[punt3Index]));
|
||||||
polygonLijst.RemoveAt(punt2Index);
|
polygonLijst.RemoveAt(punt2Index);
|
||||||
|
Debug.WriteLine("added a triangle, polygonLijst count " + polygonLijst.Count);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
//Debug.WriteLine(hoek);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
|
if (BACKUP == 5) break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return returnWaarde;
|
return returnWaarde;
|
||||||
@@ -122,7 +133,13 @@ namespace opdracht2
|
|||||||
//https://stackoverflow.com/a/31334882
|
//https://stackoverflow.com/a/31334882
|
||||||
private static double GetAngle(Point p1, Point p2, Point p3)
|
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
|
false
|
||||||
TRACE;DEBUG;NETCOREAPP;NETCOREAPP3_1
|
TRACE;DEBUG;NETCOREAPP;NETCOREAPP3_1
|
||||||
C:\Users\Beppe\source\repos\opdracht2\opdracht2\App.xaml
|
C:\Users\Beppe\source\repos\opdracht2\opdracht2\App.xaml
|
||||||
1-673581283
|
1-1960587782
|
||||||
|
|
||||||
4543106357
|
4-1321365794
|
||||||
195-2120402724
|
195-2056577357
|
||||||
MainWindow.xaml;
|
MainWindow.xaml;
|
||||||
|
|
||||||
False
|
False
|
||||||
|
Reference in New Issue
Block a user