diff --git a/archimedean.cpp b/archimedean.cpp index e76a54b7..042b58b2 100644 --- a/archimedean.cpp +++ b/archimedean.cpp @@ -64,6 +64,7 @@ struct archimedean_tiling { int support_football(); bool support_chessboard(); void regroup(); + string world_size(); ld scale(); }; @@ -891,7 +892,7 @@ vector > samples = { {"(2,2)", cWeird}, {"(2,2,2,2,2,2)", cWeird}, {"(6,6,2)", cWeird}, - {"(6,6,2,2)", cWeird}, + {"(6,2,6,2)", cWeird}, }; int lastsample = 0; @@ -1047,7 +1048,37 @@ void show() { if(doexiton(sym, uni)) popScreen(); }; } - + +string archimedean_tiling::world_size() { + int nom = 2 - N, denom = 2; + for(int f: faces) { + int g = gcd(denom, f); + nom = (nom * f + denom) / g; + denom = denom / g * f; + printf("%d/%d after adding 1/%d\n", nom, denom, f); + } + printf("vertices = %d/%d\n", 2*denom, nom); + int anom = 0, adenom = 1; + for(int f: faces) { + int g = gcd(adenom, f); + anom = (anom * f + adenom) / g; + adenom = adenom / g * f; + printf("%d/%d after adding 1/%d (g=%d)\n", anom, adenom, f, g); + } + anom *= 2 * denom, adenom *= nom; + printf("faces = %d/%d\n", anom, adenom); + int g = gcd(anom, adenom); + anom /= g; adenom /= g; + if(adenom < 0) anom = -anom, adenom = -adenom; + string s; + if(anom < 0) s = "exp(∞)*", anom = -anom; + if(adenom > 1) + s += its(anom) + "/" + its(adenom); + else + s += its(anom); + return s; + } + } } diff --git a/geom-exp.cpp b/geom-exp.cpp index e7ed68bc..8f90d69c 100644 --- a/geom-exp.cpp +++ b/geom-exp.cpp @@ -353,11 +353,11 @@ void showEuclideanMenu() { else if(tq & qSMALL) qstring = ginf[geometry].shortname; dialog::addSelItem(XLAT("quotient space"), XLAT(qstring), 0); - + dialog::addSelItem(XLAT("size of the world"), (archimedean && euclid) ? "∞" : + archimedean ? arcm::current.world_size() : (archimedean && sphere) ? its(isize(currentmap->allcells())) : - (archimedean && hyperbolic) ? "exp(∞)*?" : worldsize < 0 ? "exp(∞)*" + (nom%denom ? its(nom)+"/"+its(-denom) : its(-worldsize)): worldsize == 0 ? "∞" : its(worldsize),