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:

       ( arctan (y)      x > 0
       ||||       (xy)
       ||| arctan  x  + π  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


Name FiP8
ID 4880
Revision 1.0
C filename Atan2_FiP8.c
H filename Atan2_FiP8.h

8 Bit Fixed Point Implementation

Data Structure:

typedef struct { 
     uint16        ID; 
     int8          *y; 
     int8          *x; 
     int8          Out; 
} ATAN2_FIP8;

Implementation: FiP16


Name FiP16
ID 4881
Revision 1.0
C filename Atan2_FiP16.c
H filename Atan2_FiP16.h

16 Bit Fixed Point Implementation

Data Structure:

typedef struct { 
     uint16        ID; 
     int16         *y; 
     int16         *x; 
     int16         Out; 
} ATAN2_FIP16;

Implementation: FiP32


Name FiP32
ID 4882
Revision 1.0
C filename Atan2_FiP32.c
H filename Atan2_FiP32.h

32 Bit Fixed Point Implementation

Data Structure:

typedef struct { 
     uint16        ID; 
     int32         *y; 
     int32         *x; 
     int32         Out; 
} ATAN2_FIP32;

Implementation: Float32


Name Float32
ID 4883
Revision 0.1
C filename Atan2_Float32.c
H filename Atan2_Float32.h

32 Bit Floating Point Implementation

Data Structure:

typedef struct { 
     uint16        ID; 
     float32       *y; 
     float32       *x; 
     float32       Out; 
} ATAN2_FLOAT32;

Implementation: Float64


Name Float64
ID 4884
Revision 0.1
C filename Atan2_Float64.c
H filename Atan2_Float64.h

64 Bit Floating Point Implementation

Data Structure:

typedef struct { 
     uint16        ID; 
     float64       *y; 
     float64       *x; 
     float64       Out; 
} ATAN2_FLOAT64;