[vtk-developers] vtkMath::Dot2D

Dean Inglis dean.inglis at camris.ca
Wed Dec 9 18:18:52 EST 2009


another  signature might be

static double Dot2D(const double* x, const double* y)

that way you could pass x[2] or x[3] or x[ n >= 2 ]
for example

Dean


----- Original Message ----- 
From: "David Doria" <daviddoria+vtk at gmail.com>
To: "VTK Developers" <vtk-developers at vtk.org>
Sent: Wednesday, December 09, 2009 5:57 PM
Subject: [vtk-developers] vtkMath::Dot2D


> Is there any reason:
>
>  // Description:
>  // Dot product of two 2-vectors. The third (z) component is
>  // ignored (double-precision version).
>  static double Dot2D(const double x[3], const double y[3]) {
>    return ( x[0] * y[0] + x[1] * y[1] );};
>
> needs to accept 3-vectors and talk about how it ignores the last
> component? Couldn't it just be:
>
>  // Description:
>  // Dot product of two 2-vectors. (double-precision version).
>  static double Dot2D(const double x[2], const double y[2]) {
>    return ( x[0] * y[0] + x[1] * y[1] );};
>
> Thanks,
>
> David
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtk-developers
> 




More information about the vtk-developers mailing list