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.86.1 Declaration<br />

tFrac16 GFLIB_Tan_F16(tFrac16 f16In, const GFLIB_TAN_T_F16 *const pParam);<br />

4.86.2 Arguments<br />

Table 4-109. GFLIB_Tan_F16 arguments<br />

Type Name Direction Description<br />

tFrac16 f16In input Input argument is a 16-bit number that contains an angle in<br />

radians between [- π, π) normalized between [-1, 1).<br />

const<br />

GFLIB_TAN_T_F16<br />

*const<br />

4.86.3 Return<br />

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

The function returns tan( π * f16In) as a fixed point 16-bit number, normalized between<br />

[-1, 1).<br />

4.86.4 Description<br />

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

st<strong>and</strong>ard trigonometric tangent function tan(x), using the piece-wise polynomial<br />

approximation. Function tan(x) takes an angle <strong>and</strong> returns the ratio 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. There<strong>for</strong>e, the tangent function is defined by:<br />

Equation GFLIB_Tan_Eq1<br />

Chapter 4 API References<br />

Because both sin(x) <strong>and</strong> cos(x) are defined on interval [- π, π), function tan(x) is equal to<br />

zero when sin(x)=0 <strong>and</strong> is equal to infinity when cos(x)=0. There<strong>for</strong>e, the tangent<br />

function has asymptotes at n* π/2 <strong>for</strong> n= , , ... The graph of tan(x) is shown in Figure<br />

4-42.<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. 425

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

Saved successfully!

Ooh no, something went wrong!