I'm trying to solve the following equation:
I have $X$ amount of segments, each equally $X$ wide.
How do I calculate the distance each segment needs to be from the center of a circle to form a closed circular shape without any overlap between the segments.
I've drawn up an example of what I'm looking for. The sample shows $8$ segments that are each $40$ pixels wide. The formula I'm looking for allows for a variable amount of segments and width.

I'm a developer, not a mathematician so forgive me if this question is not appropriate for this platform.