i'll do my best
1. define the base circle (orange)
2. define the sub circle (pink)
3. compute the range of the intersection circle's radius (blue)
4. compute the loop points (yellow)
4A. compute intersection circle along range defined in 3
4B. compute the intersection angle between base and intersection circles relative to the center of the intersection/sub circle (law of cosines)
4C. compute the intersection point with intersection angle (green on blue & orange)
4D. compute sub point with intersection angle (green on pink)
4E. compute the loop point with the x component from intersection point (4C) and the y component from sub point (4D)
5. compute the trace point at trace angle (white)
5A. trace the already computed loop points searching for the the two points where the trace angle fits between
5B. compute the intersection between the line composed of the two matching loop points and the trace line originating at the sub circle's center with an angle of the trace angle
its a generalization of the drawing by Fritz Hügelschäffer linked below
http://www.mathematische-basteleien.de/eggcurves.htm#:~:text....