NMSIS-DSP  Version 1.2.0
NMSIS DSP Software Library

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. More...

Functions

riscv_status riscv_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...
 
riscv_status riscv_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...
 
riscv_status riscv_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...
 
riscv_status riscv_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...
 

Detailed 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

◆ riscv_atan2_f16()

riscv_status riscv_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.

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.

◆ riscv_atan2_f32()

riscv_status riscv_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.

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.

◆ riscv_atan2_q15()

riscv_status riscv_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.

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.

◆ riscv_atan2_q31()

riscv_status riscv_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.

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.