geos_390_docs/classgeos_1_1geom_1_1LineSe...

1101 lines
64 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"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>GEOS: geos::geom::LineSegment Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">GEOS
&#160;<span id="projectnumber">3.9.1dev</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class&#160;List</span></a></li>
<li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespacegeos.html">geos</a></li><li class="navelem"><a class="el" href="namespacegeos_1_1geom.html">geom</a></li><li class="navelem"><a class="el" href="classgeos_1_1geom_1_1LineSegment.html">LineSegment</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a> &#124;
<a href="#friends">Friends</a> &#124;
<a href="classgeos_1_1geom_1_1LineSegment-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">geos::geom::LineSegment Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p><code>#include &lt;<a class="el" href="LineSegment_8h_source.html">LineSegment.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for geos::geom::LineSegment:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="classgeos_1_1geom_1_1LineSegment__inherit__graph.svg" width="203" height="131"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<div class="dynheader">
Collaboration diagram for geos::geom::LineSegment:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="classgeos_1_1geom_1_1LineSegment__coll__graph.svg" width="294" height="147"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structgeos_1_1geom_1_1LineSegment_1_1HashCode.html">HashCode</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:aaa9cfa92a785030d1357a31d9b510dad"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1LineSegment.html#aaa9cfa92a785030d1357a31d9b510dad">LineSegment</a> ()</td></tr>
<tr class="memdesc:aaa9cfa92a785030d1357a31d9b510dad"><td class="mdescLeft">&#160;</td><td class="mdescRight">Segment end. <a href="#aaa9cfa92a785030d1357a31d9b510dad">More...</a><br /></td></tr>
<tr class="separator:aaa9cfa92a785030d1357a31d9b510dad"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a105348291a24edfce16b8fa243793fb4"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1LineSegment.html#a105348291a24edfce16b8fa243793fb4">LineSegment</a> (const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a> &amp;c0, const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a> &amp;c1)</td></tr>
<tr class="memdesc:a105348291a24edfce16b8fa243793fb4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a <a class="el" href="classgeos_1_1geom_1_1LineSegment.html">LineSegment</a> with the given start and end Coordinates. <a href="#a105348291a24edfce16b8fa243793fb4">More...</a><br /></td></tr>
<tr class="separator:a105348291a24edfce16b8fa243793fb4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad2ff6b0bb555727c6bd9e7e97c637ccb"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1LineSegment.html#ad2ff6b0bb555727c6bd9e7e97c637ccb">LineSegment</a> (double x0, double y0, double x1, double y1)</td></tr>
<tr class="separator:ad2ff6b0bb555727c6bd9e7e97c637ccb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab9935eb41cd0e137612d8f0728f5e28b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1LineSegment.html#ab9935eb41cd0e137612d8f0728f5e28b">setCoordinates</a> (const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a> &amp;c0, const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a> &amp;c1)</td></tr>
<tr class="separator:ab9935eb41cd0e137612d8f0728f5e28b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad0fe993f3ef8b05ce1174987a5ecb5dd"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1LineSegment.html#ad0fe993f3ef8b05ce1174987a5ecb5dd">operator[]</a> (std::size_t i) const </td></tr>
<tr class="separator:ad0fe993f3ef8b05ce1174987a5ecb5dd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9b52f3e9aeb52d5b5ca694696f06299f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1LineSegment.html#a9b52f3e9aeb52d5b5ca694696f06299f">operator[]</a> (std::size_t i)</td></tr>
<tr class="separator:a9b52f3e9aeb52d5b5ca694696f06299f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa8192c84e07aa76f514b37627fa98fba"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1LineSegment.html#aa8192c84e07aa76f514b37627fa98fba">setCoordinates</a> (const <a class="el" href="classgeos_1_1geom_1_1LineSegment.html">LineSegment</a> &amp;ls)</td></tr>
<tr class="separator:aa8192c84e07aa76f514b37627fa98fba"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1fe66eb4b8536e7ec078fa7e1942d78d"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1LineSegment.html#a1fe66eb4b8536e7ec078fa7e1942d78d">getLength</a> () const </td></tr>
<tr class="memdesc:a1fe66eb4b8536e7ec078fa7e1942d78d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes the length of the line segment. <a href="#a1fe66eb4b8536e7ec078fa7e1942d78d">More...</a><br /></td></tr>
<tr class="separator:a1fe66eb4b8536e7ec078fa7e1942d78d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8391aa2103c0116e38e9dc7b1e28f36e"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1LineSegment.html#a8391aa2103c0116e38e9dc7b1e28f36e">isHorizontal</a> () const </td></tr>
<tr class="separator:a8391aa2103c0116e38e9dc7b1e28f36e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3a0e0267d47cfa11c26ea338febe3b4c"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1LineSegment.html#a3a0e0267d47cfa11c26ea338febe3b4c">isVertical</a> () const </td></tr>
<tr class="separator:a3a0e0267d47cfa11c26ea338febe3b4c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a716d81e2e4b4cc445f4972e1515ced3a"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1LineSegment.html#a716d81e2e4b4cc445f4972e1515ced3a">orientationIndex</a> (const <a class="el" href="classgeos_1_1geom_1_1LineSegment.html">LineSegment</a> &amp;seg) const </td></tr>
<tr class="separator:a716d81e2e4b4cc445f4972e1515ced3a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac66881f2ff1268940d892a79a03eee92"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1LineSegment.html#ac66881f2ff1268940d892a79a03eee92">orientationIndex</a> (const <a class="el" href="classgeos_1_1geom_1_1LineSegment.html">LineSegment</a> *seg) const </td></tr>
<tr class="separator:ac66881f2ff1268940d892a79a03eee92"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7eb5055c4a37d5a9f4a2a86f1af18363"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1LineSegment.html#a7eb5055c4a37d5a9f4a2a86f1af18363">orientationIndex</a> (const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a> &amp;p) const </td></tr>
<tr class="memdesc:a7eb5055c4a37d5a9f4a2a86f1af18363"><td class="mdescLeft">&#160;</td><td class="mdescRight">Determines the orientation index of a <a class="el" href="classgeos_1_1geom_1_1Coordinate.html" title="Coordinate is the lightweight class used to store coordinates. ">Coordinate</a> relative to this segment. <a href="#a7eb5055c4a37d5a9f4a2a86f1af18363">More...</a><br /></td></tr>
<tr class="separator:a7eb5055c4a37d5a9f4a2a86f1af18363"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6d69f6d61ad2dbe03eafae4e73a23116"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1LineSegment.html#a6d69f6d61ad2dbe03eafae4e73a23116">reverse</a> ()</td></tr>
<tr class="memdesc:a6d69f6d61ad2dbe03eafae4e73a23116"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reverses the direction of the line segment. <a href="#a6d69f6d61ad2dbe03eafae4e73a23116">More...</a><br /></td></tr>
<tr class="separator:a6d69f6d61ad2dbe03eafae4e73a23116"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a80f3d6aab7d8a3e527833731194f7b72"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1LineSegment.html#a80f3d6aab7d8a3e527833731194f7b72">normalize</a> ()</td></tr>
<tr class="memdesc:a80f3d6aab7d8a3e527833731194f7b72"><td class="mdescLeft">&#160;</td><td class="mdescRight">Puts the line segment into a normalized form. <a href="#a80f3d6aab7d8a3e527833731194f7b72">More...</a><br /></td></tr>
<tr class="separator:a80f3d6aab7d8a3e527833731194f7b72"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a55f97e764496162bdcb2c15e9042c3b0"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1LineSegment.html#a55f97e764496162bdcb2c15e9042c3b0">angle</a> () const </td></tr>
<tr class="separator:a55f97e764496162bdcb2c15e9042c3b0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a90f621b439f8c48c424568477e53d9ad"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1LineSegment.html#a90f621b439f8c48c424568477e53d9ad">midPoint</a> (<a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a> &amp;ret) const </td></tr>
<tr class="memdesc:a90f621b439f8c48c424568477e53d9ad"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes the midpoint of the segment. <a href="#a90f621b439f8c48c424568477e53d9ad">More...</a><br /></td></tr>
<tr class="separator:a90f621b439f8c48c424568477e53d9ad"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a21859b2efae5bf0c6718cb69c36bd64f"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1LineSegment.html#a21859b2efae5bf0c6718cb69c36bd64f">distance</a> (const <a class="el" href="classgeos_1_1geom_1_1LineSegment.html">LineSegment</a> &amp;ls) const </td></tr>
<tr class="memdesc:a21859b2efae5bf0c6718cb69c36bd64f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes the distance between this line segment and another one. <a href="#a21859b2efae5bf0c6718cb69c36bd64f">More...</a><br /></td></tr>
<tr class="separator:a21859b2efae5bf0c6718cb69c36bd64f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a81d6bfa59368dca81ee820b250b6653f"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1LineSegment.html#a81d6bfa59368dca81ee820b250b6653f">distance</a> (const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a> &amp;p) const </td></tr>
<tr class="memdesc:a81d6bfa59368dca81ee820b250b6653f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes the distance between this line segment and a point. <a href="#a81d6bfa59368dca81ee820b250b6653f">More...</a><br /></td></tr>
<tr class="separator:a81d6bfa59368dca81ee820b250b6653f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a47e38e1b78e9dadaff5a8cf039be2b15"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1LineSegment.html#a47e38e1b78e9dadaff5a8cf039be2b15">distancePerpendicular</a> (const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a> &amp;p) const </td></tr>
<tr class="memdesc:a47e38e1b78e9dadaff5a8cf039be2b15"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes the perpendicular distance between the (infinite) line defined by this line segment and a point. <a href="#a47e38e1b78e9dadaff5a8cf039be2b15">More...</a><br /></td></tr>
<tr class="separator:a47e38e1b78e9dadaff5a8cf039be2b15"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8756a769e85cf820f66044987f504848"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1LineSegment.html#a8756a769e85cf820f66044987f504848">pointAlong</a> (double segmentLengthFraction, <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a> &amp;ret) const </td></tr>
<tr class="memdesc:a8756a769e85cf820f66044987f504848"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes the <a class="el" href="classgeos_1_1geom_1_1Coordinate.html" title="Coordinate is the lightweight class used to store coordinates. ">Coordinate</a> that lies a given fraction along the line defined by this segment. <a href="#a8756a769e85cf820f66044987f504848">More...</a><br /></td></tr>
<tr class="separator:a8756a769e85cf820f66044987f504848"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab3444614a2f2e056aec36d360dec264b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1LineSegment.html#ab3444614a2f2e056aec36d360dec264b">pointAlongOffset</a> (double segmentLengthFraction, double offsetDistance, <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a> &amp;ret) const </td></tr>
<tr class="memdesc:ab3444614a2f2e056aec36d360dec264b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes the <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a> that lies a given fraction along the line defined by this segment and offset from the segment by a given distance. <a href="#ab3444614a2f2e056aec36d360dec264b">More...</a><br /></td></tr>
<tr class="separator:ab3444614a2f2e056aec36d360dec264b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a40296de9666ba70e56873a3bc19293da"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1LineSegment.html#a40296de9666ba70e56873a3bc19293da">projectionFactor</a> (const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a> &amp;p) const </td></tr>
<tr class="memdesc:a40296de9666ba70e56873a3bc19293da"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compute the projection factor for the projection of the point p onto this <a class="el" href="classgeos_1_1geom_1_1LineSegment.html">LineSegment</a>. <a href="#a40296de9666ba70e56873a3bc19293da">More...</a><br /></td></tr>
<tr class="separator:a40296de9666ba70e56873a3bc19293da"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ada37d3025cb4a1ccd40405f8c14fc0bb"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1LineSegment.html#ada37d3025cb4a1ccd40405f8c14fc0bb">segmentFraction</a> (const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a> &amp;inputPt) const </td></tr>
<tr class="memdesc:ada37d3025cb4a1ccd40405f8c14fc0bb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes the fraction of distance (in <code>[0.0, 1.0]</code>) that the projection of a point occurs along this line segment. <a href="#ada37d3025cb4a1ccd40405f8c14fc0bb">More...</a><br /></td></tr>
<tr class="separator:ada37d3025cb4a1ccd40405f8c14fc0bb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad4468ac21831e174364a8b9b022b4057"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1LineSegment.html#ad4468ac21831e174364a8b9b022b4057">project</a> (const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a> &amp;p, <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a> &amp;ret) const </td></tr>
<tr class="memdesc:ad4468ac21831e174364a8b9b022b4057"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compute the projection of a point onto the line determined by this line segment. <a href="#ad4468ac21831e174364a8b9b022b4057">More...</a><br /></td></tr>
<tr class="separator:ad4468ac21831e174364a8b9b022b4057"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a33bb21b64638ca65f54cb2f7ddf8deec"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1LineSegment.html#a33bb21b64638ca65f54cb2f7ddf8deec">project</a> (const <a class="el" href="classgeos_1_1geom_1_1LineSegment.html">LineSegment</a> &amp;seg, <a class="el" href="classgeos_1_1geom_1_1LineSegment.html">LineSegment</a> &amp;ret) const </td></tr>
<tr class="memdesc:a33bb21b64638ca65f54cb2f7ddf8deec"><td class="mdescLeft">&#160;</td><td class="mdescRight">Project a line segment onto this line segment and return the resulting line segment. <a href="#a33bb21b64638ca65f54cb2f7ddf8deec">More...</a><br /></td></tr>
<tr class="separator:a33bb21b64638ca65f54cb2f7ddf8deec"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a32476249bd06932a852b00e335757a5d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1LineSegment.html#a32476249bd06932a852b00e335757a5d">closestPoint</a> (const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a> &amp;p, <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a> &amp;ret) const </td></tr>
<tr class="memdesc:a32476249bd06932a852b00e335757a5d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes the closest point on this line segment to another point. <a href="#a32476249bd06932a852b00e335757a5d">More...</a><br /></td></tr>
<tr class="separator:a32476249bd06932a852b00e335757a5d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5b96fff51bec598be67c1a0add93263e"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1LineSegment.html#a5b96fff51bec598be67c1a0add93263e">compareTo</a> (const <a class="el" href="classgeos_1_1geom_1_1LineSegment.html">LineSegment</a> &amp;other) const </td></tr>
<tr class="memdesc:a5b96fff51bec598be67c1a0add93263e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compares this object with the specified object for order. <a href="#a5b96fff51bec598be67c1a0add93263e">More...</a><br /></td></tr>
<tr class="separator:a5b96fff51bec598be67c1a0add93263e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4f8d76d0fafccf247b69953aab3896a0"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1LineSegment.html#a4f8d76d0fafccf247b69953aab3896a0">equalsTopo</a> (const <a class="el" href="classgeos_1_1geom_1_1LineSegment.html">LineSegment</a> &amp;other) const </td></tr>
<tr class="memdesc:a4f8d76d0fafccf247b69953aab3896a0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns <code>true</code> if <code>other</code> is topologically equal to this <a class="el" href="classgeos_1_1geom_1_1LineSegment.html">LineSegment</a> (e.g. irrespective of orientation). <a href="#a4f8d76d0fafccf247b69953aab3896a0">More...</a><br /></td></tr>
<tr class="separator:a4f8d76d0fafccf247b69953aab3896a0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab8ae09bfaf7f7cd92d6d571a4f3d72b4"><td class="memItemLeft" align="right" valign="top">std::array&lt; <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a>, 2 &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1LineSegment.html#ab8ae09bfaf7f7cd92d6d571a4f3d72b4">closestPoints</a> (const <a class="el" href="classgeos_1_1geom_1_1LineSegment.html">LineSegment</a> &amp;line)</td></tr>
<tr class="separator:ab8ae09bfaf7f7cd92d6d571a4f3d72b4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aba35a85f555dd1c361ace249c293cc77"><td class="memItemLeft" align="right" valign="top">std::array&lt; <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a>, 2 &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1LineSegment.html#aba35a85f555dd1c361ace249c293cc77">closestPoints</a> (const <a class="el" href="classgeos_1_1geom_1_1LineSegment.html">LineSegment</a> *line)</td></tr>
<tr class="separator:aba35a85f555dd1c361ace249c293cc77"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5927c9e7d564872967a78d7bf7c03b14"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1LineSegment.html#a5927c9e7d564872967a78d7bf7c03b14">intersection</a> (const <a class="el" href="classgeos_1_1geom_1_1LineSegment.html">LineSegment</a> &amp;line) const </td></tr>
<tr class="separator:a5927c9e7d564872967a78d7bf7c03b14"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aebc30f05f2b666daeda0d7e2d27f0945"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1LineSegment.html#aebc30f05f2b666daeda0d7e2d27f0945">lineIntersection</a> (const <a class="el" href="classgeos_1_1geom_1_1LineSegment.html">LineSegment</a> &amp;line) const </td></tr>
<tr class="memdesc:aebc30f05f2b666daeda0d7e2d27f0945"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes the intersection point of the lines defined by two segments, if there is one. <a href="#aebc30f05f2b666daeda0d7e2d27f0945">More...</a><br /></td></tr>
<tr class="separator:aebc30f05f2b666daeda0d7e2d27f0945"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7a377d2bd1bf564e69f0fc1411c11d87"><td class="memItemLeft" align="right" valign="top">std::unique_ptr&lt; <a class="el" href="classgeos_1_1geom_1_1LineString.html">LineString</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1LineSegment.html#a7a377d2bd1bf564e69f0fc1411c11d87">toGeometry</a> (const <a class="el" href="classgeos_1_1geom_1_1GeometryFactory.html">GeometryFactory</a> &amp;gf) const </td></tr>
<tr class="separator:a7a377d2bd1bf564e69f0fc1411c11d87"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:ac3286355f41210086e4eab4498b46ba9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1LineSegment.html#ac3286355f41210086e4eab4498b46ba9">p0</a></td></tr>
<tr class="separator:ac3286355f41210086e4eab4498b46ba9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9382e49d86a10de5d5be69560824d900"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1LineSegment.html#a9382e49d86a10de5d5be69560824d900">p1</a></td></tr>
<tr class="memdesc:a9382e49d86a10de5d5be69560824d900"><td class="mdescLeft">&#160;</td><td class="mdescRight">Segment start. <a href="#a9382e49d86a10de5d5be69560824d900">More...</a><br /></td></tr>
<tr class="separator:a9382e49d86a10de5d5be69560824d900"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a>
Friends</h2></td></tr>
<tr class="memitem:ad7f0e1ac0c774fca24372d1181e5748f"><td class="memItemLeft" align="right" valign="top">std::ostream &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1geom_1_1LineSegment.html#ad7f0e1ac0c774fca24372d1181e5748f">operator&lt;&lt;</a> (std::ostream &amp;o, const <a class="el" href="classgeos_1_1geom_1_1LineSegment.html">LineSegment</a> &amp;l)</td></tr>
<tr class="separator:ad7f0e1ac0c774fca24372d1181e5748f"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Represents a line segment defined by two <a class="el" href="classgeos_1_1geom_1_1Coordinate.html" title="Coordinate is the lightweight class used to store coordinates. ">Coordinate</a>. Provides methods to compute various geometric properties and relationships of line segments.</p>
<p>This class is designed to be easily mutable (to the extent of having its contained points public). This supports a common pattern of reusing a single <a class="el" href="classgeos_1_1geom_1_1LineSegment.html">LineSegment</a> object as a way of computing segment properties on the segments defined by arrays or lists of <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a>s.</p>
<p>TODO: have this class keep pointers rather then real Coordinates ? </p>
<p>Definition at line <a class="el" href="LineSegment_8h_source.html#l00059">59</a> of file <a class="el" href="LineSegment_8h_source.html">LineSegment.h</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="aaa9cfa92a785030d1357a31d9b510dad"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">geos::geom::LineSegment::LineSegment </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Segment end. </p>
</div>
</div>
<a class="anchor" id="a105348291a24edfce16b8fa243793fb4"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">geos::geom::LineSegment::LineSegment </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a> &amp;&#160;</td>
<td class="paramname"><em>c0</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a> &amp;&#160;</td>
<td class="paramname"><em>c1</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Constructs a <a class="el" href="classgeos_1_1geom_1_1LineSegment.html">LineSegment</a> with the given start and end Coordinates. </p>
</div>
</div>
<a class="anchor" id="ad2ff6b0bb555727c6bd9e7e97c637ccb"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">geos::geom::LineSegment::LineSegment </td>
<td>(</td>
<td class="paramtype">double&#160;</td>
<td class="paramname"><em>x0</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double&#160;</td>
<td class="paramname"><em>y0</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double&#160;</td>
<td class="paramname"><em>x1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double&#160;</td>
<td class="paramname"><em>y1</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a55f97e764496162bdcb2c15e9042c3b0"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">double geos::geom::LineSegment::angle </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>the angle this segment makes with the x-axis (in radians) </dd></dl>
</div>
</div>
<a class="anchor" id="a32476249bd06932a852b00e335757a5d"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void geos::geom::LineSegment::closestPoint </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a> &amp;&#160;</td>
<td class="paramname"><em>p</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a> &amp;&#160;</td>
<td class="paramname"><em>ret</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Computes the closest point on this line segment to another point. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">p</td><td>the point to find the closest point to </td></tr>
<tr><td class="paramname">ret</td><td>the <a class="el" href="classgeos_1_1geom_1_1Coordinate.html" title="Coordinate is the lightweight class used to store coordinates. ">Coordinate</a> to which the closest point on the line segment to the point p will be written </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="ab8ae09bfaf7f7cd92d6d571a4f3d72b4"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">std::array&lt;<a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a>, 2&gt; geos::geom::LineSegment::closestPoints </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1LineSegment.html">LineSegment</a> &amp;&#160;</td>
<td class="paramname"><em>line</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Computes the closest points on two line segments. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">line</td><td>the line segment to find the closest points to </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a pair of Coordinates which are the closest points on the line segments. </dd></dl>
</div>
</div>
<a class="anchor" id="aba35a85f555dd1c361ace249c293cc77"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">std::array&lt;<a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a>, 2&gt; geos::geom::LineSegment::closestPoints </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1LineSegment.html">LineSegment</a> *&#160;</td>
<td class="paramname"><em>line</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="a5b96fff51bec598be67c1a0add93263e"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int geos::geom::LineSegment::compareTo </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1LineSegment.html">LineSegment</a> &amp;&#160;</td>
<td class="paramname"><em>other</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Compares this object with the specified object for order. </p>
<p>Uses the standard lexicographic ordering for the points in the <a class="el" href="classgeos_1_1geom_1_1LineSegment.html">LineSegment</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">other</td><td>the <a class="el" href="classgeos_1_1geom_1_1LineSegment.html">LineSegment</a> with which this <a class="el" href="classgeos_1_1geom_1_1LineSegment.html">LineSegment</a> is being compared </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a negative integer, zero, or a positive integer as this <a class="el" href="classgeos_1_1geom_1_1LineSegment.html">LineSegment</a> is less than, equal to, or greater than the specified <a class="el" href="classgeos_1_1geom_1_1LineSegment.html">LineSegment</a> </dd></dl>
</div>
</div>
<a class="anchor" id="a21859b2efae5bf0c6718cb69c36bd64f"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">double geos::geom::LineSegment::distance </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1LineSegment.html">LineSegment</a> &amp;&#160;</td>
<td class="paramname"><em>ls</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Computes the distance between this line segment and another one. </p>
</div>
</div>
<a class="anchor" id="a81d6bfa59368dca81ee820b250b6653f"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">double geos::geom::LineSegment::distance </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a> &amp;&#160;</td>
<td class="paramname"><em>p</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Computes the distance between this line segment and a point. </p>
</div>
</div>
<a class="anchor" id="a47e38e1b78e9dadaff5a8cf039be2b15"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">double geos::geom::LineSegment::distancePerpendicular </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a> &amp;&#160;</td>
<td class="paramname"><em>p</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Computes the perpendicular distance between the (infinite) line defined by this line segment and a point. </p>
</div>
</div>
<a class="anchor" id="a4f8d76d0fafccf247b69953aab3896a0"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool geos::geom::LineSegment::equalsTopo </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1LineSegment.html">LineSegment</a> &amp;&#160;</td>
<td class="paramname"><em>other</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns <code>true</code> if <code>other</code> is topologically equal to this <a class="el" href="classgeos_1_1geom_1_1LineSegment.html">LineSegment</a> (e.g. irrespective of orientation). </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">other</td><td>a <code><a class="el" href="classgeos_1_1geom_1_1LineSegment.html">LineSegment</a></code> with which to do the comparison. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if other is a <a class="el" href="classgeos_1_1geom_1_1LineSegment.html">LineSegment</a> with the same values for the x and y ordinates. </dd></dl>
</div>
</div>
<a class="anchor" id="a1fe66eb4b8536e7ec078fa7e1942d78d"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">double geos::geom::LineSegment::getLength </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Computes the length of the line segment. </p>
</div>
</div>
<a class="anchor" id="a5927c9e7d564872967a78d7bf7c03b14"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a> geos::geom::LineSegment::intersection </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1LineSegment.html">LineSegment</a> &amp;&#160;</td>
<td class="paramname"><em>line</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Computes an intersection point between two segments, if there is one. There may be 0, 1 or many intersection points between two segments. If there are 0, null is returned. If there is 1 or more, a single one is returned (chosen at the discretion of the algorithm). If more information is required about the details of the intersection, the LineIntersector class should be used.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">line</td><td></td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>intersection if found, setNull() otherwise </dd></dl>
</div>
</div>
<a class="anchor" id="a8391aa2103c0116e38e9dc7b1e28f36e"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool geos::geom::LineSegment::isHorizontal </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Tests whether the segment is horizontal.</p>
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if the segment is horizontal </dd></dl>
</div>
</div>
<a class="anchor" id="a3a0e0267d47cfa11c26ea338febe3b4c"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool geos::geom::LineSegment::isVertical </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Tests whether the segment is vertical.</p>
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if the segment is vertical </dd></dl>
</div>
</div>
<a class="anchor" id="aebc30f05f2b666daeda0d7e2d27f0945"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a> geos::geom::LineSegment::lineIntersection </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1LineSegment.html">LineSegment</a> &amp;&#160;</td>
<td class="paramname"><em>line</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Computes the intersection point of the lines defined by two segments, if there is one. </p>
<p>There may be 0, 1 or an infinite number of intersection points between two lines. If there is a unique intersection point, it is returned. Otherwise, <code>null</code> is returned. If more information is required about the details of the intersection, the algorithms::LineIntersector class should be used.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">line</td><td>a line segment defining a straight line </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>intersection if found, setNull() otherwise </dd></dl>
</div>
</div>
<a class="anchor" id="a90f621b439f8c48c424568477e53d9ad"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void geos::geom::LineSegment::midPoint </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a> &amp;&#160;</td>
<td class="paramname"><em>ret</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Computes the midpoint of the segment. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">ret</td><td>will be set to the midpoint of the segment </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a80f3d6aab7d8a3e527833731194f7b72"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void geos::geom::LineSegment::normalize </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Puts the line segment into a normalized form. </p>
<p>This is useful for using line segments in maps and indexes when topological equality rather than exact equality is desired. </p>
</div>
</div>
<a class="anchor" id="ad0fe993f3ef8b05ce1174987a5ecb5dd"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a>&amp; geos::geom::LineSegment::operator[] </td>
<td>(</td>
<td class="paramtype">std::size_t&#160;</td>
<td class="paramname"><em>i</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="a9b52f3e9aeb52d5b5ca694696f06299f"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a>&amp; geos::geom::LineSegment::operator[] </td>
<td>(</td>
<td class="paramtype">std::size_t&#160;</td>
<td class="paramname"><em>i</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="a716d81e2e4b4cc445f4972e1515ced3a"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int geos::geom::LineSegment::orientationIndex </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1LineSegment.html">LineSegment</a> &amp;&#160;</td>
<td class="paramname"><em>seg</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Determines the orientation of a <a class="el" href="classgeos_1_1geom_1_1LineSegment.html">LineSegment</a> relative to this segment. The concept of orientation is specified as follows: Given two line segments A and L, </p><ul>
<li>
A is to the left of a segment L if A lies wholly in the closed half-plane lying to the left of L </li>
<li>
A is to the right of a segment L if A lies wholly in the closed half-plane lying to the right of L </li>
<li>
otherwise, A has indeterminate orientation relative to L. This happens if A is collinear with L or if A crosses the line determined by L. </li>
</ul>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">seg</td><td>the <a class="el" href="classgeos_1_1geom_1_1LineSegment.html">LineSegment</a> to compare</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>1 if seg is to the left of this segment </dd>
<dd>
-1 if seg is to the right of this segment </dd>
<dd>
0 if seg has indeterminate orientation relative to this segment </dd></dl>
</div>
</div>
<a class="anchor" id="ac66881f2ff1268940d892a79a03eee92"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int geos::geom::LineSegment::orientationIndex </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1LineSegment.html">LineSegment</a> *&#160;</td>
<td class="paramname"><em>seg</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="a7eb5055c4a37d5a9f4a2a86f1af18363"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int geos::geom::LineSegment::orientationIndex </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a> &amp;&#160;</td>
<td class="paramname"><em>p</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Determines the orientation index of a <a class="el" href="classgeos_1_1geom_1_1Coordinate.html" title="Coordinate is the lightweight class used to store coordinates. ">Coordinate</a> relative to this segment. </p>
<p>The orientation index is as defined in Orientation::index.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">p</td><td>the <a class="el" href="classgeos_1_1geom_1_1Coordinate.html" title="Coordinate is the lightweight class used to store coordinates. ">Coordinate</a> to compare</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>1 if <code>p</code> is to the left of this segment </dd>
<dd>
-1 if <code>p</code> is to the right of this segment </dd>
<dd>
0 if <code>p</code> is collinear with this segment</dd></dl>
<dl class="section see"><dt>See also</dt><dd>Orientation::index(<a class="el" href="classgeos_1_1geom_1_1Coordinate.html" title="Coordinate is the lightweight class used to store coordinates. ">Coordinate</a>, <a class="el" href="classgeos_1_1geom_1_1Coordinate.html" title="Coordinate is the lightweight class used to store coordinates. ">Coordinate</a>, <a class="el" href="classgeos_1_1geom_1_1Coordinate.html" title="Coordinate is the lightweight class used to store coordinates. ">Coordinate</a>) </dd></dl>
</div>
</div>
<a class="anchor" id="a8756a769e85cf820f66044987f504848"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void geos::geom::LineSegment::pointAlong </td>
<td>(</td>
<td class="paramtype">double&#160;</td>
<td class="paramname"><em>segmentLengthFraction</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a> &amp;&#160;</td>
<td class="paramname"><em>ret</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Computes the <a class="el" href="classgeos_1_1geom_1_1Coordinate.html" title="Coordinate is the lightweight class used to store coordinates. ">Coordinate</a> that lies a given fraction along the line defined by this segment. </p>
<p>A fraction of <code>0.0</code> returns the start point of the segment; a fraction of <code>1.0</code> returns the end point of the segment. If the fraction is &lt; 0.0 or &gt; 1.0 the point returned will lie before the start or beyond the end of the segment.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">segmentLengthFraction</td><td>the fraction of the segment length along the line </td></tr>
<tr><td class="paramname">ret</td><td>will be set to the point at that distance </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="ab3444614a2f2e056aec36d360dec264b"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void geos::geom::LineSegment::pointAlongOffset </td>
<td>(</td>
<td class="paramtype">double&#160;</td>
<td class="paramname"><em>segmentLengthFraction</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double&#160;</td>
<td class="paramname"><em>offsetDistance</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a> &amp;&#160;</td>
<td class="paramname"><em>ret</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Computes the <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a> that lies a given fraction along the line defined by this segment and offset from the segment by a given distance. </p>
<p>A fraction of <code>0.0</code> offsets from the start point of the segment; a fraction of <code>1.0</code> offsets from the end point of the segment.</p>
<p>The computed point is offset to the left of the line if the offset distance is positive, to the right if negative.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">segmentLengthFraction</td><td>the fraction of the segment length along the line</td></tr>
<tr><td class="paramname">offsetDistance</td><td>the distance the point is offset from the segment (positive is to the left, negative is to the right)</td></tr>
<tr><td class="paramname">ret</td><td>will be set to the point at that distance and offset</td></tr>
</table>
</dd>
</dl>
<dl class="exception"><dt>Exceptions</dt><dd>
<table class="exception">
<tr><td class="paramname">IllegalStateException</td><td>if the segment has zero length </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="ad4468ac21831e174364a8b9b022b4057"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void geos::geom::LineSegment::project </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a> &amp;&#160;</td>
<td class="paramname"><em>p</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a> &amp;&#160;</td>
<td class="paramname"><em>ret</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Compute the projection of a point onto the line determined by this line segment. </p>
<p>Note that the projected point may lie outside the line segment. If this is the case, the projection factor will lie outside the range [0.0, 1.0]. </p>
</div>
</div>
<a class="anchor" id="a33bb21b64638ca65f54cb2f7ddf8deec"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool geos::geom::LineSegment::project </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1LineSegment.html">LineSegment</a> &amp;&#160;</td>
<td class="paramname"><em>seg</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="classgeos_1_1geom_1_1LineSegment.html">LineSegment</a> &amp;&#160;</td>
<td class="paramname"><em>ret</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Project a line segment onto this line segment and return the resulting line segment. </p>
<p>The returned line segment will be a subset of the target line line segment. This subset may be null, if the segments are oriented in such a way that there is no projection.</p>
<p>Note that the returned line may have zero length (i.e. the same endpoints). This can happen for instance if the lines are perpendicular to one another.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">seg</td><td>the line segment to project </td></tr>
<tr><td class="paramname">ret</td><td>the projected line segment </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if there is an overlap, false otherwise </dd></dl>
</div>
</div>
<a class="anchor" id="a40296de9666ba70e56873a3bc19293da"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">double geos::geom::LineSegment::projectionFactor </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a> &amp;&#160;</td>
<td class="paramname"><em>p</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Compute the projection factor for the projection of the point p onto this <a class="el" href="classgeos_1_1geom_1_1LineSegment.html">LineSegment</a>. </p>
<p>The projection factor is the constant r by which the vector for this segment must be multiplied to equal the vector for the projection of p on the line defined by this segment.</p>
<p>The projection factor returned will be in the range (-inf, +inf)</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">p</td><td>the point to compute the factor for</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the projection factor for the point </dd></dl>
</div>
</div>
<a class="anchor" id="a6d69f6d61ad2dbe03eafae4e73a23116"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void geos::geom::LineSegment::reverse </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Reverses the direction of the line segment. </p>
</div>
</div>
<a class="anchor" id="ada37d3025cb4a1ccd40405f8c14fc0bb"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">double geos::geom::LineSegment::segmentFraction </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a> &amp;&#160;</td>
<td class="paramname"><em>inputPt</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Computes the fraction of distance (in <code>[0.0, 1.0]</code>) that the projection of a point occurs along this line segment. </p>
<p>If the point is beyond either ends of the line segment, the closest fractional value (<code>0.0</code> or <code>1.0</code>) is returned.</p>
<p>Essentially, this is the <a class="el" href="classgeos_1_1geom_1_1LineSegment.html#a40296de9666ba70e56873a3bc19293da">projectionFactor</a> clamped to the range <code>[0.0, 1.0]</code>.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">inputPt</td><td>the point </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the fraction along the line segment the projection of the point occurs </dd></dl>
</div>
</div>
<a class="anchor" id="ab9935eb41cd0e137612d8f0728f5e28b"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void geos::geom::LineSegment::setCoordinates </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a> &amp;&#160;</td>
<td class="paramname"><em>c0</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a> &amp;&#160;</td>
<td class="paramname"><em>c1</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="aa8192c84e07aa76f514b37627fa98fba"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void geos::geom::LineSegment::setCoordinates </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1LineSegment.html">LineSegment</a> &amp;&#160;</td>
<td class="paramname"><em>ls</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="a7a377d2bd1bf564e69f0fc1411c11d87"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">std::unique_ptr&lt;<a class="el" href="classgeos_1_1geom_1_1LineString.html">LineString</a>&gt; geos::geom::LineSegment::toGeometry </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1GeometryFactory.html">GeometryFactory</a> &amp;&#160;</td>
<td class="paramname"><em>gf</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Creates a <a class="el" href="classgeos_1_1geom_1_1LineString.html">LineString</a> with the same coordinates as this segment</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">gf</td><td>the geometery factory to use </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a <a class="el" href="classgeos_1_1geom_1_1LineString.html">LineString</a> with the same geometry as this segment </dd></dl>
</div>
</div>
<h2 class="groupheader">Friends And Related Function Documentation</h2>
<a class="anchor" id="ad7f0e1ac0c774fca24372d1181e5748f"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">std::ostream&amp; operator&lt;&lt; </td>
<td>(</td>
<td class="paramtype">std::ostream &amp;&#160;</td>
<td class="paramname"><em>o</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1LineSegment.html">LineSegment</a> &amp;&#160;</td>
<td class="paramname"><em>l</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a class="anchor" id="ac3286355f41210086e4eab4498b46ba9"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a> geos::geom::LineSegment::p0</td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="LineSegment_8h_source.html#l00064">64</a> of file <a class="el" href="LineSegment_8h_source.html">LineSegment.h</a>.</p>
<p>Referenced by <a class="el" href="LineSegment_8h_source.html#l00365">geos::geom::LineSegment::HashCode::operator()()</a>.</p>
</div>
</div>
<a class="anchor" id="a9382e49d86a10de5d5be69560824d900"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classgeos_1_1geom_1_1Coordinate.html">Coordinate</a> geos::geom::LineSegment::p1</td>
</tr>
</table>
</div><div class="memdoc">
<p>Segment start. </p>
<p>Definition at line <a class="el" href="LineSegment_8h_source.html#l00066">66</a> of file <a class="el" href="LineSegment_8h_source.html">LineSegment.h</a>.</p>
<p>Referenced by <a class="el" href="LineSegment_8h_source.html#l00365">geos::geom::LineSegment::HashCode::operator()()</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="LineSegment_8h_source.html">LineSegment.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>