mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-09-12 15:26:00 +00:00
fixed nmul to use get_half_shift_cycles
This commit is contained in:
@@ -2573,6 +2573,10 @@ EX namespace twist {
|
||||
return floor(shift / TAU + .5) * TAU;
|
||||
}
|
||||
|
||||
EX ld get_half_shift_cycles(ld shift) {
|
||||
return floor(shift / M_PI + .5) * M_PI;
|
||||
}
|
||||
|
||||
EX transmatrix chg_shift(ld x) {
|
||||
return cspin(2, 3, x) * cspin(0, 1, x);
|
||||
}
|
||||
@@ -2580,7 +2584,7 @@ EX namespace twist {
|
||||
/** multiply a SLR-shiftmatrix by a SLR-shiftpoint */
|
||||
EX shiftpoint nmul(const shiftmatrix& T, shiftpoint h) {
|
||||
optimize_shift(h);
|
||||
ld sh = get_shift_cycles(h.shift);
|
||||
ld sh = get_half_shift_cycles(h.shift);
|
||||
h.shift -= sh;
|
||||
auto res0 = T;
|
||||
optimize_shift(res0);
|
||||
@@ -2597,7 +2601,7 @@ EX namespace twist {
|
||||
/** multiply a SLR-shiftmatrix by a SLR-shiftmatrix */
|
||||
EX shiftmatrix nmul(const shiftmatrix& T, shiftmatrix h) {
|
||||
optimize_shift(h);
|
||||
ld sh = get_shift_cycles(h.shift);
|
||||
ld sh = get_half_shift_cycles(h.shift);
|
||||
h.shift -= sh;
|
||||
|
||||
auto res0 = T;
|
||||
|
Reference in New Issue
Block a user