New--> Java
1 package helloworld;
2
3 public class Atom {
4 double x;
5 double y;
6 double z;
7 }
1 package helloworld;
2
3 import java. util {
4
5 public class Helloworld {
6
7 public static void main (String[] args) {
8 // prints ''Hello, World'' to the terminal window.
9 ArrayList<Atom> myatoms = new ArrayList<>();
10 for (int i = 0 ; i < 100; ++i) {
11 Atom a1 = new Atom();
12 a1. x = Math. random()*3;
13 a1. y = Math. random()*3;
14 a1. z = Math. random()*3;
15 myatoms .add(a1);
16 }
17 for (int i = 0; i < maximumstep; ++i) {
calculateForce (myatoms);
}
static yoid calculateForce (ArrayList<Atom> input);{
int size = input.size();
for ( int j =i+1; j < size; ++j ) {
double max_x = 10;
double max_y = 10;
double max_z = 10;
double min_x = -10;
double min_y = -10;
double min_z = -10;
沒有留言:
張貼留言