class ATan2

class ATan2

Arc tangent 2 (ATan2) defined as.

\[\begin{split} y_i = \arctan (x_1/x_0) \text{ if } x_0 > 0,\\ y_i = \arctan (x_1/x_0) + \pi \text{ if } x_0 < 0 \text{ and } x_1 \geq 0,\\ y_i = \arctan (x_1/x_0) - \pi \text{ if } x_0 < 0 \text{ and } x_1 < 0,\\ y_i = \pi/2 \text{ if } x_0 = 0 \text{ and } x_1 > 0,\\ y_i = -\pi/2 \text{ if } x_0 = 0 \text{ and } x_1 < 0,\\ y_i = undefined \text{ if } x_0=0 \text{ and } x_1=0 \end{split}\]

Inputs:

  • N-D array.

  • N-D array.

Outputs:

  • N-D array.

Template Parameters:

T – Data type for computation.