Yeah, that's about right - I wasn't really intending to make an epicycloid
, but it's certainly reminiscent of that sort of thing.
The actual application of this has to do with irregular, somewhat loose, packing of 2d space with things (the small circles, above). Except when there's a big thing (the big circle), in which case I want the packing to be regular. And the small circles can overlap, so long as no circle has its center inside another circle.
What I was going for in the above diagram is to have the small circles crowded around the big circle, overlapping just enough so that when two small circles meet, there's no room between that overlap region and the big circle. For aesthetic (and practical, if this ever gets into a game, and if you accept that computer games can be called "practical") reasons, I also wanted the intersection regions between pairs of small circles to be approximately the same width as the intersection regions between the small circles with the large circle.
A little thinking after having made that picture convinces me that I can apply this same sort of approach to other shapes (a big square, an ellipse, a square with a circle cut out of it...) as well, which might also be useful. Once I get all of that working, it might be easier to explain what all this random math is for.
This blather brought to you by the letter pi and the number Sqrt(2)/2.