public void setSlave(Particle slave) {
        //Moving calculations here
        Particle p2 = this, p1 = slave;
        double p1x = p1.getCenterX(), p2x = p2.getCenterX(), p1y = p1.getCenterY(), p2y = p2.getCenterY();
        double p1v = p1.getV(), p2v = p2.getV(), p1t = p1.getTheta(), p2t = p2.getTheta();
        double p1m = p1.getM(), p2m = p2.getM();
        double dn = Math.sqrt(Math.pow(p1.getCenterX() - p2.getCenterX(), 2) + Math.pow(p1.getCenterY() - p2.getCenterY(), 2));
        p1.toFront();
        p2.toBack();
        double vf = (p1v * p1m + p2v * p2m) / (p1m + p2m);
        double es = p1m * sqr(p1v) / 2 + p2m * sqr(p2v) / 2 - (p1m + p2m) * sqr(vf) / 2;
        p2.setStoredEnergy(es < 0 ? 0 : es);//Energy?
        if (es < 0) System.out.println("!Es=" + es);
        p2.setV(vf); //Conservation of momentum
        p1.setCenterX(p2.getCenterX());
        p1.setCenterY(p2.getCenterY());
        p1.setV(0);


        this.slave = slave;
        slave.setSlaved(true);
    }