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:
@@ -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:
|
||||
//===================
|
||||
|
||||
|
||||
Reference in New Issue
Block a user