#include "../hyper.h" // usage: -viz -geo 1 -canvas i -zoom .2 -shot-1000 -magmashape N // where N = 1, 2, 3, 4 namespace hr { vector> heps; array vertices; int magmashape = 0; int magmacount = 1000; int magmalong = 10; EX transmatrix get_adj(int a, int b) { hyperpoint vl = vertices[a]; hyperpoint vr = vertices[a+1]; hyperpoint vm = mid(vl, vr); transmatrix rm = gpushxto0(vm); hyperpoint xvl = vertices[b]; hyperpoint xvr = vertices[b+1]; hyperpoint xvm = mid(xvl, xvr); transmatrix xrm = gpushxto0(xvm); transmatrix Res = rgpushxto0(vm) * rspintox(rm*vr); Res = Res * spintox(xrm*xvl) * xrm; return Res; } void make() { for(int i=0; i<=7; i++) vertices[i] = spin(2*M_PI*i/7) * xpush0(1); ld xx = vertices[2][0]; vertices[3][0] = 2 * xx - vertices[3][0]; vertices[4][0] = 2 * xx - vertices[4][0]; heps.emplace_back(Id, 0xFFFFFFFF); switch(magmashape) { case 1: for(int i=0; i<13; i++) heps.emplace_back(heps.back().first * get_adj(0, 3), heps.back().second ^ 0xFFFF00); break; case 2: for(int i=0; i<8; i++) heps.emplace_back(heps.back().first * get_adj(3, 0), heps.back().second ^ 0xFFFF00); heps.emplace_back(heps.back().first * get_adj(3, 6), heps.back().second ^ 0xFFFF00); break; case 3: for(int a=0; a<2; a++) { heps.emplace_back(heps.back().first * get_adj(2, 0), heps.back().second ^ 0xFFFF00); for(int i=a; i<8; i++) heps.emplace_back(heps.back().first * get_adj(3, 0), heps.back().second ^ 0xFFFF00); } break; case 4: for(int a=0; a<4; a++) heps.emplace_back(heps.back().first * get_adj(3, 0), heps.back().second ^ 0xFFFF00); heps.emplace_back(heps.back().first * get_adj(3, 1), heps.back().second ^ 0xFFFF00); for(int a=0; a<4; a++) heps.emplace_back(heps.back().first * get_adj(3, 0), heps.back().second ^ 0xFFFF00); break; case 5: for(int a=0; a<6; a++) { heps.emplace_back(heps.back().first * get_adj(3, 0), heps.back().second ^ 0xFFFF00); } for(int b=0; b