# Combine a contour plot of a conic and an inset with an polygon such as all its vertices are on the conic

I have a difficulty to programmatically adjust the size of a polygon within an inset of a conic (here I limit myself to a circle) in order to have all its vertices on the circle:

a = {-2, 0}; b = {2, 0}; c = {Sqrt[2], Sqrt[2]}; d = {-Sqrt[2], Sqrt[
2]}; e = {0, 2}; f = {0, -2};
ContourPlot[{x^2 + y^2 - 4 == 0}, {x, -2.5, 2.5}, {y, -2.5, 2.5},
ContourStyle -> {Blue, Thin}, Frame -> None, Axes -> True,
AspectRatio -> 1, Epilog ->
{
{Blue, PointSize[0.02], Point[a],
(Text[Style[#1, 14], #2 + {-0.1, .1}] & @@ {"a", a})},
{Blue, PointSize[0.02], Point [b],
(Text[Style[#1, 14], #2 + {-0.1, .1}] & @@ {"b", b})},
{Blue, PointSize[0.02], Point[c],
(Text[Style[#1, 14], #2 + {-0.1, .1}] & @@ {"c", c})},
{Blue, PointSize[0.02], Point[d],
(Text[Style[#1, 14], #2 + {-0.1, .1}] & @@ {"d", d})},
{Blue, PointSize[0.02], Point[e],
(Text[Style[#1, 14], #2 + {-0.1, .1}] & @@ {"e", e})},
{Blue, PointSize[0.02], Point[f],
(Text[Style[#1, 14], #2 + {-0.1, .1}] & @@ {"f", f})},
{Inset[Graphics[
{ColorData["Legacy", "Banana"], EdgeForm[{Thick, Pink}],
Opacity[0.15], Polygon[{a, b, c, d}]}], {0, 0}, {0, 0}, 4.2]},
{Inset[Graphics[
{ColorData["Legacy", "SlateBlue"], EdgeForm[{Thick, Pink}],
Opacity[0.15], Polygon[{a, e, c, f}]}], {0, 0}, {0, 0}, 3.6]}
}]


Although the two polygons I defined here out of six points have coordinates that are on the circle, I need to adjust the size parameter of the Inset, for every different position of a set of four points.
By trial an error I achieved something but far from satisfactory: I need to include the code above in a notebook under development where all the points are on the conic and dynamic and the polygon is constructed in the Epilog with these points.
Is there a way with MMA to compute the value of the Inset size parameter according to the vertices coordinates?

• Yeah, why can't you just use Show, with the insets as separate graphics. – lalmei Jun 9 '14 at 16:55
• Why do you need to use Inset[Graphics[... instead of Epilog->{Polygon[{a,b,c,d}]...? – Kuba Jun 9 '14 at 19:42
• @Kuba Correct! I didn't think about using {ColorData["Legacy", "Banana"], EdgeForm[{Thick, Pink}], Opacity[0.15], Polygon[{a, b, c, d}]} in the Epilog instead of Inset... to achieve the same result. Inset obviously here was a wrong option and I guess that finding correctly the right Size would have been challenging and futile. I consider your comment as an answer. – Sigis K Jun 9 '14 at 21:19
• @Kuba you should repost your comment as answer.. – halmir Jun 9 '14 at 21:26

a = {-2, 0}; b = {2, 0}; c = {Sqrt[2], Sqrt[2]}; d = {-Sqrt[2], Sqrt[2]}; e = {0, 2};