classline.html

来自「仿真人工智能是指用人工的方法和技术」· HTML 代码 · 共 873 行 · 第 1/3 页

HTML
873
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>Line class Reference</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body bgcolor="#ffffff"><!-- Generated by Doxygen 1.2.12 --><center><a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="globals.html">File Members</a> &nbsp; </center><hr><h1>Line  Class Reference</h1><code>#include &lt;<a class="el" href="Geometry_8h-source.html">Geometry.h</a>&gt;</code><p><a href="classLine-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0><tr><td colspan=2><br><h2>Public Methods</h2></td></tr><tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="classLine.html#a0">Line</a> (double a, double b, double c)</td></tr><tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classLine.html#a1">show</a> (ostream &amp;os=cout)</td></tr><tr><td nowrap align=right valign=top><a class="el" href="classVecPosition.html">VecPosition</a>&nbsp;</td><td valign=bottom><a class="el" href="classLine.html#a2">getIntersection</a> (Line line)</td></tr><tr><td nowrap align=right valign=top>int&nbsp;</td><td valign=bottom><a class="el" href="classLine.html#a3">getCircleIntersectionPoints</a> (<a class="el" href="classCircle.html">Circle</a> circle, <a class="el" href="classVecPosition.html">VecPosition</a> *posSolution1, <a class="el" href="classVecPosition.html">VecPosition</a> *posSolution2)</td></tr><tr><td nowrap align=right valign=top>Line&nbsp;</td><td valign=bottom><a class="el" href="classLine.html#a4">getTangentLine</a> (<a class="el" href="classVecPosition.html">VecPosition</a> pos)</td></tr><tr><td nowrap align=right valign=top><a class="el" href="classVecPosition.html">VecPosition</a>&nbsp;</td><td valign=bottom><a class="el" href="classLine.html#a5">getPointOnLineClosestTo</a> (<a class="el" href="classVecPosition.html">VecPosition</a> pos)</td></tr><tr><td nowrap align=right valign=top>double&nbsp;</td><td valign=bottom><a class="el" href="classLine.html#a6">getDistanceWithPoint</a> (<a class="el" href="classVecPosition.html">VecPosition</a> pos)</td></tr><tr><td nowrap align=right valign=top>bool&nbsp;</td><td valign=bottom><a class="el" href="classLine.html#a7">isInBetween</a> (<a class="el" href="classVecPosition.html">VecPosition</a> pos, <a class="el" href="classVecPosition.html">VecPosition</a> point1, <a class="el" href="classVecPosition.html">VecPosition</a> point2)</td></tr><tr><td nowrap align=right valign=top>double&nbsp;</td><td valign=bottom><a class="el" href="classLine.html#a8">getYGivenX</a> (double x)</td></tr><tr><td nowrap align=right valign=top>double&nbsp;</td><td valign=bottom><a class="el" href="classLine.html#a9">getXGivenY</a> (double y)</td></tr><tr><td nowrap align=right valign=top>double&nbsp;</td><td valign=bottom><a class="el" href="classLine.html#a10">getACoefficient</a> () const</td></tr><tr><td nowrap align=right valign=top>double&nbsp;</td><td valign=bottom><a class="el" href="classLine.html#a11">getBCoefficient</a> () const</td></tr><tr><td nowrap align=right valign=top>double&nbsp;</td><td valign=bottom><a class="el" href="classLine.html#a12">getCCoefficient</a> () const</td></tr><tr><td colspan=2><br><h2>Static Public Methods</h2></td></tr><tr><td nowrap align=right valign=top>Line&nbsp;</td><td valign=bottom><a class="el" href="classLine.html#d0">makeLineFromTwoPoints</a> (<a class="el" href="classVecPosition.html">VecPosition</a> pos1, <a class="el" href="classVecPosition.html">VecPosition</a> pos2)</td></tr><tr><td nowrap align=right valign=top>Line&nbsp;</td><td valign=bottom><a class="el" href="classLine.html#d1">makeLineFromPositionAndAngle</a> (<a class="el" href="classVecPosition.html">VecPosition</a> vec, <a class="el" href="Geometry_8h.html#a2">AngDeg</a> angle)</td></tr><tr><td colspan=2><br><h2>Private Attributes</h2></td></tr><tr><td nowrap align=right valign=top>double&nbsp;</td><td valign=bottom><a class="el" href="classLine.html#o0">m_a</a></td></tr><tr><td nowrap align=right valign=top>double&nbsp;</td><td valign=bottom><a class="el" href="classLine.html#o1">m_b</a></td></tr><tr><td nowrap align=right valign=top>double&nbsp;</td><td valign=bottom><a class="el" href="classLine.html#o2">m_c</a></td></tr><tr><td colspan=2><br><h2>Friends</h2></td></tr><tr><td nowrap align=right valign=top>ostream &amp;&nbsp;</td><td valign=bottom><a class="el" href="classLine.html#l0">operator&lt;&lt;</a> (ostream &amp;os, Line l)</td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2>This class contains the representation of a line. A line is defined by the formula ay + bx + c = 0. The coefficients a, b and c are stored and used in the calculations. <p><p>Definition at line <a class="el" href="Geometry_8h-source.html#l00254">254</a> of file <a class="el" href="Geometry_8h-source.html">Geometry.h</a>.<hr><h2>Constructor &amp; Destructor Documentation</h2><a name="a0" doxytag="Line::Line"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> Line::Line </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">double&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>dA</em>, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap>double&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>dB</em>, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap>double&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>dC</em></td>        </tr>        <tr>          <td></td>          <td class="md">)&nbsp;</td>          <td class="md" colspan="2"></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>This constructor creates a line by given the three coefficents of the line. A line is specified by the formula ay + bx + c = 0. <dl compact><dt><b>Parameters: </b><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>dA</em>&nbsp;</td><td>a coefficients of the line </td></tr><tr><td valign=top><em>dB</em>&nbsp;</td><td>b coefficients of the line </td></tr><tr><td valign=top><em>dC</em>&nbsp;</td><td>c coefficients of the line </td></tr></table></dl><p>Definition at line <a class="el" href="Geometry_8C-source.html#l01233">1233</a> of file <a class="el" href="Geometry_8C-source.html">Geometry.C</a>.<p>References <a class="el" href="Geometry_8h-source.html#l00257">m_a</a>, <a class="el" href="Geometry_8h-source.html#l00258">m_b</a>, and <a class="el" href="Geometry_8h-source.html#l00259">m_c</a>.<p>Referenced by <a class="el" href="Geometry_8C-source.html#l01370">getTangentLine</a>(), and <a class="el" href="Geometry_8C-source.html#l01447">makeLineFromTwoPoints</a>().    </td>  </tr></table><hr><h2>Member Function Documentation</h2><a name="a10" doxytag="Line::getACoefficient"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> double Line::getACoefficient </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap> const</td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>This method returns the a coefficient from the line ay + bx + c = 0. <dl compact><dt><b>Returns: </b><dd>a coefficient of the line. </dl><p>Definition at line <a class="el" href="Geometry_8C-source.html#l01484">1484</a> of file <a class="el" href="Geometry_8C-source.html">Geometry.C</a>.<p>References <a class="el" href="Geometry_8h-source.html#l00257">m_a</a>.<p>Referenced by <a class="el" href="Geometry_8C-source.html#l01278">getIntersection</a>(), and <a class="el" href="Geometry_8C-source.html#l01245">operator&lt;&lt;</a>().    </td>  </tr></table><a name="a11" doxytag="Line::getBCoefficient"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> double Line::getBCoefficient </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap> const</td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>This method returns the b coefficient from the line ay + bx + c = 0. <dl compact><dt><b>Returns: </b><dd>b coefficient of the line. </dl><p>Definition at line <a class="el" href="Geometry_8C-source.html#l01491">1491</a> of file <a class="el" href="Geometry_8C-source.html">Geometry.C</a>.<p>References <a class="el" href="Geometry_8h-source.html#l00258">m_b</a>.<p>Referenced by <a class="el" href="Geometry_8C-source.html#l01278">getIntersection</a>(), and <a class="el" href="Geometry_8C-source.html#l01245">operator&lt;&lt;</a>().    </td>  </tr></table><a name="a12" doxytag="Line::getCCoefficient"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> double Line::getCCoefficient </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap> const</td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>This method returns the c coefficient from the line ay + bx + c = 0. <dl compact><dt><b>Returns: </b><dd>c coefficient of the line. </dl><p>Definition at line <a class="el" href="Geometry_8C-source.html#l01498">1498</a> of file <a class="el" href="Geometry_8C-source.html">Geometry.C</a>.<p>References <a class="el" href="Geometry_8h-source.html#l00259">m_c</a>.<p>Referenced by <a class="el" href="Geometry_8C-source.html#l01278">getIntersection</a>(), and <a class="el" href="Geometry_8C-source.html#l01245">operator&lt;&lt;</a>().    </td>  </tr></table><a name="a3" doxytag="Line::getCircleIntersectionPoints"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> int Line::getCircleIntersectionPoints </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top"><a class="el" href="classCircle.html">Circle</a>&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>circle</em>, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap><a class="el" href="classVecPosition.html">VecPosition</a> *&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>posSolution1</em>, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap><a class="el" href="classVecPosition.html">VecPosition</a> *&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>posSolution2</em></td>        </tr>        <tr>          <td></td>          <td class="md">)&nbsp;</td>          <td class="md" colspan="2"></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>This method calculates the intersection points between the current line and the circle specified with as center 'posCenter' and radius 'dRadius'. The number of solutions are returned and the corresponding points are put in the third and fourth argument of the method <dl compact><dt><b>Parameters: </b><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>c</em>&nbsp;</td><td>circle with which intersection points should be found </td></tr><tr><td valign=top><em>posSolution1</em>&nbsp;</td><td>first intersection (if any) </td></tr><tr><td valign=top><em>posSolution2</em>&nbsp;</td><td>second intersection (if any) </td></tr></table></dl><p>Definition at line <a class="el" href="Geometry_8C-source.html#l01320">1320</a> of file <a class="el" href="Geometry_8C-source.html">Geometry.C</a>.<p>References <a class="el" href="Geometry_8C-source.html#l00993">Geometry::abcFormula</a>(), <a class="el" href="Geometry_8h-source.html#l00054">EPSILON</a>, <a class="el" href="Geometry_8C-source.html#l01086">Circle::getCenter</a>(), <a class="el" href="Geometry_8C-source.html#l01070">Circle::getRadius</a>(), <a class="el" href="Geometry_8C-source.html#l00542">VecPosition::getX</a>(), <a class="el" href="Geometry_8C-source.html#l00558">VecPosition::getY</a>(), <a class="el" href="Geometry_8h-source.html#l00257">m_a</a>, <a class="el" href="Geometry_8h-source.html#l00258">m_b</a>, <a class="el" href="Geometry_8h-source.html#l00259">m_c</a>, and <a class="el" href="Geometry_8C-source.html#l00572">VecPosition::setVecPosition</a>().<p>Referenced by <a class="el" href="BasicPlayer_8C-source.html#l00531">BasicPlayer::interceptClose</a>().    </td>  </tr></table><a name="a6" doxytag="Line::getDistanceWithPoint"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> double Line::getDistanceWithPoint </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top"><a class="el" href="classVecPosition.html">VecPosition</a>&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp; <em>pos</em>          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?