Clamping values before calling acos