classvecposition.html
来自「仿真人工智能是指用人工的方法和技术」· HTML 代码 · 共 1,105 行 · 第 1/5 页
HTML
1,105 行
<!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>VecPosition 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> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center><hr><h1>VecPosition Class Reference</h1><code>#include <<a class="el" href="Geometry_8h-source.html">Geometry.h</a>></code><p><a href="classVecPosition-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> </td><td valign=bottom><a class="el" href="classVecPosition.html#a0">VecPosition</a> (double vx=0, double vy=0, <a class="el" href="Geometry_8h.html#a19">CoordSystemT</a> cs=CARTESIAN)</td></tr><tr><td nowrap align=right valign=top>VecPosition </td><td valign=bottom><a class="el" href="classVecPosition.html#a1">operator-</a> ()</td></tr><tr><td nowrap align=right valign=top>VecPosition </td><td valign=bottom><a class="el" href="classVecPosition.html#a2">operator+</a> (const double &d)</td></tr><tr><td nowrap align=right valign=top>VecPosition </td><td valign=bottom><a class="el" href="classVecPosition.html#a3">operator+</a> (const VecPosition &p)</td></tr><tr><td nowrap align=right valign=top>VecPosition </td><td valign=bottom><a class="el" href="classVecPosition.html#a4">operator-</a> (const double &d)</td></tr><tr><td nowrap align=right valign=top>VecPosition </td><td valign=bottom><a class="el" href="classVecPosition.html#a5">operator-</a> (const VecPosition &p)</td></tr><tr><td nowrap align=right valign=top>VecPosition </td><td valign=bottom><a class="el" href="classVecPosition.html#a6">operator *</a> (const double &d)</td></tr><tr><td nowrap align=right valign=top>VecPosition </td><td valign=bottom><a class="el" href="classVecPosition.html#a7">operator *</a> (const VecPosition &p)</td></tr><tr><td nowrap align=right valign=top>VecPosition </td><td valign=bottom><a class="el" href="classVecPosition.html#a8">operator/</a> (const double &d)</td></tr><tr><td nowrap align=right valign=top>VecPosition </td><td valign=bottom><a class="el" href="classVecPosition.html#a9">operator/</a> (const VecPosition &p)</td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classVecPosition.html#a10">operator=</a> (const double &d)</td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classVecPosition.html#a11">operator+=</a> (const VecPosition &p)</td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classVecPosition.html#a12">operator+=</a> (const double &d)</td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classVecPosition.html#a13">operator-=</a> (const VecPosition &p)</td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classVecPosition.html#a14">operator-=</a> (const double &d)</td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classVecPosition.html#a15">operator *=</a> (const VecPosition &p)</td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classVecPosition.html#a16">operator *=</a> (const double &d)</td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classVecPosition.html#a17">operator/=</a> (const VecPosition &p)</td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classVecPosition.html#a18">operator/=</a> (const double &d)</td></tr><tr><td nowrap align=right valign=top>bool </td><td valign=bottom><a class="el" href="classVecPosition.html#a19">operator!=</a> (const VecPosition &p)</td></tr><tr><td nowrap align=right valign=top>bool </td><td valign=bottom><a class="el" href="classVecPosition.html#a20">operator!=</a> (const double &d)</td></tr><tr><td nowrap align=right valign=top>bool </td><td valign=bottom><a class="el" href="classVecPosition.html#a21">operator==</a> (const VecPosition &p)</td></tr><tr><td nowrap align=right valign=top>bool </td><td valign=bottom><a class="el" href="classVecPosition.html#a22">operator==</a> (const double &d)</td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classVecPosition.html#a23">show</a> (<a class="el" href="Geometry_8h.html#a19">CoordSystemT</a> cs=CARTESIAN)</td></tr><tr><td nowrap align=right valign=top>string </td><td valign=bottom><a class="el" href="classVecPosition.html#a24">str</a> (<a class="el" href="Geometry_8h.html#a19">CoordSystemT</a> cs=CARTESIAN)</td></tr><tr><td nowrap align=right valign=top>bool </td><td valign=bottom><a class="el" href="classVecPosition.html#a25">setX</a> (double dX)</td></tr><tr><td nowrap align=right valign=top>double </td><td valign=bottom><a class="el" href="classVecPosition.html#a26">getX</a> () const</td></tr><tr><td nowrap align=right valign=top>bool </td><td valign=bottom><a class="el" href="classVecPosition.html#a27">setY</a> (double dY)</td></tr><tr><td nowrap align=right valign=top>double </td><td valign=bottom><a class="el" href="classVecPosition.html#a28">getY</a> () const</td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classVecPosition.html#a29">setVecPosition</a> (double dX=0, double dY=0, <a class="el" href="Geometry_8h.html#a19">CoordSystemT</a> cs=CARTESIAN)</td></tr><tr><td nowrap align=right valign=top>double </td><td valign=bottom><a class="el" href="classVecPosition.html#a30">getDistanceTo</a> (const VecPosition p)</td></tr><tr><td nowrap align=right valign=top>VecPosition </td><td valign=bottom><a class="el" href="classVecPosition.html#a31">setMagnitude</a> (double d)</td></tr><tr><td nowrap align=right valign=top>double </td><td valign=bottom><a class="el" href="classVecPosition.html#a32">getMagnitude</a> () const</td></tr><tr><td nowrap align=right valign=top><a class="el" href="Geometry_8h.html#a2">AngDeg</a> </td><td valign=bottom><a class="el" href="classVecPosition.html#a33">getDirection</a> () const</td></tr><tr><td nowrap align=right valign=top>bool </td><td valign=bottom><a class="el" href="classVecPosition.html#a34">isInFrontOf</a> (const VecPosition &p)</td></tr><tr><td nowrap align=right valign=top>bool </td><td valign=bottom><a class="el" href="classVecPosition.html#a35">isInFrontOf</a> (const double &d)</td></tr><tr><td nowrap align=right valign=top>bool </td><td valign=bottom><a class="el" href="classVecPosition.html#a36">isBehindOf</a> (const VecPosition &p)</td></tr><tr><td nowrap align=right valign=top>bool </td><td valign=bottom><a class="el" href="classVecPosition.html#a37">isBehindOf</a> (const double &d)</td></tr><tr><td nowrap align=right valign=top>bool </td><td valign=bottom><a class="el" href="classVecPosition.html#a38">isLeftOf</a> (const VecPosition &p)</td></tr><tr><td nowrap align=right valign=top>bool </td><td valign=bottom><a class="el" href="classVecPosition.html#a39">isLeftOf</a> (const double &d)</td></tr><tr><td nowrap align=right valign=top>bool </td><td valign=bottom><a class="el" href="classVecPosition.html#a40">isRightOf</a> (const VecPosition &p)</td></tr><tr><td nowrap align=right valign=top>bool </td><td valign=bottom><a class="el" href="classVecPosition.html#a41">isRightOf</a> (const double &d)</td></tr><tr><td nowrap align=right valign=top>bool </td><td valign=bottom><a class="el" href="classVecPosition.html#a42">isBetweenX</a> (const VecPosition &p1, const VecPosition &p2)</td></tr><tr><td nowrap align=right valign=top>bool </td><td valign=bottom><a class="el" href="classVecPosition.html#a43">isBetweenX</a> (const double &d1, const double &d2)</td></tr><tr><td nowrap align=right valign=top>bool </td><td valign=bottom><a class="el" href="classVecPosition.html#a44">isBetweenY</a> (const VecPosition &p1, const VecPosition &p2)</td></tr><tr><td nowrap align=right valign=top>bool </td><td valign=bottom><a class="el" href="classVecPosition.html#a45">isBetweenY</a> (const double &d1, const double &d2)</td></tr><tr><td nowrap align=right valign=top>VecPosition </td><td valign=bottom><a class="el" href="classVecPosition.html#a46">normalize</a> ()</td></tr><tr><td nowrap align=right valign=top>VecPosition </td><td valign=bottom><a class="el" href="classVecPosition.html#a47">rotate</a> (<a class="el" href="Geometry_8h.html#a2">AngDeg</a> angle)</td></tr><tr><td nowrap align=right valign=top>VecPosition </td><td valign=bottom><a class="el" href="classVecPosition.html#a48">globalToRelative</a> (VecPosition orig, <a class="el" href="Geometry_8h.html#a2">AngDeg</a> ang)</td></tr><tr><td nowrap align=right valign=top>VecPosition </td><td valign=bottom><a class="el" href="classVecPosition.html#a49">relativeToGlobal</a> (VecPosition orig, <a class="el" href="Geometry_8h.html#a2">AngDeg</a> ang)</td></tr><tr><td nowrap align=right valign=top>VecPosition </td><td valign=bottom><a class="el" href="classVecPosition.html#a50">getVecPositionOnLineFraction</a> (VecPosition &p, double dFrac)</td></tr><tr><td colspan=2><br><h2>Static Public Methods</h2></td></tr><tr><td nowrap align=right valign=top>VecPosition </td><td valign=bottom><a class="el" href="classVecPosition.html#d0">getVecPositionFromPolar</a> (double dMag, <a class="el" href="Geometry_8h.html#a2">AngDeg</a> ang)</td></tr><tr><td nowrap align=right valign=top><a class="el" href="Geometry_8h.html#a2">AngDeg</a> </td><td valign=bottom><a class="el" href="classVecPosition.html#d1">normalizeAngle</a> (<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 </td><td valign=bottom><a class="el" href="classVecPosition.html#o0">m_x</a></td></tr><tr><td nowrap align=right valign=top>double </td><td valign=bottom><a class="el" href="classVecPosition.html#o1">m_y</a></td></tr><tr><td colspan=2><br><h2>Friends</h2></td></tr><tr><td nowrap align=right valign=top>ostream & </td><td valign=bottom><a class="el" href="classVecPosition.html#l0">operator<<</a> (ostream &os, VecPosition p)</td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2>This class contains an x- and y-coordinate of a position (x,y) as member data and methods which operate on this position. The standard arithmetic operators are overloaded and can thus be applied to positions (x,y). It is also possible to represent a position in polar coordinates (r,phi), since the class contains a method to convert these into cartesian coordinates (x,y). <p><p>Definition at line <a class="el" href="Geometry_8h-source.html#l00098">98</a> of file <a class="el" href="Geometry_8h-source.html">Geometry.h</a>.<hr><h2>Constructor & Destructor Documentation</h2><a name="a0" doxytag="VecPosition::VecPosition"></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"> VecPosition::VecPosition </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">double </td> <td class="mdname" nowrap> <em>x</em> = 0, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>double </td> <td class="mdname" nowrap> <em>y</em> = 0, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap><a class="el" href="Geometry_8h.html#a19">CoordSystemT</a> </td> <td class="mdname" nowrap> <em>cs</em> = CARTESIAN</td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Constructor for the VecPosition class. When the supplied Coordinate System type equals CARTESIAN, the arguments x and y denote the x- and y-coordinates of the new position. When it equals POLAR however, the arguments x and y denote the polar coordinates of the new position; in this case x is thus equal to the distance r from the origin and y is equal to the angle phi that the polar vector makes with the x-axis. <dl compact><dt><b>Parameters: </b><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>x</em> </td><td>the x-coordinate of the new position when cs == CARTESIAN; the distance of the new position from the origin when cs = POLAR </td></tr><tr><td valign=top><em>y</em> </td><td>the y-coordinate of the new position when cs = CARTESIAN; the angle that the polar vector makes with the x-axis when cs = POLAR </td></tr><tr><td valign=top><em>cs</em> </td><td>a CoordSystemT indicating whether x and y denote cartesian coordinates or polar coordinates </td></tr></table></dl><dl compact><dt><b>Returns: </b><dd>the VecPosition corresponding to the given arguments </dl><p>Definition at line <a class="el" href="Geometry_8C-source.html#l00231">231</a> of file <a class="el" href="Geometry_8C-source.html">Geometry.C</a>.<p>References <a class="el" href="Geometry_8h-source.html#l00083">CoordSystemT</a>, and <a class="el" href="Geometry_8C-source.html#l00572">setVecPosition</a>().<p>Referenced by <a class="el" href="Geometry_8C-source.html#l00865">getVecPositionFromPolar</a>(), <a class="el" href="Geometry_8C-source.html#l00300">operator *</a>(), <a class="el" href="Geometry_8C-source.html#l00253">operator+</a>(), <a class="el" href="Geometry_8C-source.html#l00240">operator-</a>(), and <a class="el" href="Geometry_8C-source.html#l00322">operator/</a>(). </td> </tr></table><hr><h2>Member Function Documentation</h2><a name="a33" doxytag="VecPosition::getDirection"></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"> <a class="el" href="Geometry_8h.html#a2">AngDeg</a> VecPosition::getDirection </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap> const</td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>This method determines the direction of the vector corresponding with the current VecPosition (the phi-coordinate in polar representation) using the arc tangent function. Note that the signs of x and y have to be taken into account in order to determine the correct quadrant. <dl compact><dt><b>Returns: </b><dd>the direction in degrees of the vector corresponding with the current VecPosition </dl><p>Definition at line <a class="el" href="Geometry_8C-source.html#l00625">625</a> of file <a class="el" href="Geometry_8C-source.html">Geometry.C</a>.<p>References <a class="el" href="Geometry_8h-source.html#l00052">AngDeg</a>, <a class="el" href="Geometry_8C-source.html#l00143">atan2Deg</a>(), <a class="el" href="Geometry_8h-source.html#l00103">m_x</a>, and <a class="el" href="Geometry_8h-source.html#l00104">m_y</a>.<p>Referenced by <a class="el" href="BasicPlayer_8C-source.html#l00314">BasicPlayer::accelerateBallToVelocity</a>(), <a class="el" href="WorldModelUpdate_8C-source.html#l01386">WorldModel::checkParticlesBall</a>(), <a class="el" href="WorldModel_8C-source.html#l00634">WorldModel::getBallDirection</a>(), <a class="el" href="BasicPlayer_8C-source.html#l01611">BasicPlayer::getInterceptionPointBall</a>(), <a class="el" href="Objects_8C-source.html#l00065">Object::getRelativeAngle</a>(), <a class="el" href="BasicPlayer_8C-source.html#l00269">BasicPlayer::kickBallCloseToBody</a>(), <a class="el" href="BasicPlayer_8C-source.html#l00775">BasicPlayer::kickTo</a>(), <a class="el" href="WorldModelPredict_8C-source.html#l00200">WorldModel::predictPosAfterNrCycles</a>(), <a class="el" href="Geometry_8C-source.html#l00783">rotate</a>(), <a class="el" href="Objects_8C-source.html#l00639">BallObject::show</a>(), <a class="el" href="Objects_8C-source.html#l00266">FixedObject::show</a>(), <a class="el" href="Geometry_8C-source.html#l00504">show</a>(), and <a class="el" href="Geometry_8C-source.html#l00518">str</a>(). </td> </tr></table><a name="a30" doxytag="VecPosition::getDistanceTo"></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 VecPosition::getDistanceTo </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const VecPosition </td> <td class="mdname1" valign="top" nowrap> <em>p</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>This method determines the distance between the current VecPosition and a given VecPosition. This is equal to the magnitude (length) of the vector connecting the two positions which is the difference vector between them. <dl compact><dt><b>Parameters: </b><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>p</em> </td><td>a Vecposition </td></tr></table></dl><dl compact><dt><b>Returns: </b><dd>the distance between the current VecPosition and the given VecPosition </dl><p>Definition at line <a class="el" href="Geometry_8C-source.html#l00589">589</a> of file <a class="el" href="Geometry_8C-source.html">Geometry.C</a>.<p>Referenced by <a class="el" href="WorldModelUpdate_8C-source.html#l01047">WorldModel::checkParticlesAgent</a>(), <a class="el" href="BasicPlayer_8C-source.html#l01521">BasicPlayer::defendGoalLine</a>(), <a class="el" href="Player_8C-source.html#l00182">Player::deMeer5</a>(), <a class="el" href="Player_8C-source.html#l00278">Player::deMeer5_goalie</a>(), <a class="el" href="WorldModelHighLevel_8C-source.html#l00227">WorldModel::getClosestInSetTo</a>(), <a class="el" href="Geometry_8C-source.html#l01391">Line::getDistanceWithPoint</a>(), <a class="el" href="BasicPlayer_8C-source.html#l01718">BasicPlayer::getEndSpeedForPass</a>(), <a class="el" href="WorldModelHighLevel_8C-source.html#l00459">WorldModel::getFastestInSetTo</a>(), <a class="el" href="BasicPlayer_8C-source.html#l01611">BasicPlayer::getInterceptionPointBall</a>(), <a class="el" href="Geometry_8C-source.html#l01174">Circle::getIntersectionArea</a>(), <a class="el" href="WorldModelHighLevel_8C-source.html#l00109">WorldModel::getNrInSetInCone</a>(), <a class="el" href="WorldModel_8C-source.html#l00948">WorldModel::getRelDistanceOpponentGoal</a>(), <a class="el" href="BasicPlayer_8C-source.html#l01687">BasicPlayer::getShootPositionOnLine</a>(), <a class="el" href="BasicPlayer_8C-source.html#l00531">BasicPlayer::interceptClose</a>(), <a class="el" href="BasicPlayer_8C-source.html#l00671">BasicPlayer::interceptCloseGoalie</a>(), <a class="el" href="WorldModelPredict_8C-source.html#l00372">WorldModel::isCollisionAfterDash</a>(), <a class="el" href="Geometry_8C-source.html#l01403">Line::isInBetween</a>(), <a class="el" href="Geometry_8C-source.html#l01110">Circle::isInside</a>(), <a class="el" href="WorldModelHighLevel_8C-source.html#l00745">WorldModel::isOpponentAtAngle</a>(), <a class="el" href="WorldModelUpdate_8C-source.html#l01702">WorldModel::mapUnknownPlayers</a>(), <a class="el" href="BasicPlayer_8C-source.html#l00442">BasicPlayer::moveToPos</a>(), <a class="el" href="BasicPlayer_8C-source.html#l00962">BasicPlayer::moveToPosAlongLine</a>(), <a class="el" href="BasicPlayer_8C-source.html#l01271">BasicPlayer::outplayOpponent</a>(), <a class="el" href="WorldModelPredict_8C-source.html#l00291">WorldModel::predictNrCyclesToObject</a>(), <a class="el" href="WorldModelPredict_8C-source.html#l00256">WorldModel::predictNrCyclesToPoint</a>(), <a class="el" href="WorldModelUpdate_8C-source.html#l00276">WorldModel::processUnsureHearInfo</a>(), <a class="el" href="BasicPlayer_8C-source.html#l00871">BasicPlayer::turnWithBallTo</a>(), and <a class="el" href="WorldModelUpdate_8C-source.html#l00839">WorldModel::updateBallForCollision</a>(). </td> </tr></table><a name="a32" doxytag="VecPosition::getMagnitude"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?