Difference between revisions of "Talk:Lateral Velocity"

From Robowiki
Jump to navigation Jump to search
(explanation (hopefully helpful)))
Line 11: Line 11:
  
 
Hope you understand, I don't know how to express my math in proper English =) --[[User:Nat|<span style="color:#099;">Nat</span>]] [[User talk:Nat|<span style="color:#0a5;">Pavasant</span>]] 05:49, 21 March 2010 (UTC)
 
Hope you understand, I don't know how to express my math in proper English =) --[[User:Nat|<span style="color:#099;">Nat</span>]] [[User talk:Nat|<span style="color:#0a5;">Pavasant</span>]] 05:49, 21 March 2010 (UTC)
 +
 +
 +
Is <code>enemyAbsBearing - e.getHeadingRadians()</code> the same as <code>e.getHeadingRadians() - enemyAbsBearing</code>? The lateral velocity formula on this page uses the second.
 +
--[[User:Urgood2|-- urgood2]] 06:39, 21 March 2010 (UTC)

Revision as of 07:39, 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)

Nat-lateral-velocity-explaination.jpg

Let's say: red box are our robot; green box are our enemy, CE is extended CB, and BF and CG always point to the north (0 degrees). The lateral velocity is DB. Enemy velocity is AB. We know AB, and we need to know either angle ABD or angle BAD. We know angle GCB (the enemyAbsBearing) and FBA (e.getHeadingRadians()), so how to get either BAD or ABD? Since BAD + ABD = 90 and ABD + ABE = 90, therefore BAD = ABE. So far CG // BF, since both point at north, so GCB = FBE. FBE - FBA = ABE, thus enemyAbsBearing - e.getHeadingRadians() = ABE. ABE = BAD, so we get what we want.

Hope you understand, I don't know how to express my math in proper English =) --Nat Pavasant 05:49, 21 March 2010 (UTC)


Is enemyAbsBearing - e.getHeadingRadians() the same as e.getHeadingRadians() - enemyAbsBearing? The lateral velocity formula on this page uses the second. ---- urgood2 06:39, 21 March 2010 (UTC)