Deal with negative rotation
Optim, compute the positive index when needed.