-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTestBody.java
20 lines (20 loc) · 947 Bytes
/
TestBody.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
public class TestBody {
public static void main(String[] args) {
Body samh = new Body(1, 0, 0, 0, 10, "samh");
Body Aegir = new Body(3, 3, 0, 0, 5, "Aegir");
Body Rocinante = new Body(5, -3, 0, 0, 50, "Rocinante");
Body[] allBodys = {samh, Aegir, Rocinante};
Body wgs = new Body(0, 0, 3, 5, 1, "wgs");
System.out.println(samh.calcDistance(Aegir));
System.out.println(samh.calcForceExertedBy(Rocinante));
System.out.println(samh.calcForceExertedByX(Rocinante));
System.out.println(samh.calcNetForceExertedByX(allBodys));
wgs.update(1, -5, -2);
System.out.println(wgs.xxPos);
System.out.println(wgs.yyPos);
System.out.println(wgs.xxVel);
System.out.println(wgs.yyVel);
System.out.println(NBody.readRadius("./data/planets.txt"));
System.out.println(NBody.readBodies("./data/planets.txt"));
}
}