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

improvements in the two-point model on the sphere

This commit is contained in:
Zeno Rogue
2018-04-21 12:18:33 +02:00
parent abbf536466
commit 323893094f
4 changed files with 104 additions and 39 deletions

View File

@@ -66,6 +66,15 @@ ld asin_auto(ld x) {
}
}
ld asin_auto_clamp(ld x) {
switch(cgclass) {
case gcEuclid: return x;
case gcHyperbolic: return asinh(x);
case gcSphere: return x>1 ? M_PI/2 : x<-1 ? -M_PI/2 : isnan(x) ? 0 : asin(x);
default: return x;
}
}
ld cos_auto(ld x) {
switch(cgclass) {
case gcEuclid: return 1;