Matrix hexagon(double xc, double yc, double r=1., double theta=0.) { Matrix hex(2,7); hex(0,0) = xc; hex(1,0) = yc; for(int i=1; i<=6; i++) { double tet = (i-1)*M_PI/3.+theta; hex(0,i) = r*cos(tet)+xc; hex(1,i) = r*sin(tet)+yc; } return hex; } Matrix couche(int num, double r=0.) { if (num <= 0) { Matrix pos(3,1); pos(0,0) = pos(1,0) = pos(2,0) = 0.; return pos; } else { if (r <= 0.0001) r = 5.*num; int n = num*6; double tet0 = 0.; tet0 = M_PI/n; double dtet = M_PI*2./(double)n; Matrix pos(3, n); for(int i=0; i