Private
Public Access
Properly rounding numbers in RegularPolygon
This commit is contained in:
1 parent
48690f463f
commit
c5fbc13f06
1 file changed
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.CodeDom;
|
using System.CodeDom;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
@@ -178,7 +178,7 @@ namespace Advanced_Software_Engineering {
|
|||||||
double dx = scale * Math.Sin(angle);
|
double dx = scale * Math.Sin(angle);
|
||||||
double dy = scale * Math.Cos(angle);
|
double dy = scale * Math.Cos(angle);
|
||||||
|
|
||||||
points.Add(new Point((int)dx, (int)dy));
|
points.Add(new Point((int) Math.Round(dx), (int) Math.Round(dy));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.sides = sides;
|
this.sides = sides;
|
||||||
|
|||||||
Reference in new issue
Block a user