1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-10-31 22:12:59 +00:00

ru:: using struct xy instead of ld pair

This commit is contained in:
Zeno Rogue
2025-05-03 00:09:49 +02:00
parent 4ff77aa64e
commit 49257338ee
10 changed files with 156 additions and 148 deletions

View File

@@ -20,7 +20,10 @@ hyperpoint to_hyper(ld x, ld y) {
return perspective_to_space(h, 1, gcHyperbolic);
}
pair<ld, ld> from_hyper(hyperpoint h) {
hyperpoint to_hyper(xy xy) { return to_hyper(xy.x, xy.y); }
xy from_hyper(hyperpoint h) {
if(non_hyperbolic) return {h[0], h[1]};
h = spin90() * h; h[0] = -h[0];
h[2] += 1;