Reset platonic code.
[voro++.git] / trunk / zeo / images.cc
blobce5565d24aefd92cc0686e423a86c86c47c6ee81
1 #include <cstdio>
2 #include <cstdlib>
3 #include <cmath>
4 using namespace std;
6 #include "unitcell.hh"
7 using namespace voro;
9 int main(int argc,char **argv) {
10 unsigned int i,j;
11 vector<int> vi;
12 vector<double> vd;
14 // Check the command line syntax
15 if(argc!=7) {
16 fprintf(stderr,"Syntax: ./images bx bxy by bxz byz bz\n");
17 return VOROPP_CMD_LINE_ERROR;
20 // Create the unit cell
21 unitcell uc(atof(argv[1]),atof(argv[2]),atof(argv[3]),atof(argv[4]),atof(argv[5]),atof(argv[6]));
23 // Calculate the images
24 uc.images(vi,vd);
26 // Print the output
27 for(i=j=0;i<vd.size();i++,j+=3) printf("%d %d %d %g\n",vi[j],vi[j+1],vi[j+2],vd[i]);