Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Account for implementation of modulo
In C++, the % operator, which is normally the modulo operator, is actually implemented as a division remainder function, which is subtly different. In mathematics, both functions would return the same thing, i.e. the remainder of the division of two numbers. However, while the remainder in modular arithmetic is always (taken as) positive, the remainder in division can be negative if either the dividend or divisor is negative. Since there is currently no scenario in which physicalAngle should naturally become negative, the solution chosen has been to add 270 degrees to physicalAngle, instead of subtracting 90 degrees (due to the rotation of the simulator).
- Loading branch information