// Atan2 returns the arc tangent of y/x, using // the signs of the two to determine the quadrant // of the return value. // // Special cases are (in order): // // Atan2(y, NaN) = NaN // Atan2(NaN, x) = NaN // Atan2(+0, x>=0) = +0 // Atan2(-0, x>=0) = -0 // Atan2(+0, x<=-0) = +Pi // Atan2(-0, x<=-0) = -Pi // Atan2(y>0, 0) = +Pi/2 // Atan2(y<0, 0) = -Pi/2 // Atan2(+Inf, +Inf) = +Pi/4 // Atan2(-Inf, +Inf) = -Pi/4 // Atan2(+Inf, -Inf) = 3Pi/4 // Atan2(-Inf, -Inf) = -3Pi/4 // Atan2(y, +Inf) = 0 // Atan2(y>0, -Inf) = +Pi // Atan2(y<0, -Inf) = -Pi // Atan2(+Inf, x) = +Pi/2 // Atan2(-Inf, x) = -Pi/2 func Atan2(y, x float64) float64 { … } func atan2(y, x float64) float64 { … }