// Singularity.java class Singularity { Singularity() {exists = false; give = new Velocity(0.0F, 0.0F);} void set(float f, float f1, float f2, int i) { s = f2; id = i; x = f; y = f1; birthday = System.currentTimeMillis(); exists = true; } Velocity V(float f, float f1) { Velocity velocity = give; float f3 = f - x; float f4 = f1 - y; float f2 = f3 * f3 + f4 * f4; switch(id) { default: break; case 1: if(f2 > 0.0F) { velocity.u = (s / f2) * f3; velocity.v = (s / f2) * f4; velocity.inf = false; } else {velocity.inf = true;} break; case 2: if(f2 > 0.0F) { velocity.u = (-s / f2) * f4; velocity.v = ( s / f2) * f3; velocity.inf = false; } else {velocity.inf = true;} break; } return velocity; } float x, y, s; long birthday; int id; boolean exists; Velocity give; }