Difference between revisions of "Talk:Lateral Velocity"

From Robowiki
Jump to navigation Jump to search
(reply)
Line 3: Line 3:
  
 
--[[User:Urgood2|-- urgood2]] 04:25, 21 March 2010 (UTC)
 
--[[User:Urgood2|-- urgood2]] 04:25, 21 March 2010 (UTC)
 +
 +
Well, <code>e.getHeadingRadians()</code> is the enemy's heading relative to the battle field - 0 is pointing up, Math.PI / 2 (90 degrees) is right, Math.PI (180 degrees) is down. The <code>enemyAbsBearing</code> variable is the angle from your bot to the enemy bot. So the difference is the enemy's heading relative to yours - 0 is facing directly away from you, Math.PI / 2 is exactly perpendicular to you (clockwise), etc. Having trouble thinking of some triangles that would demonstrate the formula, probably because it's late on a Saturday night... But hopefully that helps. --[[User:Voidious|Voidious]] 04:33, 21 March 2010 (UTC)

Revision as of 05:33, 21 March 2010

I don't understand how the equation works.. Could anyone explain this to me in terms of triangles? What does e.getHeadingRadians() - enemyAbsBearing give? How can you explain it?

---- urgood2 04:25, 21 March 2010 (UTC)

Well, e.getHeadingRadians() is the enemy's heading relative to the battle field - 0 is pointing up, Math.PI / 2 (90 degrees) is right, Math.PI (180 degrees) is down. The enemyAbsBearing variable is the angle from your bot to the enemy bot. So the difference is the enemy's heading relative to yours - 0 is facing directly away from you, Math.PI / 2 is exactly perpendicular to you (clockwise), etc. Having trouble thinking of some triangles that would demonstrate the formula, probably because it's late on a Saturday night... But hopefully that helps. --Voidious 04:33, 21 March 2010 (UTC)