Block: Atan2



PIC




Inports


y



x






Outports


Out

Result of atan2(y/x)




Description:

Computation of the angle between the inputs x and y.

Calculation:

       (        (y)
       |||| arctan (x)      x >  0
       ||| arctan  yx  + π  x <  0,y ≥ 0
       |{ arctan (y) - π  x <  0,y < 0
Out  =     π     x
       ||| + 2             x =  0,y > 0
       ||| - π             x =  0,y < 0
       ||(   2
         0               x =  0,y = 0

Implementations:
FiP8 8 Bit Fixed Point Implementation
FiP16 16 Bit Fixed Point Implementation
FiP32 32 Bit Fixed Point Implementation
Float32 32 Bit Floating Point Implementation
Float64 64 Bit Floating Point Implementation

Implementation: FiP8


8 Bit Fixed Point Implementation



Inports Data Type


y

int8



x

int8






Outports Data Type


Out

int8




Implementation: FiP16


16 Bit Fixed Point Implementation



Inports Data Type


y

int16



x

int16






Outports Data Type


Out

int16




Implementation: FiP32


32 Bit Fixed Point Implementation



Inports Data Type


y

int32



x

int32






Outports Data Type


Out

int32




Implementation: Float32


32 Bit Floating Point Implementation



Inports Data Type


y

float32



x

float32






Outports Data Type


Out

float32




Implementation: Float64


64 Bit Floating Point Implementation



Inports Data Type


y

float64



x

float64






Outports Data Type


Out

float64