mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-02-24 15:00:14 +00:00
ODS fixup
This commit is contained in:
parent
a6c01a2e96
commit
aff0f4a69e
@ -1167,4 +1167,18 @@ EX hyperpoint lp_apply(const hyperpoint h) {
|
||||
|
||||
EX hyperpoint smalltangent() { return xtangent(.1); }
|
||||
|
||||
EX void cyclefix(ld& a, ld b) {
|
||||
while(a > b + M_PI) a -= 2 * M_PI;
|
||||
while(a < b - M_PI) a += 2 * M_PI;
|
||||
}
|
||||
|
||||
EX ld raddif(ld a, ld b) {
|
||||
ld d = a-b;
|
||||
if(d < 0) d = -d;
|
||||
if(d > 2*M_PI) d -= 2*M_PI;
|
||||
if(d > M_PI) d = 2 * M_PI-d;
|
||||
return d;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user