Many of the players who study Robocode are confused by the direction and coordinates. Following skyala.li together to uncover the mystery.
Objective:
Many of the players who study Robocode are confused by the direction and coordinates. Following skyala.li together to uncover the mystery.
First, we will look at a translation and explanation in English:
Heading-absolute angle in degrees with 0 facing up the screen, positive clockwise. 0 <= Heading < 360.
Bearing-relative angle to some object from your robot ' s heading, positive clockwise. -180 < bearing <= 180
Heading: It's the angle between the robot direction and the top of the screen, the direction is between 0 and 360.
Bearing: is a part of the robot, such as radar to detect the target and direction of the difference between the clockwise angle of 180 to 180
Read this paragraph you may still not quite understand, the whole screen which is 0 degrees angle, the whole is the coordinates of the original point? What is the direction between clockwise and counterclockwise?
Concept and Floor plan:
Before you begin, you need to be aware of several concepts that are important in Robocode:
Coordinate system: Robocode the entire coordinate system is the battlefield screen with the lower left corner as the original point
Absolute direction: Robocode no matter in which direction the robot is in the static battlefield screen as a reference to the absolute angle (also known as the heading), is 0 degrees above the angle. That is, whether it is Robot,gun,radar north to 0, eastward to 90, southward to 180, westward to 270.
Relative direction: The relative direction is robot,gun,radar to the robot's dynamic heading angle for the reference of the angle difference is no longer the entire static screen as a reference, called it relative because the robot heading is constantly changing as the robot moves, heaing is only a relative object.
The following figure shows clearly the coordinate system and the absolute direction