@@ -123,7 +123,7 @@ public static Shape createRect(Vector2d pos1, Vector2d pos2) {
123
123
public static Shape createRect (double x1 , double y1 , double x2 , double y2 ) {
124
124
return createRect (new Vector2d (x1 , y1 ), new Vector2d (x2 , y2 ));
125
125
}
126
-
126
+
127
127
/**
128
128
* Creates a {@link Shape} representing an ellipse.
129
129
* @param centerPos the center of the ellipse
@@ -134,18 +134,18 @@ public static Shape createRect(double x1, double y1, double x2, double y2) {
134
134
*/
135
135
public static Shape createEllipse (Vector2d centerPos , double radiusX , double radiusY , int points ) {
136
136
if (points < 3 ) throw new IllegalArgumentException ("A shape has to have at least 3 points!" );
137
-
137
+
138
138
Vector2d [] pointArray = new Vector2d [points ];
139
139
double segmentAngle = 2 * Math .PI / points ;
140
140
double angle = 0d ;
141
141
for (int i = 0 ; i < points ; i ++) {
142
142
pointArray [i ] = centerPos .add (Math .sin (angle ) * radiusX , Math .cos (angle ) * radiusY );
143
143
angle += segmentAngle ;
144
144
}
145
-
145
+
146
146
return new Shape (pointArray );
147
147
}
148
-
148
+
149
149
/**
150
150
* Creates a {@link Shape} representing an ellipse.
151
151
* @param centerX the x-position of the center of the ellipse
@@ -158,7 +158,7 @@ public static Shape createEllipse(Vector2d centerPos, double radiusX, double rad
158
158
public static Shape createEllipse (double centerX , double centerY , double radiusX , double radiusY , int points ) {
159
159
return createEllipse (new Vector2d (centerX , centerY ), radiusX , radiusY , points );
160
160
}
161
-
161
+
162
162
/**
163
163
* Creates a {@link Shape} representing a circle.
164
164
* @param centerPos the center of the circle
0 commit comments