1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-12-19 04:18:06 +00:00

better distance approximation in Nil

This commit is contained in:
Zeno Rogue
2019-10-06 11:51:10 +02:00
parent 69d0284745
commit e38e001454
2 changed files with 5 additions and 1 deletions

View File

@@ -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);
}