# Circular trajectory for sprite in LibGdx

I want four sprites to orbit a single origin point. But if I use like this

    sprite_p1_avatar = new Sprite(dummyText);
sprite_p1_avatar.setPosition(200, 200);
sprite_p1_avatar.setOrigin(100, 100);

sprite_p2_avatar = new Sprite(dummyText);
sprite_p2_avatar.setPosition(300, 300);
sprite_p2_avatar.setOrigin(100, 100);

sprite_p3_avatar = new Sprite(dummyText);
sprite_p3_avatar.setPosition(400, 400);
sprite_p3_avatar.setOrigin(100, 100);

sprite_p4_avatar = new Sprite(dummyText);
sprite_p4_avatar.setPosition(500, 500);
sprite_p4_avatar.setOrigin(100, 100);

sprite_p1_avatar.rotate(40 * delta);

sprite_p1_avatar.draw(batch);

sprite_p2_avatar.rotate(40 * delta);
sprite_p2_avatar.draw(batch);

sprite_p3_avatar.rotate(40 * delta);
sprite_p3_avatar.draw(batch);

sprite_p4_avatar.rotate(40 * delta);
sprite_p4_avatar.draw(batch);


the sprite get inverted while revolving, as these sprites are profile pictures of users I want them to stay straight while orbiting at every point. Is there any way to move the sprites along a circular path without rotating.

This is rather simple approach. To keep it pointing up, it'd be easier to translate sprites on your own.

• Calculate current angle of your rotation each frame
• Then calculate offset from origin (See this link for maths)

public static Vector2 getCurrentPosition(float degrees, Vector2 origin, float radius) {
//pre-calculate sin and cos