1.4.3.19 _LIBQ_Q2_29_atan_Q16 Function
Calculates the value of atan(x).
Description
_Q2_29 _LIBQ_Q2_29_atan_Q16 (_Q16 x);
Calculates the atan(x), where x is of type _Q16 and the resulting value is of type _Q2_29. The output value will be radians in the range pi >= result >= -pi.
Preconditions
None.
Parameters
x The _Q16 input value from which to calculate atan(x).
Returns
_LIBQ_Q2_29_atan_Q16 returns the _Q2_29 fixed point result from the calculation atan(x).
Remarks
The function _LIBQ_Q2_29_atan2_Q16 is called by this routine and thus must be linked into the executable image.
Execution Time (cycles): 354 typical (178 to 360)
Program Memory 16 bytes
Error <= 0.000000003 (accurate within one least significant _Q2_29 bit)
Example
_Q2_29 resultAtan; resultAtan = _LIBQ_Q2_29_atan_Q16 ((_Q16)0x00098b31); _// _LIBQ_Q2_29_atan_Q16(9.543716) =_ _1.466396 (0x2eecb7ee)_
C
_Q2_29 _LIBQ_Q2_29_atan_Q16 (_Q16 x );