mt-polygon-simplification/lib/psimpl_v7_src/doc/namespacepsimpl_1_1math.html

520 lines
24 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>psimpl: psimpl::math Namespace Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.7.4 -->
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">psimpl&#160;<span id="projectnumber">7</span></div>
</td>
</tr>
</tbody>
</table>
</div>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li class="current"><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li><a href="dirs.html"><span>Directories</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="namespaces.html"><span>Namespace&#160;List</span></a></li>
<li><a href="namespacemembers.html"><span>Namespace&#160;Members</span></a></li>
</ul>
</div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
initNavTree('namespacepsimpl_1_1math.html','');
</script>
<div id="doc-content">
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">psimpl::math Namespace Reference</div> </div>
</div>
<div class="contents">
<p>Contains functions for calculating statistics and distances between various geometric entities.
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structpsimpl_1_1math_1_1_statistics.html">Statistics</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">POD structure for storing several statistical values. <a href="structpsimpl_1_1math_1_1_statistics.html#details">More...</a><br/></td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;unsigned DIM, class InputIterator &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespacepsimpl_1_1math.html#a6b293d2459ba597c933d6fdb68e91b2c">equal</a> (InputIterator p1, InputIterator p2)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Determines if two points have the exact same coordinates. <a href="#a6b293d2459ba597c933d6fdb68e91b2c"></a><br/></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;unsigned DIM, class InputIterator , class OutputIterator &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">OutputIterator&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespacepsimpl_1_1math.html#a10bb3d3d87fa1038d43eee6e5f3fcdda">make_vector</a> (InputIterator p1, InputIterator p2, OutputIterator result)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a vector from two points. <a href="#a10bb3d3d87fa1038d43eee6e5f3fcdda"></a><br/></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;unsigned DIM, class InputIterator &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">std::iterator_traits<br class="typebreak"/>
&lt; InputIterator &gt;::value_type&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespacepsimpl_1_1math.html#a26bb15089fdfcfc4560b5a318317bbc4">dot</a> (InputIterator v1, InputIterator v2)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes the dot product of two vectors. <a href="#a26bb15089fdfcfc4560b5a318317bbc4"></a><br/></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;unsigned DIM, class InputIterator , class OutputIterator &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">OutputIterator&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespacepsimpl_1_1math.html#a87a753961c7742b6c48b4f66a0fea697">interpolate</a> (InputIterator p1, InputIterator p2, float fraction, OutputIterator result)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Peforms linear interpolation between two points. <a href="#a87a753961c7742b6c48b4f66a0fea697"></a><br/></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;unsigned DIM, class InputIterator1 , class InputIterator2 &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">std::iterator_traits<br class="typebreak"/>
&lt; InputIterator1 &gt;::value_type&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespacepsimpl_1_1math.html#ab995b6d68caf4d43172a0de6ee363eb0">point_distance2</a> (InputIterator1 p1, InputIterator2 p2)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes the squared distance of two points. <a href="#ab995b6d68caf4d43172a0de6ee363eb0"></a><br/></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;unsigned DIM, class InputIterator &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">std::iterator_traits<br class="typebreak"/>
&lt; InputIterator &gt;::value_type&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespacepsimpl_1_1math.html#ace5d8a6b9ca11eeadd9d13e451651996">line_distance2</a> (InputIterator l1, InputIterator l2, InputIterator p)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes the squared distance between an infinite line (l1, l2) and a point p. <a href="#ace5d8a6b9ca11eeadd9d13e451651996"></a><br/></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;unsigned DIM, class InputIterator &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">std::iterator_traits<br class="typebreak"/>
&lt; InputIterator &gt;::value_type&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespacepsimpl_1_1math.html#a4f3ff418f290d1125622c2388ab976d0">segment_distance2</a> (InputIterator s1, InputIterator s2, InputIterator p)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes the squared distance between a line segment (s1, s2) and a point p. <a href="#a4f3ff418f290d1125622c2388ab976d0"></a><br/></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;unsigned DIM, class InputIterator &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">std::iterator_traits<br class="typebreak"/>
&lt; InputIterator &gt;::value_type&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespacepsimpl_1_1math.html#a4b9426204b9964b859b059cc7fbce61a">ray_distance2</a> (InputIterator r1, InputIterator r2, InputIterator p)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes the squared distance between a ray (r1, r2) and a point p. <a href="#a4b9426204b9964b859b059cc7fbce61a"></a><br/></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;class InputIterator &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="structpsimpl_1_1math_1_1_statistics.html">Statistics</a>&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespacepsimpl_1_1math.html#ab162cc6f5efcf619c7327b45c793c969">compute_statistics</a> (InputIterator first, InputIterator last)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes various statistics for the range [first, last) <a href="#ab162cc6f5efcf619c7327b45c793c969"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Contains functions for calculating statistics and distances between various geometric entities. </p>
</div><hr/><h2>Function Documentation</h2>
<a class="anchor" id="ab162cc6f5efcf619c7327b45c793c969"></a><!-- doxytag: member="psimpl::math::compute_statistics" ref="ab162cc6f5efcf619c7327b45c793c969" args="(InputIterator first, InputIterator last)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class InputIterator &gt; </div>
<table class="memname">
<tr>
<td class="memname"><a class="el" href="structpsimpl_1_1math_1_1_statistics.html">Statistics</a> psimpl::math::compute_statistics </td>
<td>(</td>
<td class="paramtype">InputIterator&#160;</td>
<td class="paramname"><em>first</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">InputIterator&#160;</td>
<td class="paramname"><em>last</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Computes various statistics for the range [first, last) </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">first</td><td>the first value </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">last</td><td>one beyond the last value </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the calculated statistics </dd></dl>
</div>
</div>
<a class="anchor" id="a26bb15089fdfcfc4560b5a318317bbc4"></a><!-- doxytag: member="psimpl::math::dot" ref="a26bb15089fdfcfc4560b5a318317bbc4" args="(InputIterator v1, InputIterator v2)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;unsigned DIM, class InputIterator &gt; </div>
<table class="memname">
<tr>
<td class="memname">std::iterator_traits&lt;InputIterator&gt;::value_type psimpl::math::dot </td>
<td>(</td>
<td class="paramtype">InputIterator&#160;</td>
<td class="paramname"><em>v1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">InputIterator&#160;</td>
<td class="paramname"><em>v2</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Computes the dot product of two vectors. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">v1</td><td>the first coordinate of the first vector </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">v2</td><td>the first coordinate of the second vector </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the dot product (v1 * v2) </dd></dl>
</div>
</div>
<a class="anchor" id="a6b293d2459ba597c933d6fdb68e91b2c"></a><!-- doxytag: member="psimpl::math::equal" ref="a6b293d2459ba597c933d6fdb68e91b2c" args="(InputIterator p1, InputIterator p2)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;unsigned DIM, class InputIterator &gt; </div>
<table class="memname">
<tr>
<td class="memname">bool psimpl::math::equal </td>
<td>(</td>
<td class="paramtype">InputIterator&#160;</td>
<td class="paramname"><em>p1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">InputIterator&#160;</td>
<td class="paramname"><em>p2</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Determines if two points have the exact same coordinates. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">p1</td><td>the first coordinate of the first point </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">p2</td><td>the first coordinate of the second point </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>true when the points are equal; false otherwise </dd></dl>
</div>
</div>
<a class="anchor" id="a87a753961c7742b6c48b4f66a0fea697"></a><!-- doxytag: member="psimpl::math::interpolate" ref="a87a753961c7742b6c48b4f66a0fea697" args="(InputIterator p1, InputIterator p2, float fraction, OutputIterator result)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;unsigned DIM, class InputIterator , class OutputIterator &gt; </div>
<table class="memname">
<tr>
<td class="memname">OutputIterator psimpl::math::interpolate </td>
<td>(</td>
<td class="paramtype">InputIterator&#160;</td>
<td class="paramname"><em>p1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">InputIterator&#160;</td>
<td class="paramname"><em>p2</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>fraction</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">OutputIterator&#160;</td>
<td class="paramname"><em>result</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Peforms linear interpolation between two points. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">p1</td><td>the first coordinate of the first point </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">p2</td><td>the first coordinate of the second point </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">fraction</td><td>the fraction used during interpolation </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">result</td><td>the interpolation result (p1 + fraction * (p2 - p1)) </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>one beyond the last coordinate of the interpolated point </dd></dl>
</div>
</div>
<a class="anchor" id="ace5d8a6b9ca11eeadd9d13e451651996"></a><!-- doxytag: member="psimpl::math::line_distance2" ref="ace5d8a6b9ca11eeadd9d13e451651996" args="(InputIterator l1, InputIterator l2, InputIterator p)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;unsigned DIM, class InputIterator &gt; </div>
<table class="memname">
<tr>
<td class="memname">std::iterator_traits&lt;InputIterator&gt;::value_type psimpl::math::line_distance2 </td>
<td>(</td>
<td class="paramtype">InputIterator&#160;</td>
<td class="paramname"><em>l1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">InputIterator&#160;</td>
<td class="paramname"><em>l2</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">InputIterator&#160;</td>
<td class="paramname"><em>p</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Computes the squared distance between an infinite line (l1, l2) and a point p. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">l1</td><td>the first coordinate of the first point on the line </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">l2</td><td>the first coordinate of the second point on the line </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">p</td><td>the first coordinate of the test point </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the squared distance </dd></dl>
</div>
</div>
<a class="anchor" id="a10bb3d3d87fa1038d43eee6e5f3fcdda"></a><!-- doxytag: member="psimpl::math::make_vector" ref="a10bb3d3d87fa1038d43eee6e5f3fcdda" args="(InputIterator p1, InputIterator p2, OutputIterator result)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;unsigned DIM, class InputIterator , class OutputIterator &gt; </div>
<table class="memname">
<tr>
<td class="memname">OutputIterator psimpl::math::make_vector </td>
<td>(</td>
<td class="paramtype">InputIterator&#160;</td>
<td class="paramname"><em>p1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">InputIterator&#160;</td>
<td class="paramname"><em>p2</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">OutputIterator&#160;</td>
<td class="paramname"><em>result</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Creates a vector from two points. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">p1</td><td>the first coordinate of the first point </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">p2</td><td>the first coordinate of the second point </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">result</td><td>the resulting vector (p2-p1) </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>one beyond the last coordinate of the resulting vector </dd></dl>
</div>
</div>
<a class="anchor" id="ab995b6d68caf4d43172a0de6ee363eb0"></a><!-- doxytag: member="psimpl::math::point_distance2" ref="ab995b6d68caf4d43172a0de6ee363eb0" args="(InputIterator1 p1, InputIterator2 p2)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;unsigned DIM, class InputIterator1 , class InputIterator2 &gt; </div>
<table class="memname">
<tr>
<td class="memname">std::iterator_traits&lt;InputIterator1&gt;::value_type psimpl::math::point_distance2 </td>
<td>(</td>
<td class="paramtype">InputIterator1&#160;</td>
<td class="paramname"><em>p1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">InputIterator2&#160;</td>
<td class="paramname"><em>p2</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Computes the squared distance of two points. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">p1</td><td>the first coordinate of the first point </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">p2</td><td>the first coordinate of the second point </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the squared distance </dd></dl>
</div>
</div>
<a class="anchor" id="a4b9426204b9964b859b059cc7fbce61a"></a><!-- doxytag: member="psimpl::math::ray_distance2" ref="a4b9426204b9964b859b059cc7fbce61a" args="(InputIterator r1, InputIterator r2, InputIterator p)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;unsigned DIM, class InputIterator &gt; </div>
<table class="memname">
<tr>
<td class="memname">std::iterator_traits&lt;InputIterator&gt;::value_type psimpl::math::ray_distance2 </td>
<td>(</td>
<td class="paramtype">InputIterator&#160;</td>
<td class="paramname"><em>r1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">InputIterator&#160;</td>
<td class="paramname"><em>r2</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">InputIterator&#160;</td>
<td class="paramname"><em>p</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Computes the squared distance between a ray (r1, r2) and a point p. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">r1</td><td>the first coordinate of the start point of the ray </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">r2</td><td>the first coordinate of a point on the ray </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">p</td><td>the first coordinate of the test point </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the squared distance </dd></dl>
</div>
</div>
<a class="anchor" id="a4f3ff418f290d1125622c2388ab976d0"></a><!-- doxytag: member="psimpl::math::segment_distance2" ref="a4f3ff418f290d1125622c2388ab976d0" args="(InputIterator s1, InputIterator s2, InputIterator p)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;unsigned DIM, class InputIterator &gt; </div>
<table class="memname">
<tr>
<td class="memname">std::iterator_traits&lt;InputIterator&gt;::value_type psimpl::math::segment_distance2 </td>
<td>(</td>
<td class="paramtype">InputIterator&#160;</td>
<td class="paramname"><em>s1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">InputIterator&#160;</td>
<td class="paramname"><em>s2</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">InputIterator&#160;</td>
<td class="paramname"><em>p</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Computes the squared distance between a line segment (s1, s2) and a point p. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">s1</td><td>the first coordinate of the start point of the segment </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">s2</td><td>the first coordinate of the end point of the segment </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">p</td><td>the first coordinate of the test point </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the squared distance </dd></dl>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespacepsimpl.html">psimpl</a> </li>
<li class="navelem"><a class="el" href="namespacepsimpl_1_1math.html">math</a> </li>
<li class="footer">Generated on Fri Jun 24 2011 14:56:29 for psimpl by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </li>
</ul>
</div>
</body>
</html>