1.4.4.60 SinInDegs Function

fract_q0d15_t SinInDegs( fract_q9d6_t theta );

Summary

Calculates fixed point Sin(theta) (Q0.15 fixed point), where theta is in degrees (Q8.6 fixed point)

Description

Calculates fixed point Sin(theta) (Q0.15 fixed point), where theta is in degrees (Q8.6 fixed point)

Preconditions

None

Parameters

theta Q9.6 fixed point angle

Returns

sin(theta) in Q0.15 fixed point

Remarks

None.

Example

int32_t nTests = 400;

float theta;

float delta_theta = 360.0/(nTests-1);

float theta0 = 0;

int32_t i;

int32_t x;

for ( i = 0; i < nTests; i++ )

{

theta = theta0 + i*delta_theta;

x = theta*(32768/512); _//Q9.6_

printf("%d, %d rn",( int )x,SinInDegs(x)));

}

C

fract_q0d15_t SinInDegs (fract_q9d6_t theta );