diff --git a/geometry2.cpp b/geometry2.cpp index 1889a7c9..ed120738 100644 --- a/geometry2.cpp +++ b/geometry2.cpp @@ -215,8 +215,10 @@ struct horo_distance { b = intval(h1, C0); a = abs(binary::horo_level(h1)); } - else #endif + else if(hybri) + a = 0, b = hdist(h1, C0); + else a = 0, b = intval(h1, C0); } @@ -227,6 +229,8 @@ struct horo_distance { if(binarytiling) become(inverse(T) * h1); else #endif + if(sol || hybri) become(inverse(T) * h1); + else a = 0, b = intval(h1, tC0(T)); } bool operator < (const horo_distance z) { diff --git a/hyperpoint.cpp b/hyperpoint.cpp index 77f468e1..e97a3b79 100644 --- a/hyperpoint.cpp +++ b/hyperpoint.cpp @@ -305,11 +305,11 @@ EX ld edge_of_triangle_with_angles(ld alpha, ld beta, ld gamma) { } hyperpoint hpxy(ld x, ld y) { - return hpxyz(x,y, translatable ? 1 : sphere ? sqrt(1-x*x-y*y) : sqrt(1+x*x+y*y)); + return hpxyz(x,y, sl2 ? sqrt(1+x*x+y*y) : translatable ? 1 : sphere ? sqrt(1-x*x-y*y) : sqrt(1+x*x+y*y)); } hyperpoint hpxy3(ld x, ld y, ld z) { - return hpxyz3(x,y,z, translatable ? 1 : sphere ? sqrt(1-x*x-y*y-z*z) : sqrt(1+x*x+y*y+z*z)); + return hpxyz3(x,y,z, sl2 ? sqrt(1+x*x+y*y-z*z) :translatable ? 1 : sphere ? sqrt(1-x*x-y*y-z*z) : sqrt(1+x*x+y*y+z*z)); } // a point (I hope this number needs no comments ;) ) @@ -874,6 +874,8 @@ EX ld hdist(const hyperpoint& h1, const hyperpoint& h2) { auto d2 = product_decompose(h2); return hypot(PIU(hdist(d1.second, d2.second)), d1.first - d2.first); } + case gcSL2: + return hdist0(inverse(slr::translate(h1)) * h2); default: if(iv < 0) return 0; return sqrt(iv); diff --git a/nonisotropic.cpp b/nonisotropic.cpp index aace0949..e42adadf 100644 --- a/nonisotropic.cpp +++ b/nonisotropic.cpp @@ -1039,6 +1039,7 @@ EX namespace slr { struct hrmap_psl2 : hybrid::hrmap_hybrid { virtual transmatrix relative_matrix(cell *c2, cell *c1, const struct hyperpoint& point_hint) override { + if(c1 == c2) return Id; for(int i=0; itype; i++) if(c1->move(i) == c2) return adjmatrix(i, c1->c.spin(i)); if(gmatrix0.count(c2) && gmatrix0.count(c1)) return inverse(gmatrix0[c1]) * gmatrix0[c2];