03.08.2013 Views

Embedded Software and Motor Control Libraries for PXR40xx

Embedded Software and Motor Control Libraries for PXR40xx

Embedded Software and Motor Control Libraries for PXR40xx

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

4.81 Function GFLIB_Sin_FLT<br />

This function implements polynomial approximation of sine function.<br />

4.81.1 Declaration<br />

tFloat GFLIB_Sin_FLT(tFloat fltIn, const GFLIB_SIN_T_FLT *const pParam);<br />

4.81.2 Arguments<br />

Table 4-102. GFLIB_Sin_FLT arguments<br />

Type Name Direction Description<br />

tFloat fltIn input Input argument is a single precision floating point number that<br />

contains an angle in radians between [- π, π].<br />

const<br />

GFLIB_SIN_T_FLT<br />

*const<br />

4.81.3 Return<br />

pParam input Pointer to an array of approximation coefficients.<br />

The function returns the sine of the input argument as a single precision floating point<br />

number.<br />

4.81.4 Description<br />

The GFLIB_Sin_FLT function provides a computational method <strong>for</strong> the calculation of a<br />

st<strong>and</strong>ard trigonometric sine function sin(x), using the floating point optimized minimax<br />

polynomial approximation. The following equation describes the chosen approach of<br />

calculating the sine function:<br />

where fltIn is the input angle.<br />

Equation GFLIB_Sin_Eq1<br />

Equation GFLIB_Sin_Eq1 can be rewritten into the following <strong>for</strong>m:<br />

<strong>Embedded</strong> <strong>Software</strong> <strong>and</strong> <strong>Motor</strong> <strong>Control</strong> <strong>Libraries</strong> <strong>for</strong> <strong>PXR40xx</strong>, Rev. 1.0<br />

Chapter 4 API References<br />

Freescale Semiconductor, Inc. 409

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!