0

I am creating a ring that will spin made out of circles and I don't want to have to manually place each circle and then spin them all at once. Isn't there some mathematical way to create this circle? Each circle is an object.

It would look like this: https://i.stack.imgur.com/wgpbf.jpg

coder42
  • 13
  • 3

1 Answers1

0

Not sure if I understood it correct,but propably you want something like this

int numOfCircles=40;
float rad=10;
List<Point> points=new ArrayList<Point>();
for(float a=0;a<360;a+=(360/numOfCircles)){
    points.add(new Point(Math.cos((a) * 0.0174532925f) * rad), Math.sin((a) * 0.0174532925f) * rad));
}
SteveL
  • 3,331
  • 4
  • 32
  • 57