Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static byte[][] populatePoints(){
- byte[][] quadrant;
- Double[] radii;
- List<byte[]> templist = new ArrayList<byte[]>();
- List<Double> tempRadii = new ArrayList<Double>();
- Cruncher sort = new Cruncher();
- for (byte z = (byte) -size; z < size; z++)
- for (byte y = (byte) -size; y < size; y++)
- for (byte x = (byte) -size; x < size; x++) {
- double radSq = (double)(x*x+y*y+z*z);
- if(radSq>size*size)
- continue;
- templist.add(new byte[] {x,y,z});
- tempRadii.add(radSq);
- }
- quadrant = templist.toArray(new byte[0][0]);
- radii = tempRadii.toArray(new Double[0]);
- templist.clear();
- tempRadii.clear();
- sort.sort2(radii, quadrant);
- radii = sort.set1;
- quadrant = sort.set11;
- sort.set1 = null;
- sort.set11 = null;
- return quadrant;
- }
Advertisement
Add Comment
Please, Sign In to add comment