# Isometric circle on map

Theres an example of something existing:

I tried to replicate this:

I know that the diameter for that ship's circle is 6 blocks (as u the circle is overlapping the edges of the 6ths blocks, which also counts).

I know that the size of the isometric tile is 64*48.

So I replicated that, and that's the output I get:

You can see a few problems:

• The size of the ellipse is not the same, even though I use the provided size information.
• Even if the size is the same, the edges does not end at the same locations, as in the provided image.

There's my implementation, I am sure I have done the math wrong, as usual:

                    // The vessel radius (diameter / 2)
renderer.begin(ShapeRenderer.ShapeType.Line);
renderer.setColor(Color.RED);

// Calculate the size of the ellipse
int width = radious * GameTile.TILE_WIDTH;
int height = radious * GameTile.TILE_HEIGHT;

// Draw ellipse, centered around vessel where xx and yy is where the vessel starts drawing
renderer.ellipse(xx - width / 2 + vessel.getRegionWidth() / 2, yy - height / 2 + vessel.getRegionHeight() / 2, width, height);
renderer.end();


What did I do wrong in the calculation? You can see that the ship in the real preview covers 29 blocks (including the small corners on north/south/west/east, and my preview only covers .. like 13.

• you debugged and checked that vessel.getInfluenceRadius() returns 3 (6/2) and all the other values are the expected values? What means getRegionWidth() and getRegionHeight and what are their values? You are always using int and no floats or decimal somewhere in those methods? – monty Oct 13 '17 at 6:54
• Nice work by the way. Looks cool. I like it :-) – monty Oct 13 '17 at 6:59
• Yes its the data i took from the game's wiki. And the region width and height is just the size of the sprite, it is used to position the circle, it has no affect on the width/height of the ellipse. Currently I cheap fixed it by changing the diameter for each sihp, with floats, but that is bad practice! – Ben Beri Oct 13 '17 at 15:26
• You were able to fix it by using floats? – monty Oct 16 '17 at 6:41