An analysis of the direction of Robocode Basic principles

Source: Internet
Author: User
Tags in degrees radar

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.