(* Content-type: application/vnd.wolfram.mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 12.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 158, 7] NotebookDataLength[ 12142, 290] NotebookOptionsPosition[ 11779, 273] NotebookOutlinePosition[ 12124, 288] CellTagsIndexPosition[ 12081, 285] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell[TextData[StyleBox["Distance from the point T to the circle-arc in the \ plane", FontColor->RGBColor[1, 0, 0]]], "Subsubsection", CellChangeTimes->{{3.6799959272424545`*^9, 3.6799959714925165`*^9}, { 3.680187880725844*^9, 3.6801878813658447`*^9}, {3.6801879133558893`*^9, 3.6801879169258947`*^9}, {3.680188161286237*^9, 3.6801881618662376`*^9}, { 3.680188252966365*^9, 3.6801882616863775`*^9}, {3.6801883076464415`*^9, 3.680188367706526*^9}, {3.68018854232677*^9, 3.680188555186788*^9}, { 3.680188645956915*^9, 3.6801887056379986`*^9}, {3.6801889273883095`*^9, 3.680188930058313*^9}, {3.680189244018752*^9, 3.6801892847288094`*^9}, { 3.6801893580589123`*^9, 3.680189359168914*^9}, {3.680189420118999*^9, 3.6801894397690268`*^9}, {3.6801894730990734`*^9, 3.6801895437291718`*^9}, {3.6801900734149265`*^9, 3.680190086304945*^9}, { 3.6801901868050857`*^9, 3.6801903182252693`*^9}, {3.6801903981653814`*^9, 3.6801904303854265`*^9}, {3.680190477125492*^9, 3.6801906342057123`*^9}, { 3.680190665865756*^9, 3.6801906674757586`*^9}, {3.680191007020167*^9, 3.680191145620361*^9}, {3.680191176980405*^9, 3.6801912085004487`*^9}, { 3.680191325810613*^9, 3.680191412160734*^9}, {3.680191481260831*^9, 3.6801914918608456`*^9}, {3.6801915407409143`*^9, 3.6801916609210825`*^9}, {3.680191718901163*^9, 3.680191724661172*^9}, { 3.680191798661275*^9, 3.6801918474213433`*^9}, {3.6801920336116037`*^9, 3.680192064282647*^9}, {3.680192966581046*^9, 3.680193025731129*^9}, { 3.680193071341193*^9, 3.680193073591196*^9}, {3.6801931694413304`*^9, 3.6801931716413336`*^9}, {3.680193204341379*^9, 3.680193221921404*^9}, { 3.6801932521514463`*^9, 3.680193327011551*^9}, {3.6801934502717237`*^9, 3.680193456331732*^9}, {3.6801935486538625`*^9, 3.68019367538404*^9}, { 3.6802229763031774`*^9, 3.6802230363632617`*^9}, {3.6802233314036746`*^9, 3.680223369553728*^9}, {3.6802234540458508`*^9, 3.6802234659658675`*^9}, { 3.680223573446018*^9, 3.6802236119760723`*^9}, 3.6802245810804358`*^9, { 3.680224788350726*^9, 3.680224788880727*^9}, {3.68022576742412*^9, 3.68022578184414*^9}, 3.680225916668332*^9, {3.6802259495283785`*^9, 3.680225953498384*^9}, {3.680226611300305*^9, 3.6802266283203287`*^9}, 3.6807540138389945`*^9, {3.81062018635697*^9, 3.8106202074909267`*^9}, 3.8222731964891577`*^9, {3.82228725358897*^9, 3.8222872541895995`*^9}}, ExpressionUUID -> "99b3be41-1c7d-4efb-9c0f-b7e6646fae69"], Cell[BoxData[{ RowBox[{ StyleBox[ RowBox[{ RowBox[{ StyleBox["Input", FontColor->RGBColor[1, 0, 0]], StyleBox[":", FontColor->RGBColor[1, 0, 0]], " ", RowBox[{ RowBox[{"point", " ", "T"}], " ", "\[Element]", " ", SuperscriptBox["\[DoubleStruckCapitalR]", "2"]}]}], ",", " ", RowBox[{ RowBox[{"center", " ", "C"}], " ", "\[Element]", " ", SuperscriptBox["\[DoubleStruckCapitalR]", "2"]}], ",", " ", RowBox[{"radius", " ", "r"}], ",", " ", RowBox[{"angles", " ", SubscriptBox["\[Alpha]", "1"]}], ",", RowBox[{ SubscriptBox["\[Alpha]", "2"], ";"}]}], FontColor->RGBColor[0, 0, 1]], StyleBox[" ", FontColor->RGBColor[0, 0, 1]]}], "\[IndentingNewLine]", StyleBox[ RowBox[{ RowBox[{ StyleBox["Output", FontColor->RGBColor[1, 0, 0]], StyleBox[":", FontColor->RGBColor[1, 0, 0]], " ", "distance"}], ";"}], FontColor->RGBColor[0, 0, 1]], "\[IndentingNewLine]", StyleBox[ RowBox[{ StyleBox["Submodules", FontColor->RGBColor[1, 0, 0]], StyleBox[":", FontColor->RGBColor[1, 0, 0]], " ", RowBox[{"none", " ", "needed", " "}]}], FontColor->RGBColor[0, 0, 1]], "\[IndentingNewLine]"}], "Text", CellChangeTimes->{{3.6799959272424545`*^9, 3.6799959714925165`*^9}, { 3.680187880725844*^9, 3.6801878813658447`*^9}, {3.6801879133558893`*^9, 3.6801879169258947`*^9}, {3.680188161286237*^9, 3.6801881618662376`*^9}, { 3.680188252966365*^9, 3.6801882616863775`*^9}, {3.6801883076464415`*^9, 3.680188367706526*^9}, {3.68018854232677*^9, 3.680188555186788*^9}, { 3.680188645956915*^9, 3.6801887056379986`*^9}, {3.6801889273883095`*^9, 3.680188930058313*^9}, {3.680189244018752*^9, 3.6801892847288094`*^9}, { 3.6801893580589123`*^9, 3.680189359168914*^9}, {3.680189420118999*^9, 3.6801894397690268`*^9}, {3.6801894730990734`*^9, 3.6801895437291718`*^9}, {3.6801900734149265`*^9, 3.680190086304945*^9}, { 3.6801901868050857`*^9, 3.6801903182252693`*^9}, {3.6801903981653814`*^9, 3.6801904303854265`*^9}, {3.680190477125492*^9, 3.6801906342057123`*^9}, { 3.680190665865756*^9, 3.6801906674757586`*^9}, {3.680191007020167*^9, 3.680191145620361*^9}, {3.680191176980405*^9, 3.6801912085004487`*^9}, { 3.680191325810613*^9, 3.680191412160734*^9}, {3.680191481260831*^9, 3.6801914918608456`*^9}, {3.6801915407409143`*^9, 3.6801916609210825`*^9}, {3.680191718901163*^9, 3.680191724661172*^9}, { 3.680191798661275*^9, 3.6801918474213433`*^9}, {3.6801920336116037`*^9, 3.680192064282647*^9}, {3.680192966581046*^9, 3.680193025731129*^9}, { 3.680193071341193*^9, 3.680193073591196*^9}, {3.6801931694413304`*^9, 3.6801931716413336`*^9}, {3.680193204341379*^9, 3.680193221921404*^9}, { 3.6801932521514463`*^9, 3.680193327011551*^9}, {3.6801934502717237`*^9, 3.680193456331732*^9}, {3.6801935486538625`*^9, 3.68019367538404*^9}, { 3.6802229763031774`*^9, 3.6802230363632617`*^9}, {3.6802233314036746`*^9, 3.680223369553728*^9}, {3.6802234540458508`*^9, 3.6802234659658675`*^9}, { 3.680223573446018*^9, 3.6802236119760723`*^9}, 3.6802245810804358`*^9, { 3.680224788350726*^9, 3.680224788880727*^9}, {3.68022576742412*^9, 3.68022578184414*^9}, 3.680225916668332*^9, {3.6802259495283785`*^9, 3.680225953498384*^9}, {3.680226611300305*^9, 3.6802266249203243`*^9}, { 3.6803192562639866`*^9, 3.680319259459597*^9}, {3.680323526767522*^9, 3.680323532564666*^9}, {3.681178043042704*^9, 3.6811780432927375`*^9}, { 3.8106202118283577`*^9, 3.8106202163739934`*^9}, {3.81062025582215*^9, 3.8106203134258823`*^9}, {3.810620365714431*^9, 3.8106203716352015`*^9}, { 3.8106204076250334`*^9, 3.810620442976353*^9}, 3.810643826124235*^9, { 3.8222732281351814`*^9, 3.822273261113468*^9}, {3.8222732920005727`*^9, 3.8222733590068817`*^9}, {3.8222872460645876`*^9, 3.822287251402787*^9}}, FontSize->12, ExpressionUUID -> "cd705a8e-6091-464f-8c7d-77623549b419"], Cell[BoxData[ RowBox[{ RowBox[{"darc", "[", RowBox[{"t_", ",", "s_", ",", "r_", ",", "a1_", ",", "a2_"}], "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{ "kut", ",", "kut1", ",", "kut2", ",", "vec1", ",", "vec2", ",", "phi", ",", "dd"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"vec1", "=", RowBox[{"{", RowBox[{ RowBox[{"r", " ", RowBox[{"Cos", "[", "a1", "]"}]}], ",", RowBox[{"r", " ", RowBox[{"Sin", "[", "a1", "]"}]}]}], "}"}]}], ";", RowBox[{"vec2", "=", RowBox[{"{", RowBox[{ RowBox[{"r", " ", RowBox[{"Cos", "[", "a2", "]"}]}], ",", RowBox[{"r", " ", RowBox[{"Sin", "[", "a2", "]"}]}]}], "}"}]}], ";", "\[IndentingNewLine]", RowBox[{"kut1", "=", RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"Norm", "[", RowBox[{"t", "-", "s"}], "]"}], "\[NotEqual]", " ", "0"}], ",", RowBox[{"ArcCos", "[", RowBox[{ RowBox[{"vec1", ".", RowBox[{"(", RowBox[{"t", "-", "s"}], ")"}]}], "/", RowBox[{"(", RowBox[{ RowBox[{"Norm", "[", "vec1", "]"}], " ", RowBox[{"Norm", "[", RowBox[{"t", "-", "s"}], "]"}]}], ")"}]}], "]"}], ",", "0"}], "]"}], "//", "N"}]}], ";", "\[IndentingNewLine]", RowBox[{"kut2", "=", RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"Norm", "[", RowBox[{"t", "-", "s"}], "]"}], "\[NotEqual]", " ", "0"}], ",", RowBox[{"ArcCos", "[", RowBox[{ RowBox[{"vec2", ".", RowBox[{"(", RowBox[{"t", "-", "s"}], ")"}]}], "/", RowBox[{"(", RowBox[{ RowBox[{"Norm", "[", "vec2", "]"}], " ", RowBox[{"Norm", "[", RowBox[{"t", "-", "s"}], "]"}]}], ")"}]}], "]"}], ",", "0"}], "]"}], "//", "N"}]}], ";", "\[IndentingNewLine]", RowBox[{"kut", "=", RowBox[{ RowBox[{"ArcCos", "[", RowBox[{ RowBox[{"vec1", ".", "vec2"}], "/", RowBox[{"(", RowBox[{ RowBox[{"Norm", "[", "vec1", "]"}], " ", RowBox[{"Norm", "[", "vec2", "]"}]}], ")"}]}], "]"}], "//", "N"}]}], ";", "\[IndentingNewLine]", RowBox[{"phi", "=", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"t", "[", RowBox[{"[", "1", "]"}], "]"}], "-", RowBox[{"s", "[", RowBox[{"[", "1", "]"}], "]"}]}], "\[NotEqual]", " ", "0"}], ",", RowBox[{"Arg", "[", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"t", "[", RowBox[{"[", "1", "]"}], "]"}], "-", RowBox[{"s", "[", RowBox[{"[", "1", "]"}], "]"}]}], ")"}], "+", RowBox[{"I", RowBox[{"(", RowBox[{ RowBox[{"t", "[", RowBox[{"[", "2", "]"}], "]"}], "-", RowBox[{"s", "[", RowBox[{"[", "2", "]"}], "]"}]}], ")"}]}]}], "]"}], ",", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"t", "[", RowBox[{"[", "2", "]"}], "]"}], "-", RowBox[{"s", "[", RowBox[{"[", "2", "]"}], "]"}]}], ">", "0"}], ",", RowBox[{"Pi", "/", "2"}], ",", RowBox[{"3", RowBox[{"Pi", "/", "2"}]}]}], "]"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"Round", "[", RowBox[{ RowBox[{"kut1", "+", "kut2", "-", "kut"}], ",", RowBox[{"10", "^", RowBox[{"(", RowBox[{"-", "7"}], ")"}]}]}], "]"}], "\[Equal]", "0"}], ",", RowBox[{"dd", "=", RowBox[{"Abs", "[", RowBox[{ RowBox[{"Norm", "[", RowBox[{"s", "-", "t"}], "]"}], "-", "r"}], "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"dd", "=", RowBox[{"Min", "[", RowBox[{ RowBox[{"Norm", "[", RowBox[{"t", "-", "s", "-", "vec1"}], "]"}], ",", RowBox[{"Norm", "[", RowBox[{"t", "-", "s", "-", "vec2"}], "]"}]}], "]"}]}]}], "\[IndentingNewLine]", " ", "]"}], ";", "\[IndentingNewLine]", "dd"}]}], "]"}]}]], "Input", CellChangeTimes->{{3.8222733896935244`*^9, 3.8222733909635897`*^9}},ExpressionUUID->"4a50fca9-a301-461e-a835-\ 928f4b0393fd"] }, Open ]] }, WindowSize->{771, 279}, WindowMargins->{{0, Automatic}, {Automatic, 0}}, FrontEndVersion->"11.0 for Microsoft Windows (64-bit) (September 21, 2016)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[580, 22, 2485, 34, 39, "Subsubsection"], Cell[3068, 58, 3981, 76, 85, "Text"], Cell[7052, 136, 4711, 134, 221, "Input"] }, Open ]] } ] *)