1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<HTML> 3<HEAD> 4<META http-equiv="Content-Type" content="text/html; charset=windows-1252"> 5<META name="GENERATOR" content="Microsoft FrontPage 5.0"> 6<META http-equiv="Content-Style-Type" content="text/css"> 7<LINK rel="stylesheet" type="text/css" href="../../CSS/revolution.css"> 8<TITLE>VECDotProduct</TITLE> 9</HEAD> 10<BODY> 11<H1>VECDotProduct</H1> 12 13<H2>Syntax</H2> 14<dl><dd><pre class="construction"> 15#include <revolution/mtx.h> 16 17f32 C_VECDotProduct ( const Vec* a, const Vec* b ); 18f32 PSVECDotProduct ( const Vec* a, const Vec* b ); 19 20#define VECDotProduct C_VECDotProduct // for debug build 21#define VECDotProduct PSVECDotProduct // for nondebug build 22</pre></dd></dl> 23 24<H2>Arguments</H2> 25<TABLE class="arguments" border="1" > 26 <TBODY> 27 <TR> 28<TH>a</TH> 29<TD>Pointer to the first <A href="../structures/Vec_VecPtr.html"><CODE>Vec</CODE></A>. <SPAN class="argument">a</SPAN> is not altered by this function.</TD> 30 </TR> 31 <TR> 32<TH>b</TH> 33<TD>Pointer to the second <CODE><A href="../structures/Vec_VecPtr.html">Vec</A></CODE>. <SPAN class="argument">b</SPAN> is not altered by this function.</TD> 34 </TR> 35 </TBODY> 36</TABLE> 37 38<H2>Return Values</H2> 39<P>Returns the dot product of <SPAN class="argument">a</SPAN> and <SPAN class="argument">b</SPAN>.</P> 40 41<H2>Description</H2> 42<P>Finds the inner product of two vectors. <SPAN class="argument">a</SPAN> and <SPAN class="argument">b</SPAN> do not need to be unit vectors and are not normalized inside this function. To use <CODE>VECDotProduct</CODE> to calculate the cosine directly, <SPAN class="argument">a</SPAN> and <SPAN class="argument">b</SPAN> must be normalized before calling this routine.</P> 43<P>During a debug build, <code>VECDotProduct</code> is interpreted as <code>C_VECDotProduct</code>, which is a normal C language version. During a non-debug build for a Broadway processor, the paired-singles equivalent of this function, <code><font face="Courier New">PSVECDotProduct</font></code>, will be automatically substituted. You can also call each of <code>C_VECDotProduct/PSVECDotProduct</code> explicitly.</P> 44 45<H2>See Also</H2> 46<P class="reference"> 47<A href="../structures/Vec_VecPtr.html">Vec, VecPtr</A>, 48<A href="VECCrossProduct.html">VECCrossProduct</A> 49</P> 50 51<H2>Revision History</H2> 52<P> 532006/03/01 Initial version. 54</P> 55 56<hr><p>CONFIDENTIAL</p></body> 57</HTML>