3 <meta name="generator" content="groff -Thtml, see www.gnu.org">
4 <meta name="Content-Style" content="text/css">
5 <title>vec_dot_product</title>
9 <h1 align=center>vec_dot_product</h1>
10 <a href="#NAME">NAME</a><br>
11 <a href="#SYNOPSIS">SYNOPSIS</a><br>
12 <a href="#DESCRIPTION">DESCRIPTION</a><br>
13 <a href="#AUTHOR">AUTHOR</a><br>
14 <a href="#LICENSE">LICENSE</a><br>
15 <a href="#VERSION">VERSION</a><br>
16 <a href="#SEE ALSO">SEE ALSO</a><br>
19 <!-- Creator : groff version 1.17.2 -->
20 <!-- CreationDate: Fri May 3 14:58:45 2002 -->
23 <table width="100%" border=0 rules="none" frame="void"
24 cols="2" cellspacing="0" cellpadding="0">
25 <tr valign="top" align="left">
26 <td width="10%"></td><td width="90%">
27 vec_dot_product - calculate the dot product of two vectors</td></table>
28 <a name="SYNOPSIS"></a>
31 <table width="100%" border=0 rules="none" frame="void"
32 cols="2" cellspacing="0" cellpadding="0">
33 <tr valign="top" align="left">
34 <td width="10%"></td><td width="90%">
35 <pre><b>#include <matvec.h>
37 float vec_dot_product (const float *v1, const float *v2);
38 </b></pre></td></table>
39 <a name="DESCRIPTION"></a>
42 <table width="100%" border=0 rules="none" frame="void"
43 cols="2" cellspacing="0" cellpadding="0">
44 <tr valign="top" align="left">
45 <td width="10%"></td><td width="90%">
46 <b>vec_dot_product</b> calculates the dot product of two
47 vectors <b>v1</b> and <b>v2</b> and returns it. The dot
48 product is formally defined as:</td></table>
50 <table width="100%" border=0 rules="none" frame="void"
51 cols="2" cellspacing="0" cellpadding="0">
52 <tr valign="top" align="left">
53 <td width="10%"></td><td width="90%">
54 <b>|v1| |v2| cos theta</b></td></table>
56 <table width="100%" border=0 rules="none" frame="void"
57 cols="2" cellspacing="0" cellpadding="0">
58 <tr valign="top" align="left">
59 <td width="10%"></td><td width="90%">
60 where <b>theta</b> is the angle between the two
63 <table width="100%" border=0 rules="none" frame="void"
64 cols="2" cellspacing="0" cellpadding="0">
65 <tr valign="top" align="left">
66 <td width="10%"></td><td width="90%">
67 One interesting consequence of this is that if both
68 <b>v1</b> and <b>v2</b> are already normalized, then the dot
69 product is 1 if the vectors are parallel and running in the
70 same direction, and 0 if the vectors are
71 perpendicular.</td></table>
75 <table width="100%" border=0 rules="none" frame="void"
76 cols="2" cellspacing="0" cellpadding="0">
77 <tr valign="top" align="left">
78 <td width="10%"></td><td width="90%">
79 Richard Jones <rich@annexia.org></td></table>
80 <a name="LICENSE"></a>
83 <table width="100%" border=0 rules="none" frame="void"
84 cols="2" cellspacing="0" cellpadding="0">
85 <tr valign="top" align="left">
86 <td width="10%"></td><td width="90%">
87 GNU LGPL (see http://www.gnu.org/)</td></table>
88 <a name="VERSION"></a>
91 <table width="100%" border=0 rules="none" frame="void"
92 cols="2" cellspacing="0" cellpadding="0">
93 <tr valign="top" align="left">
94 <td width="10%"></td><td width="90%">
95 c2lib-1.2.13</td></table>
96 <a name="SEE ALSO"></a>
99 <table width="100%" border=0 rules="none" frame="void"
100 cols="2" cellspacing="0" cellpadding="0">
101 <tr valign="top" align="left">
102 <td width="10%"></td><td width="90%">
103 <b>vec_magnitude_in_direction(3)</b>,
104 <b>vec_angle_between(3)</b></td></table>