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.

4.36 Function GFLIB_AtanYX_FLT<br />

The function calculates the angle between the positive x-axis <strong>and</strong> the direction of a vector<br />

given by the (x, y) coordinates.<br />

4.36.1 Declaration<br />

tFloat GFLIB_AtanYX_FLT(tFloat fltInY, tFloat fltInX);<br />

4.36.2 Arguments<br />

Table 4-46. GFLIB_AtanYX_FLT arguments<br />

Type Name Direction Description<br />

tFloat fltInY input The ordinate of the input vector (y coordinate).<br />

tFloat fltInX input The abscissa of the input vector (x coordinate).<br />

4.36.3 Return<br />

The function returns the angle between the positive x-axis of a plane <strong>and</strong> the direction of<br />

the vector given by the x <strong>and</strong> y coordinates provided as parameters.<br />

4.36.4 Description<br />

Chapter 4 API References<br />

The function returns the angle between the positive x-axis of a plane <strong>and</strong> the direction of<br />

the vector given by the x <strong>and</strong> y coordinates provided as parameters. The first parameter,<br />

fltInY, is the ordinate (the y coordinate) <strong>and</strong> the second one, fltInX, is the abscissa (the x<br />

coordinate).<br />

Both the input parameters are assumed to be in the single precision floating point range<br />

of (-2 128 , 2 128 ). The computed angle is in the range of [- π, π]. The counter-clockwise<br />

direction is assumed to be positive, <strong>and</strong> thus a positive angle will be computed if the<br />

provided ordinate (fltInY) is positive. Similarly, a negative angle will be computed <strong>for</strong><br />

the negative ordinate. The calculations are per<strong>for</strong>med in a few steps.<br />

In the first step, the angle is positioned within the correct half-quarter of the<br />

circumference of a circle, <strong>and</strong> if necessary the final angle addition is prepared or the sign<br />

of the input value is corrected.<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. 251

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

Saved successfully!

Ooh no, something went wrong!