-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
22 lines (17 loc) · 707 Bytes
/
Copy pathMain.java
File metadata and controls
22 lines (17 loc) · 707 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import geometrical_shapes.*;
public class Main {
public static void main(String[] args) {
Image image = new Image(1000, 1000);
Line line = new Line(new Point(200, 150), new Point(400, 500));
line.draw(image);
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());
circle.draw(image);
}
image.save("image.png");
}
}