Cell[CellGroupData[{Cell[BoxData[ RowBox[{"Manipulate", "[", " ", RowBox[{ RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{ "u", ",", "c", ",", "px", ",", "py", ",", "qx", ",", "qy"}], "}"}], ",", " ", RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"Norm", "[", "p", "]"}], ">", "0.99"}], ",", RowBox[{"p", "=", RowBox[{"0.98", RowBox[{"Normalize", "[", "p", "]"}]}]}]}], "]"}], ";", " ", RowBox[{"u", "=", RowBox[{"2", RowBox[{"\[Pi]", "/", "n"}]}]}], ";", " ", RowBox[{ RowBox[{"{", RowBox[{"px", ",", "py"}], "}"}], "=", "p"}], ";", " ", RowBox[{"c", "=", RowBox[{"First", "/@", RowBox[{"Table", "[", " ", RowBox[{ RowBox[{ RowBox[{ RowBox[{"{", RowBox[{"qx", ",", "qy"}], "}"}], "=", RowBox[{"{", RowBox[{ RowBox[{"Cos", "[", RowBox[{"f", " ", "u"}], "]"}], ",", RowBox[{"Sin", "[", RowBox[{"f", " ", "u"}], "]"}]}], "}"}]}], ";", " ", RowBox[{ RowBox[{"{", RowBox[{"x", ",", "y"}], "}"}], "/.", RowBox[{"Quiet", "[", RowBox[{"NSolve", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{ RowBox[{"x", " ", "qy"}], "-", RowBox[{"y", " ", "qx"}]}], "==", "0"}], ",", RowBox[{ RowBox[{ SuperscriptBox[ RowBox[{"(", RowBox[{"x", "-", "px"}], ")"}], "2"], "+", SuperscriptBox[ RowBox[{"(", RowBox[{"y", "-", "py"}], ")"}], "2"]}], "==", RowBox[{ SuperscriptBox[ RowBox[{"(", RowBox[{"x", "-", "qx"}], ")"}], "2"], "+", SuperscriptBox[ RowBox[{"(", RowBox[{"y", "-", "qy"}], ")"}], "2"]}]}]}], "}"}], ",", RowBox[{"{", RowBox[{"x", ",", "y"}], "}"}]}], "]"}], "]"}]}]}], ",", RowBox[{"{", RowBox[{"f", ",", "n"}], "}"}]}], "]"}]}]}], ";", " ", RowBox[{"Graphics", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"EdgeForm", "[", "Thick", "]"}], ",", "LightOrange", ",", RowBox[{"Disk", "[", "]"}], ",", "Brown", ",", RowBox[{"EdgeForm", "[", "Thin", "]"}], ",", RowBox[{ RowBox[{ RowBox[{"Circle", "[", RowBox[{"#", ",", RowBox[{"Norm", "[", RowBox[{"#", "-", "p"}], "]"}]}], "]"}], "&"}], "/@", "c"}], ",", "Blue", ",", RowBox[{ RowBox[{ RowBox[{"Disk", "[", RowBox[{"#", ",", "0.01"}], "]"}], "&"}], "/@", "c"}], ",", "Red", ",", RowBox[{"Disk", "[", RowBox[{"p", ",", "0.04"}], "]"}], ",", "Black", ",", "Thick", ",", RowBox[{"Circle", "[", "]"}]}], "}"}], ",", RowBox[{"PlotRange", "->", "1.1"}], ",", RowBox[{"ImageSize", "->", RowBox[{"{", RowBox[{"500", ",", "450"}], "}"}]}]}], "]"}]}]}], "]"}], ",", " ", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"p", ",", RowBox[{"{", RowBox[{ RowBox[{"-", "0.5"}], ",", RowBox[{"-", "0.5"}]}], "}"}]}], "}"}], ",", "Locator", ",", RowBox[{"Appearance", "->", " ", "None"}]}], "}"}], ",", " ", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"n", ",", "20", ",", "\"\\""}], "}"}], ",", "1", ",", "30", ",", "1", ",", RowBox[{"Appearance", "->", "\"\\""}]}], "}"}], ",", RowBox[{"TrackedSymbols", "->", "True"}]}], "]"}]], "Input", CellGroupingRules->{"GroupTogetherGrouping", 10000.}, CellChangeTimes->{ 3.35696210375764*^9, 3.455979447294899*^9, 3.4564891313755*^9, 3.456489571331441*^9, {3.4564897865984435`*^9, 3.456489788832833*^9}, {3.456489876380268*^9, 3.456489899349165*^9}, {3.4570078598044014`*^9, 3.4570078705574765`*^9}, {3.506279064045804*^9, 3.5062791720206003`*^9}, 3.760778239423922*^9}], Cell[BoxData[ TagBox[ StyleBox[ DynamicModuleBox[{$CellContext`n$$ = 20, $CellContext`p$$ = {-0.5, -0.5}, Typeset`show$$ = True, Typeset`bookmarkList$$ = {}, Typeset`bookmarkMode$$ = "Menu", Typeset`animator$$, Typeset`animvar$$ = 1, Typeset`name$$ = "\"untitled\"", Typeset`specs$$ = {{{ Hold[$CellContext`p$$], {-0.5, -0.5}}, Automatic}, {{ Hold[$CellContext`n$$], 20, "number of circles"}, 1, 30, 1}}, Typeset`size$$ = {500., {223., 227.}}, Typeset`update$$ = 0, Typeset`initDone$$, Typeset`skipInitDone$$ = True, $CellContext`n$1044716$$ = 0}, DynamicBox[Manipulate`ManipulateBoxes[ 1, StandardForm, "Variables" :> {$CellContext`n$$ = 20, $CellContext`p$$ = {-0.5, -0.5}}, "ControllerVariables" :> { Hold[$CellContext`n$$, $CellContext`n$1044716$$, 0]}, "OtherVariables" :> { Typeset`show$$, Typeset`bookmarkList$$, Typeset`bookmarkMode$$, Typeset`animator$$, Typeset`animvar$$, Typeset`name$$, Typeset`specs$$, Typeset`size$$, Typeset`update$$, Typeset`initDone$$, Typeset`skipInitDone$$}, "Body" :> Module[{$CellContext`u$, $CellContext`c$, $CellContext`px$, \ $CellContext`py$, $CellContext`qx$, $CellContext`qy$}, If[Norm[$CellContext`p$$] > 0.99, $CellContext`p$$ = 0.98 Normalize[$CellContext`p$$]]; $CellContext`u$ = 2 (Pi/$CellContext`n$$); {$CellContext`px$, \ $CellContext`py$} = $CellContext`p$$; $CellContext`c$ = Map[First, Table[{$CellContext`qx$, $CellContext`qy$} = { Cos[$CellContext`f $CellContext`u$], Sin[$CellContext`f $CellContext`u$]}; ReplaceAll[{$CellContext`x, $CellContext`y}, Quiet[ NSolve[{$CellContext`x $CellContext`qy$ - \ $CellContext`y $CellContext`qx$ == 0, ($CellContext`x - $CellContext`px$)^2 + \ ($CellContext`y - $CellContext`py$)^2 == ($CellContext`x - \ $CellContext`qx$)^2 + ($CellContext`y - $CellContext`qy$)^2}, \ {$CellContext`x, $CellContext`y}]]], {$CellContext`f, \ $CellContext`n$$}]]; Graphics[{ EdgeForm[Thick], LightOrange, Disk[], Brown, EdgeForm[Thin], Map[Circle[#, Norm[# - $CellContext`p$$]]& , $CellContext`c$], Blue, Map[Disk[#, 0.01]& , $CellContext`c$], Red, Disk[$CellContext`p$$, 0.04], Black, Thick, Circle[]}, PlotRange -> 1.1, ImageSize -> {500, 450}]], "Specifications" :> {{{$CellContext`p$$, {-0.5, -0.5}}, Automatic, ControlType -> Locator, Appearance -> None}, {{$CellContext`n$$, 20, "number of circles"}, 1, 30, 1, Appearance -> "Labeled"}}, "Options" :> {TrackedSymbols -> True}, "DefaultOptions" :> {ControllerLinking -> True}], ImageSizeCache->{551., {271., 277.}}, SingleEvaluation->True], Deinitialization:>None, DynamicModuleValues:>{}, SynchronousInitialization->True, UnsavedVariables:>{Typeset`initDone$$}, UntrackedVariables:>{Typeset`size$$}], "Manipulate", Deployed->True, StripOnInput->False], Manipulate`InterpretManipulate[1]]], "Output", CellGroupingRules->{"GroupTogetherGrouping", 10000.}, CellChangeTimes->{3.760778239424185*^9}, CellID->125316224] }, {2}]]