1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-11-10 02:33:00 +00:00

precision argument for parallel_transport, and reducing it when used many times

This commit is contained in:
Zeno Rogue
2019-10-06 11:56:19 +02:00
parent 54487eb6f3
commit cd04b3f8e8
2 changed files with 8 additions and 8 deletions

View File

@@ -996,13 +996,13 @@ EX bool asign(ld y1, ld y2) { return signum(y1) != signum(y2); }
EX ld xcross(ld x1, ld y1, ld x2, ld y2) { return x1 + (x2 - x1) * y1 / (y1 - y2); }
EX transmatrix parallel_transport(const transmatrix Position, const transmatrix& ori, const hyperpoint direction) {
EX transmatrix parallel_transport(const transmatrix Position, const transmatrix& ori, const hyperpoint direction, int precision IS(100)) {
if(nonisotropic) return nisot::parallel_transport(Position, direction);
else if(prod) {
hyperpoint h = product::direct_exp(ori * direction);
return Position * rgpushxto0(h);
}
else return Position * rgpushxto0(direct_exp(direction, 100));
else return Position * rgpushxto0(direct_exp(direction, precision));
}
EX void apply_parallel_transport(transmatrix& Position, const transmatrix orientation, const hyperpoint direction) {