# libgdx get rotated sprite coords points

I would like to get the position of each edge of a sprite when he has been rotated.

I have no idea how to do it, I made a image to explain it.

I would like to get the X and Y position of each Red circles please thanks you .

Sprite sprite = new Sprite(texture);
sprite.setRotation(-20);


To get the rotated sprites coordinate simply call the getVertices() method.

For example: sprite.getVertices()[SpriteBatch.X2]

Gets you the X coordinates of the top left corner.

The same call but replacing X<number> with Y<number> gets you the Y coordinate.

The corner numbers go like this:

2-3
| |
1-4