[vtk-developers] Adding ComputeArea() to vtkTriangle

David Doria daviddoria+vtk at gmail.com
Fri Dec 18 08:05:37 EST 2009


Would there be any complaints if I add this function?

// Description:
// Compute the area of the triangle.
double ComputeArea();

//----------------------------------------------------------------------------
double vtkTriangle::ComputeArea()
{
  double p0[3];
  double p1[3];
  double p2[3];
  this->GetPoints()->GetPoint(0, p0);
  this->GetPoints()->GetPoint(1, p1);
  this->GetPoints()->GetPoint(2, p2);
  return vtkTriangle::TriangleArea(p0, p1, p2);
}

Thanks,

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20091218/111bb83f/attachment.html>


More information about the vtk-developers mailing list