-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMain.java
More file actions
23 lines (19 loc) · 744 Bytes
/
Copy pathMain.java
File metadata and controls
23 lines (19 loc) · 744 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import geometrical_shapes.Circle;
import geometrical_shapes.Image;
import geometrical_shapes.Point;
import geometrical_shapes.Rectangle;
import geometrical_shapes.Triangle;
public class Main {
public static void main(String[] args) {
Image image = new Image(1000, 1000);
Rectangle rectangle = new Rectangle(new Point(50, 50), new Point(300, 200));
rectangle.draw(image);
Triangle triangle = new Triangle(new Point(100, 100), new Point(900, 900), new Point(100, 900));
triangle.draw(image);
for (int i = 0; i < 50; i++) {
Circle circle = Circle.random(image.getWidth(), image.getHeight(), 500);
circle.draw(image);
}
image.save("image.png");
}
}