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.54.2 Arguments<br />

Table 4-70. GFLIB_Cos_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_COS_T_FLT<br />

*const<br />

4.54.3 Return<br />

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

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

number.<br />

4.54.4 Description<br />

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

st<strong>and</strong>ard trigonometric cosine function cos(x), using the floating point optimized<br />

minimax polynomial approximation of the sine function. The following two equations<br />

describe the chosen approach of calculating the sine function:<br />

Equation GFLIB_Cos_Eq1<br />

Equation GFLIB_Cos_Eq2<br />

where a 0 ... a 2 are coefficients of the approximation polynomial.<br />

Equations GFLIB_Cos_Eq1 <strong>and</strong> GFLIB_Cos_Eq2 can be further rewritten into the<br />

following <strong>for</strong>m:<br />

Equation GFLIB_Cos_Eq3<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. 327

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

Saved successfully!

Ooh no, something went wrong!