diff --git a/geom-exp.cpp b/geom-exp.cpp index a9a179eb..dbd489a2 100644 --- a/geom-exp.cpp +++ b/geom-exp.cpp @@ -843,7 +843,7 @@ EX void showEuclideanMenu() { XLAT( "Stretch the metric along the fibers. This can currently be done in rotation spaces and in 8-cell, 24-cell and 120-cell. " "Value of 0 means not stretched, -1 means S2xE or H2xE (works only in the limit). " - "Only the raycaster is implemented for stretched geometry, so you will see only walls." + "Only the raycaster is implemented for stretched geometry, so you will see only walls. (Must be > -1)" ) ); dialog::reaction = ray::reset_raycaster; diff --git a/nonisotropic.cpp b/nonisotropic.cpp index 59ea8ce9..4acb1139 100644 --- a/nonisotropic.cpp +++ b/nonisotropic.cpp @@ -2082,12 +2082,20 @@ EX namespace stretch { return translate(at) * vel; } + EX ld squared() { + return abs(1 + factor); + } + + EX ld not_squared() { + return sqrt(squared()); + } + hyperpoint isometric_to_actual(const hyperpoint at, const hyperpoint velocity) { - return mulz(at, velocity, 1/sqrt(1+factor)); + return mulz(at, velocity, 1/not_squared()); } hyperpoint actual_to_isometric(const hyperpoint at, const hyperpoint velocity) { - return mulz(at, velocity, sqrt(1+factor)); + return mulz(at, velocity, not_squared()); } hyperpoint christoffel(const hyperpoint at, const hyperpoint velocity, const hyperpoint transported) { @@ -2227,7 +2235,7 @@ EX namespace nisot { auto fix = [&] (hyperpoint& h, ld& m) { h = stretch::itranslate(at) * h; h[3] = 0; - ld m1 = h[0] * h[0] + h[1] * h[1] + h[2] * h[2] * (1 + stretch::factor); + ld m1 = h[0] * h[0] + h[1] * h[1] + h[2] * h[2] * stretch::squared(); h /= sqrt(m1/m); h = stretch::translate(at) * h; };