diff --git a/cell.cpp b/cell.cpp index 7cc2c329..4bf4dcbc 100644 --- a/cell.cpp +++ b/cell.cpp @@ -511,7 +511,7 @@ EX int celldistAlt(cell *c) { return celldist(c) - 3; } #if MAXMDIM >= 4 - if(euc::in(3)) return euc::dist_alt(c); + if(euc::in()) return euc::dist_alt(c); if(hyperbolic && WDIM == 3 && !reg3::in_rule()) return reg3::altdist(c->master); #endif diff --git a/euclid.cpp b/euclid.cpp index ed6053a3..8446b7f4 100644 --- a/euclid.cpp +++ b/euclid.cpp @@ -339,6 +339,10 @@ EX namespace euc { } EX int dist_alt(cell *c) { + if(WDIM == 2) { + auto v = full_coords2(c); + return euclidAlt(v.first, v.second); + } if(specialland == laCamelot) return dist_relative(c) + roundTableRadius(c); auto v = cubemap()->ispacemap[c->master]; if(S7 == 6) return v[2]; @@ -391,8 +395,10 @@ EX namespace euc { } } - EX int celldistance(cell *c1, cell *c2) { + EX int celldistance(cell *c1, cell *c2) { auto cm = cubemap(); + if(GDIM == 2) + return dist(full_coords2(c1), full_coords2(c2)); return celldistance(basic_canonicalize(cm->ispacemap[c1->master] - cm->ispacemap[c2->master])); }