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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Table 4-42. GFLIB_Atan_FLT arguments<br />

(continued)<br />

Type Name Direction Description<br />

const<br />

GFLIB_ATAN_T_FLT<br />

*const<br />

4.33.3 Return<br />

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

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

number that contains the angle in radians between (- π/2, π/2).<br />

4.33.4 Description<br />

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

st<strong>and</strong>ard trigonometric arctangent function arctan(x), using the rational polynomial<br />

approximation. Function arctan(x) takes a ratio <strong>and</strong> returns the angle of two sides of a<br />

right-angled triangle. The ratio is the length of the side opposite the angle divided by the<br />

length of the side adjacent to the angle. The graph of arctan(x) is shown in Figure 4-23.<br />

Figure 4-23. Course of the function GFLIB_Atan<br />

Chapter 4 API References<br />

As can be observed from Figure 4-23, the value of the arctan(x) function <strong>for</strong> interval (- ∞,<br />

0) is identical, but with the opposite sign, to the output of the function <strong>for</strong> [0, ∞).<br />

There<strong>for</strong>e, the approximation of the arctangent function over the entire defined range of<br />

input values can be simplified to the approximation <strong>for</strong> a ratio in the range [0, ∞), <strong>and</strong><br />

then, depending on the input sign, the result will be negated.<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 />

Freescale Semiconductor, Inc. 243

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

Saved successfully!

Ooh no, something went wrong!