I set the coordinates of the circle and give it a radius of 100. Then I create a similar second circle. When they approach each other and collide, the distance between the centers of mass of the circles must be less than or equal to the sum of the radii. But in fact, the event is triggered, that sumOfRadiuses > distanceBetweenCenterOfMass
, but in fact in the picture it is clearly visible that they are far from each other.
I suspect the problem is in radius. For example, java doc:
public abstract void fillOval(int x, int y, int width, int height) width - the width of the oval to be filled. height - the height of the oval to be filled.
How does it then interpret this width? And then how to convert then, so that the calculations were accurate?