<!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>GEOS: geos::algorithm::Angle Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.7.1 --> <div class="navigation" id="top"> <div class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related 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 class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class List</span></a></li> <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Class Members</span></a></li> </ul> </div> <div class="navpath"> <ul> <li><a class="el" href="namespacegeos.html">geos</a> </li> <li><a class="el" href="namespacegeos_1_1algorithm.html">algorithm</a> </li> <li><a class="el" href="classgeos_1_1algorithm_1_1Angle.html">geos::algorithm::Angle</a> </li> </ul> </div> </div> <div class="header"> <div class="summary"> <a href="#pub-static-methods">Static Public Member Functions</a> | <a href="#pub-static-attribs">Static Public Attributes</a> </div> <div class="headertitle"> <h1>geos::algorithm::Angle Class Reference</h1> </div> </div> <div class="contents"> <!-- doxytag: class="geos::algorithm::Angle" --> <p>Utility functions for working with angles. <a href="#_details">More...</a></p> <p><code>#include <<a class="el" href="Angle_8h_source.html">Angle.h</a>></code></p> <p><a href="classgeos_1_1algorithm_1_1Angle-members.html">List of all members.</a></p> <table class="memberdecls"> <tr><td colspan="2"><h2><a name="pub-static-methods"></a> Static Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">static double </td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1algorithm_1_1Angle.html#a9ad83c541e462f7e87f4ccb4453aa6ef">toDegrees</a> (double radians)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Converts from radians to degrees. <a href="#a9ad83c541e462f7e87f4ccb4453aa6ef"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">static double </td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1algorithm_1_1Angle.html#aeb3a56d12a8acaf534be3a9be1e66885">toRadians</a> (double angleDegrees)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Converts from degrees to radians. <a href="#aeb3a56d12a8acaf534be3a9be1e66885"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">static double </td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1algorithm_1_1Angle.html#a1510a92c16299367c5eeb982e1ac8209">angle</a> (const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> &p0, const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> &p1)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the angle of the vector from p0 to p1, relative to the positive X-axis. <a href="#a1510a92c16299367c5eeb982e1ac8209"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">static double </td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1algorithm_1_1Angle.html#aee4dad3c63ac27529705e72bc44c315b">angle</a> (const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> &p)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the angle that the vector from (0,0) to p, relative to the positive X-axis. <a href="#aee4dad3c63ac27529705e72bc44c315b"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1algorithm_1_1Angle.html#a8ead08040de37e155075f32439c7c3b3">isAcute</a> (const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> &p0, const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> &p1, const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> &p2)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Tests whether the angle between p0-p1-p2 is acute. <a href="#a8ead08040de37e155075f32439c7c3b3"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1algorithm_1_1Angle.html#a43f4f2031e72038b9e6931da59330954">isObtuse</a> (const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> &p0, const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> &p1, const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> &p2)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Tests whether the angle between p0-p1-p2 is obtuse. <a href="#a43f4f2031e72038b9e6931da59330954"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">static double </td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1algorithm_1_1Angle.html#a37b9b3ef28618d538e459d9171331190">angleBetween</a> (const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> &tip1, const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> &tail, const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> &tip2)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the unoriented smallest angle between two vectors. <a href="#a37b9b3ef28618d538e459d9171331190"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">static double </td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1algorithm_1_1Angle.html#af483a721dcfc7506f70d3085408f991c">angleBetweenOriented</a> (const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> &tip1, const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> &tail, const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> &tip2)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the oriented smallest angle between two vectors. <a href="#af483a721dcfc7506f70d3085408f991c"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">static double </td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1algorithm_1_1Angle.html#a7d0faa9a4613314b73a211afbd475b2c">interiorAngle</a> (const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> &p0, const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> &p1, const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> &p2)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Computes the interior angle between two segments of a ring. <a href="#a7d0faa9a4613314b73a211afbd475b2c"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1algorithm_1_1Angle.html#a4e25f61567be2ab03f92d36c775a9b9b">getTurn</a> (double ang1, double ang2)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns whether an angle must turn clockwise or counterclockwise to overlap another angle. <a href="#a4e25f61567be2ab03f92d36c775a9b9b"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">static double </td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1algorithm_1_1Angle.html#ad9ba65b29aaae8715cbf5d77dc7da077">normalize</a> (double angle)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Computes the normalized value of an angle, which is the equivalent angle in the range ( -Pi, Pi ]. <a href="#ad9ba65b29aaae8715cbf5d77dc7da077"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">static double </td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1algorithm_1_1Angle.html#aad6d7eb020edf56d3289bb58b7235997">normalizePositive</a> (double angle)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Computes the normalized positive value of an angle, which is the equivalent angle in the range [ 0, 2*Pi ). <a href="#aad6d7eb020edf56d3289bb58b7235997"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">static double </td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1algorithm_1_1Angle.html#a11b9891ce2c21eb4988bcb18ac245e25">diff</a> (double ang1, double ang2)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Computes the unoriented smallest difference between two angles. <a href="#a11b9891ce2c21eb4988bcb18ac245e25"></a><br/></td></tr> <tr><td colspan="2"><h2><a name="pub-static-attribs"></a> Static Public Attributes</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a851066e4c1a956519a623286cdeeeeba"></a><!-- doxytag: member="geos::algorithm::Angle::PI_TIMES_2" ref="a851066e4c1a956519a623286cdeeeeba" args="" --> static const double </td><td class="memItemRight" valign="bottom"><b>PI_TIMES_2</b></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4c5129ca94c6f102f0fd1530991a6c3e"></a><!-- doxytag: member="geos::algorithm::Angle::PI_OVER_2" ref="a4c5129ca94c6f102f0fd1530991a6c3e" args="" --> static const double </td><td class="memItemRight" valign="bottom"><b>PI_OVER_2</b></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab8fd7a590539526f27db780043138eb1"></a><!-- doxytag: member="geos::algorithm::Angle::PI_OVER_4" ref="ab8fd7a590539526f27db780043138eb1" args="" --> static const double </td><td class="memItemRight" valign="bottom"><b>PI_OVER_4</b></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a735054807eb53b763cc95b8807642ee4"></a><!-- doxytag: member="geos::algorithm::Angle::COUNTERCLOCKWISE" ref="a735054807eb53b763cc95b8807642ee4" args="" --> static const int </td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1algorithm_1_1Angle.html#a735054807eb53b763cc95b8807642ee4">COUNTERCLOCKWISE</a> = CGAlgorithms::COUNTERCLOCKWISE</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Constant representing counterclockwise orientation. <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5429234c5e29ec6f331320d2883fdcf9"></a><!-- doxytag: member="geos::algorithm::Angle::CLOCKWISE" ref="a5429234c5e29ec6f331320d2883fdcf9" args="" --> static const int </td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1algorithm_1_1Angle.html#a5429234c5e29ec6f331320d2883fdcf9">CLOCKWISE</a> = CGAlgorithms::CLOCKWISE</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Constant representing clockwise orientation. <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7a698bf884ab1d18c9a2508b6ee67e8d"></a><!-- doxytag: member="geos::algorithm::Angle::NONE" ref="a7a698bf884ab1d18c9a2508b6ee67e8d" args="" --> static const int </td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1algorithm_1_1Angle.html#a7a698bf884ab1d18c9a2508b6ee67e8d">NONE</a> = CGAlgorithms::COLLINEAR</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Constant representing no orientation. <br/></td></tr> </table> <hr/><a name="_details"></a><h2>Detailed Description</h2> <p>Utility functions for working with angles. </p> <p>Unless otherwise noted, methods in this class express angles in radians. </p> <hr/><h2>Member Function Documentation</h2> <a class="anchor" id="a1510a92c16299367c5eeb982e1ac8209"></a><!-- doxytag: member="geos::algorithm::Angle::angle" ref="a1510a92c16299367c5eeb982e1ac8209" args="(const geom::Coordinate &p0, const geom::Coordinate &p1)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">static double geos::algorithm::Angle::angle </td> <td>(</td> <td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> & </td> <td class="paramname"> <em>p0</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> & </td> <td class="paramname"> <em>p1</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td><code> [static]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Returns the angle of the vector from p0 to p1, relative to the positive X-axis. </p> <p>The angle is normalized to be in the range [ -Pi, Pi ].</p> <dl class="return"><dt><b>Returns:</b></dt><dd>the normalized angle (in radians) that p0-p1 makes with the positive x-axis. </dd></dl> </div> </div> <a class="anchor" id="aee4dad3c63ac27529705e72bc44c315b"></a><!-- doxytag: member="geos::algorithm::Angle::angle" ref="aee4dad3c63ac27529705e72bc44c315b" args="(const geom::Coordinate &p)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">static double geos::algorithm::Angle::angle </td> <td>(</td> <td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> & </td> <td class="paramname"> <em>p</em></td> <td> ) </td> <td><code> [static]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Returns the angle that the vector from (0,0) to p, relative to the positive X-axis. </p> <p>The angle is normalized to be in the range ( -Pi, Pi ].</p> <dl class="return"><dt><b>Returns:</b></dt><dd>the normalized angle (in radians) that p makes with the positive x-axis. </dd></dl> </div> </div> <a class="anchor" id="a37b9b3ef28618d538e459d9171331190"></a><!-- doxytag: member="geos::algorithm::Angle::angleBetween" ref="a37b9b3ef28618d538e459d9171331190" args="(const geom::Coordinate &tip1, const geom::Coordinate &tail, const geom::Coordinate &tip2)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">static double geos::algorithm::Angle::angleBetween </td> <td>(</td> <td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> & </td> <td class="paramname"> <em>tip1</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> & </td> <td class="paramname"> <em>tail</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> & </td> <td class="paramname"> <em>tip2</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td><code> [static]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Returns the unoriented smallest angle between two vectors. </p> <p>The computed angle will be in the range [0, Pi).</p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>tip1</em> </td><td>the tip of one vector </td></tr> <tr><td valign="top"></td><td valign="top"><em>tail</em> </td><td>the tail of each vector </td></tr> <tr><td valign="top"></td><td valign="top"><em>tip2</em> </td><td>the tip of the other vector </td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>the angle between tail-tip1 and tail-tip2 </dd></dl> </div> </div> <a class="anchor" id="af483a721dcfc7506f70d3085408f991c"></a><!-- doxytag: member="geos::algorithm::Angle::angleBetweenOriented" ref="af483a721dcfc7506f70d3085408f991c" args="(const geom::Coordinate &tip1, const geom::Coordinate &tail, const geom::Coordinate &tip2)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">static double geos::algorithm::Angle::angleBetweenOriented </td> <td>(</td> <td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> & </td> <td class="paramname"> <em>tip1</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> & </td> <td class="paramname"> <em>tail</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> & </td> <td class="paramname"> <em>tip2</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td><code> [static]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Returns the oriented smallest angle between two vectors. </p> <p>The computed angle will be in the range (-Pi, Pi]. A positive result corresponds to a counterclockwise rotation from v1 to v2; a negative result corresponds to a clockwise rotation.</p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>tip1</em> </td><td>the tip of v1 </td></tr> <tr><td valign="top"></td><td valign="top"><em>tail</em> </td><td>the tail of each vector </td></tr> <tr><td valign="top"></td><td valign="top"><em>tip2</em> </td><td>the tip of v2 </td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>the angle between v1 and v2, relative to v1 </dd></dl> </div> </div> <a class="anchor" id="a11b9891ce2c21eb4988bcb18ac245e25"></a><!-- doxytag: member="geos::algorithm::Angle::diff" ref="a11b9891ce2c21eb4988bcb18ac245e25" args="(double ang1, double ang2)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">static double geos::algorithm::Angle::diff </td> <td>(</td> <td class="paramtype">double </td> <td class="paramname"> <em>ang1</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">double </td> <td class="paramname"> <em>ang2</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td><code> [static]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Computes the unoriented smallest difference between two angles. </p> <p>The angles are assumed to be normalized to the range [-Pi, Pi]. The result will be in the range [0, Pi].</p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>ang1</em> </td><td>the angle of one vector (in [-Pi, Pi] ) </td></tr> <tr><td valign="top"></td><td valign="top"><em>ang2</em> </td><td>the angle of the other vector (in range [-Pi, Pi] ) </td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>the angle (in radians) between the two vectors (in range [0, Pi] ) </dd></dl> </div> </div> <a class="anchor" id="a4e25f61567be2ab03f92d36c775a9b9b"></a><!-- doxytag: member="geos::algorithm::Angle::getTurn" ref="a4e25f61567be2ab03f92d36c775a9b9b" args="(double ang1, double ang2)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">static int geos::algorithm::Angle::getTurn </td> <td>(</td> <td class="paramtype">double </td> <td class="paramname"> <em>ang1</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">double </td> <td class="paramname"> <em>ang2</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td><code> [static]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Returns whether an angle must turn clockwise or counterclockwise to overlap another angle. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>ang1</em> </td><td>an angle (in radians) </td></tr> <tr><td valign="top"></td><td valign="top"><em>ang2</em> </td><td>an angle (in radians) </td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>whether a1 must turn CLOCKWISE, COUNTERCLOCKWISE or NONE to overlap a2. </dd></dl> </div> </div> <a class="anchor" id="a7d0faa9a4613314b73a211afbd475b2c"></a><!-- doxytag: member="geos::algorithm::Angle::interiorAngle" ref="a7d0faa9a4613314b73a211afbd475b2c" args="(const geom::Coordinate &p0, const geom::Coordinate &p1, const geom::Coordinate &p2)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">static double geos::algorithm::Angle::interiorAngle </td> <td>(</td> <td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> & </td> <td class="paramname"> <em>p0</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> & </td> <td class="paramname"> <em>p1</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> & </td> <td class="paramname"> <em>p2</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td><code> [static]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Computes the interior angle between two segments of a ring. </p> <p>The ring is assumed to be oriented in a clockwise direction. The computed angle will be in the range [0, 2Pi]</p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>p0</em> </td><td>a point of the ring </td></tr> <tr><td valign="top"></td><td valign="top"><em>p1</em> </td><td>the next point of the ring </td></tr> <tr><td valign="top"></td><td valign="top"><em>p2</em> </td><td>the next point of the ring </td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>the interior angle based at <code>p1</code> </dd></dl> </div> </div> <a class="anchor" id="a8ead08040de37e155075f32439c7c3b3"></a><!-- doxytag: member="geos::algorithm::Angle::isAcute" ref="a8ead08040de37e155075f32439c7c3b3" args="(const geom::Coordinate &p0, const geom::Coordinate &p1, const geom::Coordinate &p2)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">static bool geos::algorithm::Angle::isAcute </td> <td>(</td> <td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> & </td> <td class="paramname"> <em>p0</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> & </td> <td class="paramname"> <em>p1</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> & </td> <td class="paramname"> <em>p2</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td><code> [static]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Tests whether the angle between p0-p1-p2 is acute. </p> <p>An angle is acute if it is less than 90 degrees.</p> <p>Note: this implementation is not precise (determistic) for angles very close to 90 degrees.</p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>p0</em> </td><td>an endpoint of the angle </td></tr> <tr><td valign="top"></td><td valign="top"><em>p1</em> </td><td>the base of the angle </td></tr> <tr><td valign="top"></td><td valign="top"><em>p2</em> </td><td>the other endpoint of the angle </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="a43f4f2031e72038b9e6931da59330954"></a><!-- doxytag: member="geos::algorithm::Angle::isObtuse" ref="a43f4f2031e72038b9e6931da59330954" args="(const geom::Coordinate &p0, const geom::Coordinate &p1, const geom::Coordinate &p2)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">static bool geos::algorithm::Angle::isObtuse </td> <td>(</td> <td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> & </td> <td class="paramname"> <em>p0</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> & </td> <td class="paramname"> <em>p1</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> & </td> <td class="paramname"> <em>p2</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td><code> [static]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Tests whether the angle between p0-p1-p2 is obtuse. </p> <p>An angle is obtuse if it is greater than 90 degrees.</p> <p>Note: this implementation is not precise (determistic) for angles very close to 90 degrees.</p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>p0</em> </td><td>an endpoint of the angle </td></tr> <tr><td valign="top"></td><td valign="top"><em>p1</em> </td><td>the base of the angle </td></tr> <tr><td valign="top"></td><td valign="top"><em>p2</em> </td><td>the other endpoint of the angle </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="ad9ba65b29aaae8715cbf5d77dc7da077"></a><!-- doxytag: member="geos::algorithm::Angle::normalize" ref="ad9ba65b29aaae8715cbf5d77dc7da077" args="(double angle)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">static double geos::algorithm::Angle::normalize </td> <td>(</td> <td class="paramtype">double </td> <td class="paramname"> <em>angle</em></td> <td> ) </td> <td><code> [static]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Computes the normalized value of an angle, which is the equivalent angle in the range ( -Pi, Pi ]. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>angle</em> </td><td>the angle to normalize </td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>an equivalent angle in the range (-Pi, Pi] </dd></dl> </div> </div> <a class="anchor" id="aad6d7eb020edf56d3289bb58b7235997"></a><!-- doxytag: member="geos::algorithm::Angle::normalizePositive" ref="aad6d7eb020edf56d3289bb58b7235997" args="(double angle)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">static double geos::algorithm::Angle::normalizePositive </td> <td>(</td> <td class="paramtype">double </td> <td class="paramname"> <em>angle</em></td> <td> ) </td> <td><code> [static]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Computes the normalized positive value of an angle, which is the equivalent angle in the range [ 0, 2*Pi ). </p> <p>E.g.:</p> <ul> <li>normalizePositive(0.0) = 0.0</li> <li>normalizePositive(-PI) = PI</li> <li>normalizePositive(-2PI) = 0.0</li> <li>normalizePositive(-3PI) = PI</li> <li>normalizePositive(-4PI) = 0</li> <li>normalizePositive(PI) = PI</li> <li>normalizePositive(2PI) = 0.0</li> <li>normalizePositive(3PI) = PI</li> <li>normalizePositive(4PI) = 0.0</li> </ul> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>angle</em> </td><td>the angle to normalize, in radians </td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>an equivalent positive angle </dd></dl> </div> </div> <a class="anchor" id="a9ad83c541e462f7e87f4ccb4453aa6ef"></a><!-- doxytag: member="geos::algorithm::Angle::toDegrees" ref="a9ad83c541e462f7e87f4ccb4453aa6ef" args="(double radians)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">static double geos::algorithm::Angle::toDegrees </td> <td>(</td> <td class="paramtype">double </td> <td class="paramname"> <em>radians</em></td> <td> ) </td> <td><code> [static]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Converts from radians to degrees. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>radians</em> </td><td>an angle in radians </td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>the angle in degrees </dd></dl> </div> </div> <a class="anchor" id="aeb3a56d12a8acaf534be3a9be1e66885"></a><!-- doxytag: member="geos::algorithm::Angle::toRadians" ref="aeb3a56d12a8acaf534be3a9be1e66885" args="(double angleDegrees)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">static double geos::algorithm::Angle::toRadians </td> <td>(</td> <td class="paramtype">double </td> <td class="paramname"> <em>angleDegrees</em></td> <td> ) </td> <td><code> [static]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Converts from degrees to radians. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>angleDegrees</em> </td><td>an angle in degrees </td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>the angle in radians </dd></dl> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li><a class="el" href="Angle_8h_source.html">Angle.h</a></li> </ul> </div> <hr class="footer"/><address class="footer"><small>Generated on Thu Jul 22 2010 for GEOS by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.1 </small></address> </body> </html>