code: public void transfToOriginCell(Tuple3d[] points, Tuple3d reference) {
  		reference = new Point3d(reference);//clone
  		transfToCrystal(reference);
  
  		int x = (int)Math.floor(reference.x);
  		int y = (int)Math.floor(reference.y);
  		int z = (int)Math.floor(reference.z);
  
  		for( Tuple3d point: points ) {
  			transfToCrystal(point);
  			point.x -= x;
  			point.y -= y;
  			point.z -= z;
  			transfToOrthonormal(point);
  		}
  	}
docs: Converts a set of points so that the reference point falls in the unit cell.
  
  This is useful to transform a whole chain at once, allowing some of the
  atoms to be outside the unit cell, but forcing the centroid to be within it.
  
  @param points A set of points to transform (in orthonormal coordinates)
  @param reference The reference point, which is unmodified but which would
  be in the unit cell were it to have been transformed. It is safe to
  use a member of the points array here.