mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-11-12 03:33:00 +00:00
fixes to parabolic
This commit is contained in:
@@ -728,7 +728,7 @@ EX transmatrix parabolic1(ld u) {
|
||||
|
||||
EX transmatrix parabolic13(ld u, ld v) {
|
||||
if(euclid)
|
||||
return ypush(u);
|
||||
return eupush3(0, u, v);
|
||||
else {
|
||||
ld diag = (u*u+v*v)/2;
|
||||
return matrix4(
|
||||
@@ -740,27 +740,21 @@ EX transmatrix parabolic13(ld u, ld v) {
|
||||
}
|
||||
}
|
||||
|
||||
EX hyperpoint parabolic10(hyperpoint h) {
|
||||
if(euclid) { h[LDIM] = 1; return h; }
|
||||
else if(MDIM == 4) return hyperpoint(sinh(h[0]), h[1]/exp(h[0]), h[2]/exp(h[0]), cosh(h[0]));
|
||||
else return hyperpoint(sinh(h[0]), h[1]/exp(h[0]), cosh(h[0]), 0);
|
||||
}
|
||||
|
||||
EX hyperpoint deparabolic10(const hyperpoint h) {
|
||||
if(euclid) return h;
|
||||
ld x = -log(h[LDIM] - h[0]);
|
||||
if(MDIM == 3) return hyperpoint(x, h[1] * exp(x), 1, 0);
|
||||
return point31(x, h[1] * exp(x), h[2] * exp(x));
|
||||
}
|
||||
|
||||
/** this looks correct */
|
||||
EX hyperpoint deparabolic13(hyperpoint h) {
|
||||
h /= (1 + h[3]);
|
||||
hyperpoint one = point3(1,0,0);
|
||||
h -= one;
|
||||
h /= sqhypot_d(3, h);
|
||||
if(euclid) return h;
|
||||
h /= (1 + h[LDIM]);
|
||||
h[0] -= 1;
|
||||
h /= sqhypot_d(LDIM, h);
|
||||
h[0] += .5;
|
||||
return point3(log(2) + log(-h[0]), h[1] * 2, h[2] * 2);
|
||||
return point3(log(2) + log(-h[0]), h[1] * 2, LDIM==3 ? h[2] * 2 : 0);
|
||||
}
|
||||
|
||||
EX hyperpoint parabolic13(hyperpoint h) {
|
||||
if(euclid) return h;
|
||||
else if(LDIM == 3)
|
||||
return parabolic13(h[1], h[2]) * xpush0(h[0]);
|
||||
else
|
||||
return parabolic1(h[1]) * xpush0(h[0]);
|
||||
}
|
||||
|
||||
EX transmatrix spintoc(const hyperpoint& H, int t, int f) {
|
||||
|
||||
Reference in New Issue
Block a user