Difference between revisions of "User talk:Frolicking Zombie"

From Robowiki
Jump to navigation Jump to search
(Blanked the page)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
<table>
 
  
  <tr>
 
    <th>Mathematics</th>
 
    <th>RoboCode Java</th>
 
    <th>Explanation</th>
 
  </tr>
 
 
  <tr>
 
    <td>
 
<math>\text{targetError} = (\text{currentTime} - \text{lastScanTime} + 1)\times 8 + 18</math>
 
    </td>
 
    <td>
 
      <pre>
 
double targetError = (currentTime - targetLastScan + 1) * 8 + 18;
 
      </pre>
 
    </td>
 
    <td>
 
Calculate the maximum distance the enemy can possibly move according to the physics.
 
    </td>
 
  </tr>
 
 
  <tr>
 
    <td>
 
<math>\text{targetDistance} = \sqrt{(\text{targetX} - \text{myX})^2+(\text{targetY}-\text{myY})^2}</math>
 
    </td>
 
    <td>
 
      <pre>
 
double targetDistance = Math.sqrt(
 
  (targetX - myX) * (targetX - myX) + (targetY - myY) * (targetY - myY)
 
  );
 
      </pre>
 
    </td>
 
    <td>
 
Standard Euclidean distance formula for our distance to target.
 
    </td>
 
  </tr>
 
 
  <tr>
 
    <td>
 
<math>\angle\text{targetHeading} = \tan ^{-1}\left(\frac{\text{targetY}-\text{myY}}{\text{targetX}-\text{myX}}\right)</math>
 
    </td>
 
    <td>
 
      <pre>
 
double targetHeading = Math.atan2(targetX - myX, targetY - myY);
 
      </pre>
 
    </td>
 
    <td>
 
Robocode trigonometry has <math>\tan \theta = \frac{\cos \theta}{\sin \theta}</math>
 
    </td>
 
  </tr>
 
 
  <tr>
 
    <td>
 
<math>\text{x = }\pm \frac{1}{2} \sqrt{4 \text{targetError}^2-\frac{\text{targetError}^4}{\text{targetDistance}^2}}</math>
 
<br />
 
<br />
 
<math>\text{y = }\frac{2 \text{targetDistance}^2-\text{targetError}^2}{2 \text{targetDistance}}</math>
 
    </td>
 
    <td>
 
      <pre>
 
double x = Math.sqrt(
 
  targetError * targetError - (targetError * targetError * targetError * targetError)
 
  / (targetDistance * targetDistance)) / 2;
 
double y = (2 * targetDistance * targetDistance - targetError * targetError)
 
  / (2 * targetDistance);
 
      </pre>
 
    </td>
 
    <td>
 
The maximum angle that the enemy could have traveled is the intersection of the targetError and targetDistance circles.
 
    </td>
 
  </tr>
 
 
  <tr>
 
    <td>
 
<math>\angle\theta\text{ = }\tan ^{-1}\left(\frac{x}{y}\right)</math>
 
    </td>
 
    <td>
 
      <pre>
 
double theta = Math.atan2(y,x);
 
      </pre>
 
    </td>
 
    <td>
 
Calculate the maximum bearing that the enemy could have traveled.
 
    </td>
 
  </tr>
 
 
 
</table>
 
 
 
<br />
 
 
<br />
 
<math>\angle\text{cwBoundHeading} = \angle\text{targetHeading}+\angle\theta</math>
 
<br />
 
<math>\angle\text{ccwBoundHeading} = \angle\text{targetHeading}-\angle\theta</math>
 
<br />
 
[[File:Radarzoombasis.png‎]]
 
<br />
 
 
[[File:radarZoomFinal.png‎]]
 
 
----
 
 
Hey there! Wanna tell us what you're doing? Looks pretty interesting. =) « [[User:AaronR|AaronR]] « [[User talk:AaronR|Talk]] « 14:04, 16 August 2009 (UTC)
 
 
Looks really interesting... Do tell =) &raquo; <span style="font-size:0.9em;color:darkgreen;">[[User:Nat|Nat]] | [[User_talk:Nat|Talk]]</span> &raquo; 14:59, 16 August 2009 (UTC)
 
 
Hmm... looks like it's calculating some upper/lower bounds on the angle that an enemy bot could be at, in a melee environment where scans are infrequent --[[User:Rednaxela|Rednaxela]] 16:20, 16 August 2009 (UTC)
 
 
Just working on this article over here before I move it. It's a minimal cost radar with some features for melee.
 

Latest revision as of 18:24, 26 February 2010