1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-11-04 15:53:00 +00:00

ODS projection now works in Euclidean and hyperbolic

This commit is contained in:
Zeno Rogue
2018-05-15 23:29:44 +02:00
parent 6a7a150028
commit 0197063fb6
2 changed files with 59 additions and 16 deletions

View File

@@ -84,6 +84,33 @@ ld cos_auto(ld x) {
}
}
ld tan_auto(ld x) {
switch(cgclass) {
case gcEuclid: return x;
case gcHyperbolic: return tanh(x);
case gcSphere: return tan(x);
default: return 1;
}
}
ld atan_auto(ld x) {
switch(cgclass) {
case gcEuclid: return x;
case gcHyperbolic: return atanh(x);
case gcSphere: return atan(x);
default: return 1;
}
}
ld atan2_auto(ld y, ld x) {
switch(cgclass) {
case gcEuclid: return y/x;
case gcHyperbolic: return atanh(y/x);
case gcSphere: return atan2(y, x);
default: return 1;
}
}
// hyperbolic point:
//===================