HI!<div>I&#39;m working with VTK for my master thesis and now I m facing a doubt. I need to compute the distance of a point from a segment defined by two vertexes. I found two functions in vtkLine.h</div><div><br></div><div>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #008419">// Compute distance to finite line. Returns parametric coordinate t </p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #008419">// and point location on line.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><span style="color: #c22a9f">double</span> vtkLine::DistanceToLine(<span style="color: #c22a9f">double</span> x[<span style="color: #2526d3">3</span>], <span style="color: #c22a9f">double</span> p1[<span style="color: #2526d3">3</span>], <span style="color: #c22a9f">double</span> p2[<span style="color: #2526d3">3</span>], </p>

<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo">                              <span style="color: #c22a9f">double</span> &amp;t, <span style="color: #c22a9f">double</span> closestPoint[<span style="color: #2526d3">3</span>])</p>
</div><div><br></div><div><br></div><div><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #008419">// Determine the distance of the current vertex to the edge defined by</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #008419">// the vertices provided.  Returns distance squared. Note: line is assumed</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #008419">// infinite in extent.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #008419">//</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><span style="color: #c22a9f">double</span> vtkLine::DistanceToLine (<span style="color: #c22a9f">double</span> x[<span style="color: #2526d3">3</span>], <span style="color: #c22a9f">double</span> p1[<span style="color: #2526d3">3</span>], <span style="color: #c22a9f">double</span> p2[<span style="color: #2526d3">3</span>])</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><br></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo">So if I got it right, the first one gives me the distance from a segment defined by two vertexes and the second </p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo">one gives me the distance from a line (infinite)? I got confused cause the documentation speaks about edge and not line.</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo">
<br></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo">Can you help me?</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo">Which of these should I use?</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo">
<br></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo">Thank you!</p></div><div><br></div>