Difference between revisions of "Advancing Velocity"

From Robowiki
Jump to navigation Jump to search
(Created page with ''''Advancing Velocity''' (also '''AdvancingVelocity''') is the speed at which your opponent is moving toward you (perpendicular to LateralVelocity). When you stay still, RamF…')
 
Line 1: Line 1:
'''Advancing Velocity''' (also '''AdvancingVelocity''') is the speed at which your opponent is moving toward you (perpendicular to [[LateralVelocity]]). When you stay still, RamFire usually has an Advancing Velocity of 8 and MyFirstRobot will probably normally have an AdvancingVelocity of close to 0.  A robot moving straight away from you would have an Advancing Velocity of -8.
+
'''Advancing Velocity''' (also '''AdvancingVelocity''') is the speed at which your opponent is moving toward you (perpendicular to [[LateralVelocity]]). When you stay still, [[RamFire]] usually has an Advancing Velocity of 8 and [[MyFirstRobot]] usually has an Advancing Velocity of 0.  A robot moving straight away from you would have an Advancing Velocity of -8.
  
 
== Calculation ==
 
== Calculation ==

Revision as of 23:10, 21 October 2010

Advancing Velocity (also AdvancingVelocity) is the speed at which your opponent is moving toward you (perpendicular to LateralVelocity). When you stay still, RamFire usually has an Advancing Velocity of 8 and MyFirstRobot usually has an Advancing Velocity of 0. A robot moving straight away from you would have an Advancing Velocity of -8.

Calculation

A simple formula for advancing velocity is:

	double advancingvelocity = -Math.cos(e.getHeadingRadians()-absbearing)*e.getVelocity();

Where absbearing is the absolute bearing to your target. Without the negative sign, it could be called the retreating velocity.