A closed line with a curved format and a flat appearance in which the points are equidistant from the central point that is located in the same plane is known as a circumference . This distance that separates the set of points and the central area is known as the radius , while the line segment that makes up a pair of aligned radii is called the diameter .
The diameter, as it has been determined, is the greatest distance that can be established between two points that belong to the same circumference. The length of this diameter, on the other hand, is twice the length of the radius.
Analyzing a circle
Other elements that can be recognized when examining a circle are the arc (this is the name given to the curved segment of points that makes up any circle), the chord (that is, the segment that guarantees the union of two points), the tangent line . (which makes contact at a single point) and the secant line (which makes contact at a pair of points).
In relation to the relative positions of the points with respect to the circumference, it must be said that a point can be interior (with respect to which the distance from the central zone to the point is smaller than the measurement of the length of the radius), belonging ( where the extension that separates the center of the point coincides with the length of the radius) or exterior (where the separation between the center and the point exceeds the length of the radius).
The differences with the circle
Although in everyday language they are often used as synonyms, it should be noted that circumference and circle do not mean the same thing. The circle, the theory says, is the geometric space based on the points that are part of a circle: this means that the circumference constitutes the perimeter of a circle.
The notion of circumference, therefore, is also used to name the contour of a certain surface, area or terrain . For example: “Fencing allows animals to be kept within the circumference of our property.”
Use of circles in graphical programming
In video games, as well as in other types of interactive graphic applications , it is necessary to tell the processor what the limit of the objects seen on the screen is , to prevent them from overlapping. A clear example is a character who walks through a maze and who, when walking against a wall, cannot cross it. For people who do not have any technical knowledge related to this topic, it may be difficult to understand that the program does not know that "a wall is solid and it is not possible to pass through it." But it is necessary to remember that, as they say in everyday speech, for a computer everything is "ones and zeros"; That is to say, it does not understand the characteristics of bodies, nor concepts of physics or mathematics , but simply reproduces like a slave everything that is indicated to it.
To prevent an object from passing through a wall, for example, so-called collision systems are created, although their name may vary depending on the developer and the language. Basically, it is a series of conventions and functions that establish how many types of interaction exist within the game universe and what consequence each case has. When implemented, what was once a series of propertyless graphics becomes a world that can be explored by walking, jumping, climbing, swimming, climbing ladders and passing through narrow tunnels.
Traditionally, the most used collision types in video games are squares and circles , each with different characteristics and purposes. It is worth mentioning that they do not necessarily represent an object or being of a similar shape, but the decision to choose one or the other depends more on the type of interaction that said element will have with the environment. If you want to outline the body of a character such as Super Mario in a game in which the action takes place in 2 dimensions (the camera moves to the sides and not "to and from the screen"), probably the most appropriate option It is a rectangle, whose longest sides will represent the height of the famous plumber, while the remaining two, both its width and depth, since it is a flat image.
At first glance, a human being does not have the shape of a rectangle, and depending on the degree of complexity, it is possible to use as many figures as desired to represent its limits . A circle could well be used for his head and hands, and rectangles for the rest of his body parts. The advantage of the circle is that it allows very precise calculations of possible collisions coming from all directions without requiring much work from the processor and always performing the same check: whether the distance between a given point on an external object and the center of the circle is equal or less than the radius , then they are making contact.