Closed amdrexu closed 11 months ago
When y = 0 and x < 0, we must decide the final result according the sign of y. If y = -0.0, the result is -PI. If y = 0.0, the result is PI. This could be simplified as follow:
atan2(y, x) = copysign(PI, y) when y = 0 and x < 0
When y = 0 and x < 0, we must decide the final result according the sign of y. If y = -0.0, the result is -PI. If y = 0.0, the result is PI. This could be simplified as follow:
atan2(y, x) = copysign(PI, y) when y = 0 and x < 0