```
delta_angle[delta_angle < -np.pi] += 2 * np.pi
delta_angle[delta_angle > np.pi] -= 2 * np.pi
```

This seems inefficient. Is there a more direct and efficient way?

```
delta_angle[delta_angle < -np.pi] += 2 * np.pi
delta_angle[delta_angle > np.pi] -= 2 * np.pi
```

This seems inefficient. Is there a more direct and efficient way?