From 1962900ce0df89b76c1d5a3f235c1cc890bf3e62 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Thu, 16 Jan 2020 15:14:28 +0100 Subject: [PATCH] fixup nonisotropic.cpp --- nonisotropic.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/nonisotropic.cpp b/nonisotropic.cpp index 6a6b1a16..e32366e3 100644 --- a/nonisotropic.cpp +++ b/nonisotropic.cpp @@ -225,6 +225,7 @@ EX namespace sn { // Poincare to azimuthal equidistant ld hr = sqhypot_d(3, x); if(hr == 0) return point3(0,0,0); + if(hr >= 1) return x * 60; ld hz = (1 + hr) / (1 - hr); ld d = (hz+1) * acosh(hz) / sinh(acosh(hz)); return x * d; @@ -513,12 +514,12 @@ EX namespace sn { " }" "float z_to_iz_s(float z) {" - "return sinh(z) / (1 + cosh(z));" + "return sinh(z) / (1. + cosh(z));" "}" "float z_to_iz_ns(float z) {" - "z = sinh(z) / (1 + cosh(z));" - "return (z+1)/2;" + "z = sinh(z) / (1. + cosh(z));" + "return (z+1.)/2.;" "}"; hyperpoint christoffel(const hyperpoint at, const hyperpoint velocity, const hyperpoint transported) { @@ -665,7 +666,7 @@ EX namespace sn { "float ix = h[0] >= 0. ? x_to_ix(h[0]) : x_to_ix(-h[0]);" "float iy = h[1] >= 0. ? x_to_ix(h[1]) : x_to_ix(-h[1]);" - "float iz = (tanh(h[2]/4.)+1.) / 2.;" + "float iz = z_to_iz_ns(h[2]);" "vec4 res;"