<br><div class="gmail_quote">On Sun, Jun 14, 2009 at 6:20 AM, Giancarlo Amati <span dir="ltr">&lt;<a href="mailto:ilferraresebono@hotmail.it">ilferraresebono@hotmail.it</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">




<div>
Hello everybody,<br>
 <br>
I know this is a trivial mathematical problem but I wonder if there&#39;s anything in VTK that can make it quicker. I have 6 points almost planar in the 3D, i wonder if there is any class in VTK which takes at least 3 points and compute the plane as well as it&#39;s normal vector.<br>

 <br>
Very kind regards.<br>
GC<br></div></blockquote></div><br>I&#39;m not sure why there isn&#39;t a function for this (that I can find at
least!). You can find a function that does what you want here:<br>
<a href="http://www.vtk.org/pipermail/vtkusers/2004-March/072916.html">http://www.vtk.org/pipermail/vtkusers/2004-March/072916.html</a><br>
or here<br>
<a href="http://markmail.org/message/52odxars4ijopqfe#query:fit%20plane%20vtk+page:1+mid:52odxars4ijopqfe+state:results">http://markmail.org/message/52odxars4ijopqfe#query:fit%20plane%20vtk+page:1+mid:52odxars4ijopqfe+state:results</a><br>

<br>
The idea is that the eigen vector corresponding to the smallest eigen
value of the scatter matrix of the points is the normal of the plane.
It seems like there should be a function somewhere in vtk:<br>
vtkPlane* FitPlane(vtkPoints* Points);<br>
<br>
GC, when you get this working how you want it can you post it here and maybe someone can add it somewhere in vtk?<br>
<br clear="all">Thanks,<br><br>David<br>