-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.java
30 lines (26 loc) · 894 Bytes
/
Main.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import java.awt.Point;
public class Main {
public static int spacing = 30;
public static void main(String[] args){
Cosketch c = new Cosketch(1280,0);
c.eraseAll();
c.setTool(Cosketch.TOOL.CIRCLE, Cosketch.SIZE.SMALL);
for(int i = 0 ; i < 30 ; i++){
if(i%2==0)c.setSize(Cosketch.SIZE.LARGE);
else c.setSize(Cosketch.SIZE.SMALL);
c.drag(i*10, i*10, i*20, i*20);
}
System.exit(0);
for(int x = 0 ; x < 800 ; x+=spacing)
for(int y = 0 ; y < 600 ; y+=spacing){
Point vec = field((x-400)/400.0*4,(y-300)/300.0*3);
c.drag(x,y,x+vec.x,y+vec.y);
}
}
public static Point field(double x, double y){
return new Point(
(int)(-y*10),
(int)(x*10)
);
}
}