1.4.3.2 _LIBQ_Q15_sin_Q2_13 Function

Calculates the value of sine(x).

Description

_Q15 _LIBQ_Q15_sin_Q2_13 (_Q2_13 x);

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

Preconditions

None.

Parameters

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

Returns

_LIBQ_Q15_sin_Q2_13 returns the _Q15 fixed point result from the calculation sine(x).

Remarks

Execution Time (cycles): 100 typical (100 to 102)

Program Memory 220 bytes

Error <= 0.00003052 (accurate to least significant _Q15 bit)

Example

_Q15 resultSin;

resultSin = _LIBQ_Q15_sin_Q2_13 ((_Q2_13)0x4093); 

_// _LIBQ_Q15_sin_Q2_13(2.017944) = 0.901672_ _(0x736a)_

C

_Q15 _LIBQ_Q15_sin_Q2_13 (_Q2_13 x );