mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-11 18:00:34 +00:00
better distance approximation in Nil
This commit is contained in:
parent
69d0284745
commit
e38e001454
@ -237,7 +237,7 @@ horo_distance::horo_distance(hyperpoint h1, const transmatrix& T) {
|
||||
if(binarytiling) become(inverse(T) * h1);
|
||||
else
|
||||
#endif
|
||||
if(solnih || hybri) become(inverse(T) * h1);
|
||||
if(solnih || hybri || nil) become(inverse(T) * h1);
|
||||
else
|
||||
a = 0, b = intval(h1, tC0(T));
|
||||
}
|
||||
|
@ -850,6 +850,10 @@ EX ld hdist0(const hyperpoint& mh) {
|
||||
auto phi = atan2(mh[2], mh[3]);
|
||||
return hypot(cosh_r < 1 ? 0 : acosh(cosh_r), phi);
|
||||
}
|
||||
case gcNil: {
|
||||
ld bz = mh[0] * mh[1] / 2;
|
||||
return hypot(mh[0], mh[1]) + abs(mh[2] - bz);
|
||||
}
|
||||
default:
|
||||
return hypot_d(GDIM, mh);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user