<HTML>
<HEAD>
<TITLE>Re: [vtk-developers] vtkMath::Dot2D</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>My guess would be that that is a copy-paste error.  Change it to 2-vectors is probably the right thing to do.<BR>
<BR>
AFAIK, the array declaration in a function/method argument is treated just like a pointer.  C++ does not do any range checking.  I think it just serves to help document what size array you expect.<BR>
<BR>
-Ken<BR>
<BR>
<BR>
On 12/9/09 3:57 PM, "David Doria" <<a href="daviddoria+vtk@gmail.com">daviddoria+vtk@gmail.com</a>> wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Is there any reason:<BR>
<BR>
  // Description:<BR>
  // Dot product of two 2-vectors. The third (z) component is<BR>
  // ignored (double-precision version).<BR>
  static double Dot2D(const double x[3], const double y[3]) {<BR>
    return ( x[0] * y[0] + x[1] * y[1] );};<BR>
<BR>
needs to accept 3-vectors and talk about how it ignores the last<BR>
component? Couldn't it just be:<BR>
<BR>
  // Description:<BR>
  // Dot product of two 2-vectors. (double-precision version).<BR>
  static double Dot2D(const double x[2], const double y[2]) {<BR>
    return ( x[0] * y[0] + x[1] * y[1] );};<BR>
<BR>
Thanks,<BR>
<BR>
David<BR>
_______________________________________________<BR>
Powered by www.kitware.com<BR>
<BR>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><BR>
<BR>
Follow this link to subscribe/unsubscribe:<BR>
<a href="http://www.vtk.org/mailman/listinfo/vtk-developers">http://www.vtk.org/mailman/listinfo/vtk-developers</a><BR>
<BR>
<BR>
<BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
</SPAN></FONT><FONT SIZE="1"><FONT FACE="Monaco, Courier New"><SPAN STYLE='font-size:7.5pt'><BR>
   ****      Kenneth Moreland<BR>
    ***      Sandia National Laboratories<BR>
***********  <BR>
*** *** ***  email: <a href="kmorel@sandia.gov">kmorel@sandia.gov</a><BR>
**  ***  **  phone: (505) 844-8919<BR>
    ***      web:   <a href="http://www.cs.unm.edu/~kmorel">http://www.cs.unm.edu/~kmorel</a><BR>
</SPAN></FONT></FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
</SPAN></FONT>
</BODY>
</HTML>