1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3
4<head>
5<META http-equiv="Content-Type" content="text/html; charset=utf-8">
6<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 8.0.0.0 for Windows">
7<META http-equiv="Content-Style-Type" content="text/css">
8<title>VEC_Normalize</title>
9<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css">
10</head>
11
12<body>
13
14<h1 align="left">VEC_Normalize <img src="../../image/NTR.gif"align="middle"><img src="../../image/TWL.gif" align="middle"></H1>
15<H2>Syntax</H2>
16
17<dl>
18  <dd>
19<PRE><CODE>#include &lt;nitro/fx/fx_vec.h&gt;
20
21SDK_WEAK_SYMBOL
22void VEC_Normalize(const VecFx32 * pSrc, VecFx32 * pDst);</CODE></PRE>
23  </dd>
24</dl><h2>Arguments</h2>
25
26<table border="1" width="100%">
27
28
29
30    <TR>
31<TD width="176"><SPAN class="argument">pSrc </SPAN></TD>
32<TD width="670">Pointer to a vector.</TD>
33    </TR>
34    <TR>
35<TD><SPAN class="argument">pDst </SPAN></TD>
36<TD>Pointer to the normalized vector.</TD>
37    </TR>
38  </table>
39<h2>Return Values</h2>
40<p>None.</p>
41<H2>Description</H2>
42<P>Normalizes <A href="VecFx32.html"><CODE>VecFx32</CODE></A>-type vectors. The result is stored in <SPAN class="argument">*pDst</SPAN>.<BR> The pointers <SPAN class="argument">*pSrc</SPAN> and <SPAN class="argument">*pDst</SPAN> can be pointers to the same vector.<BR> The function uses the divider and square-root calculator. See <A href="../../cp/div/about_div.html#use_in_intr">Divider Usage Notes</A> when using this function inside an interrupt. </P>
43
44<p>
45The error in the obtained result becomes large when the vector specified by <SPAN class="argument">pSrc</SPAN> is extremely short. This function is provided as a weak symbol, so you can overwrite it by defining an independent function with the same name.</p>
46
47<P><B>Note:</B> Correct calculation results cannot be obtained when <CODE>(pSrc.x×pSrc.x)+(pSrc.y×pSrc.y)+(pSrc.z×pSrc.z) > 0x100000000000000</CODE>. </P>
48
49<h2>See Also</h2>
50<H2>Revision History</H2>
51<P>
522009/09/08 Added a note stating that this function is a weak symbol. <br />2006/04/27 Added notes. <BR>2004/01/19 Initial version.</P>
53<hr><p>CONFIDENTIAL</p></body>
54</html>
55