| 82 | } |
| 83 | |
| 84 | pair<float, Direction> getAngleSide(float angle, bool ccRotation) { |
| 85 | angle = constrainAngle(angle); |
| 86 | Direction direction = Direction::Right; |
| 87 | if (angle > Constants::pi / 2) { |
| 88 | direction = Direction::Left; |
| 89 | angle = Constants::pi - angle; |
| 90 | } else if (angle < -Constants::pi / 2) { |
| 91 | direction = Direction::Left; |
| 92 | angle = -Constants::pi - angle; |
| 93 | } |
| 94 | |
| 95 | if (direction == Direction::Left && ccRotation) |
| 96 | angle *= -1; |
| 97 | |
| 98 | return make_pair(angle, direction); |
| 99 | } |
| 100 | |
| 101 | } |
no test coverage detected