1.4.3.23 _LIBQ_Q31_sin_Q2_29 Function

Calculates the value of sine(x).

Description

_Q31 _LIBQ_Q31_sin_Q2_29 (_Q2_29 x);

Calculates the sine(x), where x is of type _Q2_29 radians and the resulting value is of type _Q31.

Preconditions

None.

Parameters

x The _Q2_29 input value from which to calculate sine(x).

Returns

_LIBQ_Q31_sin_Q2_29 returns the _Q31 fixed point result from the calculation sine(x).

Remarks

Execution Time (cycles): 246 typical (244 to 266)

Program Memory 598 bytes

Error <= 0.00000000047 (accurate to least significant _Q31 bit)

Example

_Q31 resultSin;

resultSin = _LIBQ_Q31_sin_Q2_29 ((_Q2_29)0x5a637cfe); 

_// _LIBQ_Q31_sin_Q2_29( 2.824644562) =_ _0.311668121 (0x27e4bdb1)_

C

_Q31 _LIBQ_Q31_sin_Q2_29 (_Q2_29 x );