CMSIS-DSP  
CMSIS DSP Software Library

Functions

arm_status arm_atan2_f16 (float16_t y, float16_t x, float16_t *result)
 Arc Tangent of y/x using sign of y and x to get right quadrant. More...
 
arm_status arm_atan2_f32 (float32_t y, float32_t x, float32_t *result)
 Arc Tangent of y/x using sign of y and x to get right quadrant. More...
 
arm_status arm_atan2_q15 (q15_t y, q15_t x, q15_t *result)
 Arc Tangent of y/x using sign of y and x to get right quadrant. More...
 
arm_status arm_atan2_q31 (q31_t y, q31_t x, q31_t *result)
 Arc Tangent of y/x using sign of y and x to get right quadrant. More...
 

Description

Computing Arc tangent only using the ratio y/x is not enough to determine the angle since there is an indeterminacy. Opposite quadrants are giving the same ratio.

ArcTan2 is not using y/x to compute the angle but y and x and use the sign of y and x to determine the quadrant.

Function Documentation

◆ arm_atan2_f16()

arm_status arm_atan2_f16 ( float16_t  y,
float16_t  x,
float16_t *  result 
)

Arc tangent in radian of y/x using sign of x and y to determine right quadrant.

Parameters
[in]yy coordinate
[in]xx coordinate
[out]resultResult
Returns
error status.
Compute the Arc tangent of y/x:
The sign of y and x are used to determine the right quadrant and compute the right angle.

◆ arm_atan2_f32()

arm_status arm_atan2_f32 ( float32_t  y,
float32_t  x,
float32_t result 
)

Arc tangent in radian of y/x using sign of x and y to determine right quadrant.

Parameters
[in]yy coordinate
[in]xx coordinate
[out]resultResult
Returns
error status.
Compute the Arc tangent of y/x:
The sign of y and x are used to determine the right quadrant and compute the right angle.

◆ arm_atan2_q15()

arm_status arm_atan2_q15 ( q15_t  y,
q15_t  x,
q15_t result 
)

Arc tangent in radian of y/x using sign of x and y to determine right quadrant.

Parameters
[in]yy coordinate
[in]xx coordinate
[out]resultResult in Q2.13
Returns
error status.
Compute the Arc tangent of y/x:
The sign of y and x are used to determine the right quadrant and compute the right angle.

◆ arm_atan2_q31()

arm_status arm_atan2_q31 ( q31_t  y,
q31_t  x,
q31_t result 
)

Arc tangent in radian of y/x using sign of x and y to determine right quadrant.

Parameters
[in]yy coordinate
[in]xx coordinate
[out]resultResult in Q2.29
Returns
error status.
Compute the Arc tangent of y/x:
The sign of y and x are used to determine the right quadrant and compute the right angle.