Package shape

Examples of shape.XYZVector


      m=mass;
    }

    @Override
    public Particle<XYZVector> create() {
      return new Particle<XYZVector>(new XYZVector(r.nextDouble()*box.x, r.nextDouble()*box.y, r.nextDouble()*box.z), new XYZVector(0d, 0d, 0d), m);
    }
View Full Code Here


    public Particle<XYZVector> create() {
      filled+=Math.pow(box.volume()/nParticles, 1d/box.dimension());
      double xpos=filled%box.x;
      double ypos=((filled-(filled%box.x))/Math.pow(nParticles, 1d/box.dimension()))%box.y; //this would be easier with integers...
      double zpos=(filled-(ypos*box.x)-xpos)/Math.pow(nParticles, 2d/box.dimension());
      return new Particle<XYZVector>(new XYZVector(xpos, ypos, zpos), new XYZVector(Math.random()*2-1, Math.random()*2-1, Math.random()*2-1), m);
    }
View Full Code Here

TOP

Related Classes of shape.XYZVector

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.