0

In my application, I can draw circles with draw2d.js I'd like to know how I can draw circles around a main circle (here is lightblue).

I'd like to make it dynamically, because I could have more than 200 circles, so I need to calculate coords compared to the main circle.

But I need to avoid the red zone, I don't want to draw circles at 360°

Example below:

enter image description here

Peter O.
  • 32,158
  • 14
  • 82
  • 96
Vincent Ducroquet
  • 864
  • 4
  • 14
  • 24

1 Answers1

1

Let p be the center of the small circle, c the center of the main circle. Then a possible solution could look like

p.x = c.x + R * Cos(Fi)
p.y = c.y + R * Sin(Fi)

Here R is distance, Fi is angle in allowed interval (for example -3*Pi/4..3*Pi/4)

Peter O.
  • 32,158
  • 14
  • 82
  • 96
MBo
  • 77,366
  • 5
  • 53
  • 86