Earlier I asked a question about how to place images around a button, they helped me. How do I place images in a semicircle around a button? But there was such a difficulty when doing 2 stars is not placed as it should

enter image description here

It is necessary so: (but I do not understand how to change the formula)

enter image description here

  • show your code at this stage. - Denis

1 answer 1

The position of the first star is the starting angle. The second star will be "evenly distributed" between the starting and ending angles. that is, if for example it is necessary that the first be at 70 degrees, and the second at 110 (both at 20 degrees from the vertical, you need to write this:

let startAngle: Double = 70 // угол начала let endAngle: Double = 150 // угол конца 
  • that's how, thanks for the explanation - PRKan
  • @PRKan simplify your life a little bit. If we consider the angle according to this formula: let angle = ((endAngleRad-startAngleRad)/Double(numberOfImages-1)*Double(i))+startAngleRad then the last star will be exactly on endAngle. Remember that if you fill the whole circle in this way, the first and last will fall on top of each other. - Max Mikheyenko