(* 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[ 8191, 253] NotebookOptionsPosition[ 7826, 236] NotebookOutlinePosition[ 8174, 251] CellTagsIndexPosition[ 8131, 248] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell[TextData[{ StyleBox["Projection of the point ", FontColor->RGBColor[1, 0, 0]], Cell[BoxData[ FormBox[ RowBox[{" ", SubscriptBox["T", "0"]}], TraditionalForm]], FontColor->RGBColor[1, 0, 0], ExpressionUUID -> "3a9bbd34-ecfe-4222-b766-53d557b1aa5d"], StyleBox[" = (", FontColor->RGBColor[1, 0, 0]], Cell[BoxData[ FormBox[ RowBox[{ SubscriptBox["x", "0"], " "}], TraditionalForm]], "Subsection", FontColor->RGBColor[1, 0, 0], ExpressionUUID -> "8d083ee7-4df7-46ba-88aa-19b2d30c77a6"], StyleBox[", ", FontColor->RGBColor[1, 0, 0]], Cell[BoxData[ FormBox[ SubscriptBox["y", "0"], TraditionalForm]], FontColor->RGBColor[1, 0, 0], ExpressionUUID -> "8e06ef26-04c6-4fda-a353-40398dacf741"], StyleBox[") to the normalized line \[Alpha]x + \[Beta]y + \[Gamma] = 0, ", FontColor->RGBColor[1, 0, 0]], Cell[BoxData[ FormBox[ RowBox[{" ", SuperscriptBox["\[Alpha]", "2"]}], TraditionalForm]], FontColor->RGBColor[1, 0, 0], ExpressionUUID -> "417f7d4d-4589-4d34-a618-98831f25bb94"], StyleBox[" +", FontColor->RGBColor[1, 0, 0]], Cell[BoxData[ FormBox[ SuperscriptBox["\[Beta]", "2"], TraditionalForm]], FontColor->RGBColor[1, 0, 0], ExpressionUUID -> "b323f3af-602d-4808-932f-3b822992f5a1"], StyleBox[" = 1, in the plane", FontColor->RGBColor[1, 0, 0]] }], "Subsubsection", CellChangeTimes->{{3.804660561419529*^9, 3.8046605739937973`*^9}, { 3.8046606104835944`*^9, 3.804660613594492*^9}, {3.820899719613538*^9, 3.8208997478689404`*^9}, {3.8208997782833557`*^9, 3.8208999376598244`*^9}, { 3.822314837269457*^9, 3.8223148376645164`*^9}}, ExpressionUUID -> "c2b2321a-7a34-4f86-8b15-b7f243c5e941"], Cell[BoxData[{ RowBox[{ RowBox[{ StyleBox["Input", FontColor->RGBColor[1, 0, 0]], StyleBox[":", FontColor->RGBColor[1, 0, 0]], StyleBox[" ", FontColor->RGBColor[0, 0, 1]], StyleBox[ RowBox[{"parameters", " ", "\[Alpha]"}], FontColor->RGBColor[0, 0, 1]]}], StyleBox[",", FontColor->RGBColor[0, 0, 1]], StyleBox[" ", FontColor->RGBColor[0, 0, 1]], StyleBox["\[Beta]", FontColor->RGBColor[0, 0, 1]], StyleBox[",", FontColor->RGBColor[0, 0, 1]], StyleBox[" ", FontColor->RGBColor[0, 0, 1]], StyleBox["\[Gamma]", FontColor->RGBColor[0, 0, 1]], StyleBox[",", FontColor->RGBColor[0, 0, 1]], StyleBox[ RowBox[{ RowBox[{ FormBox[ RowBox[{" ", SuperscriptBox["\[Alpha]", "2"]}], TraditionalForm], "+", FormBox[ SuperscriptBox["\[Beta]", "2"], TraditionalForm]}], " ", "=", " ", RowBox[{"1", " ", "of", " ", "the", " ", "normalized", " ", "line"}]}], FontColor->RGBColor[0, 0, 1]], StyleBox[",", FontColor->RGBColor[0, 0, 1]], StyleBox[" ", FontColor->RGBColor[0, 0, 1]], StyleBox[ RowBox[{ RowBox[{"point", FormBox[ RowBox[{" ", RowBox[{ SubscriptBox["T", "0"], " ", "=", RowBox[{"(", RowBox[{ SubscriptBox["x", "0"], ",", SubscriptBox["y", "0"]}], ")"}]}]}], TraditionalForm]}], ";"}], FontColor->RGBColor[0, 0, 1]]}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{ StyleBox["Output", FontColor->RGBColor[1, 0, 0]], StyleBox[":", FontColor->RGBColor[1, 0, 0]], StyleBox[" ", FontColor->RGBColor[0, 0, 1]], StyleBox[ RowBox[{"distance", " ", "from", " ", "the", " ", "point", " ", StyleBox[ SubscriptBox["T", "0"], FontSlant->"Italic"], " ", "to", " ", "the", " ", "line", " ", "and", " ", "projection", " ", "of", " ", "the", " ", "point", " ", StyleBox[ SubscriptBox["T", "0"], FontSlant->"Italic"], " ", "to", " ", "the", " ", "line"}], FontColor->RGBColor[0, 0, 1]]}], StyleBox[";", FontColor->RGBColor[0, 0, 1]]}], StyleBox[" ", FontColor->RGBColor[0, 0, 1]]}], "\[IndentingNewLine]", RowBox[{ StyleBox["Submodules", FontColor->RGBColor[1, 0, 0]], StyleBox[":", FontColor->RGBColor[1, 0, 0]], StyleBox[" ", FontColor->RGBColor[0, 0, 1]], StyleBox[ RowBox[{"none", " ", "needed"}], FontColor->RGBColor[0, 0, 1]]}], "\[IndentingNewLine]"}], "Text", CellChangeTimes->{{3.804660582707226*^9, 3.804660726746016*^9}, { 3.8046608075198083`*^9, 3.8046608079672318`*^9}, {3.8046616289908657`*^9, 3.8046616382433853`*^9}, {3.804661710074497*^9, 3.804661711908812*^9}, { 3.804684442137705*^9, 3.804684511082925*^9}, {3.80468454270592*^9, 3.80468462842653*^9}, {3.8208999461486716`*^9, 3.820899948625454*^9}, { 3.82089999046113*^9, 3.8209001039830046`*^9}, {3.820900163282563*^9, 3.820900182317277*^9}, {3.8209002202722216`*^9, 3.8209002611282854`*^9}, { 3.822314844506218*^9, 3.8223148551979866`*^9}}, FontSize->12, ExpressionUUID -> "2d84f849-0398-495b-80e6-7a8fd8c9a1be"], Cell[BoxData[ RowBox[{"\[IndentingNewLine]", RowBox[{ RowBox[{"Proj", "[", RowBox[{"line_", ",", "T_"}], "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{"n0", ",", "u0", ",", "d", ",", "Tp"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"n0", "=", RowBox[{"{", RowBox[{ RowBox[{"line", "[", RowBox[{"[", "1", "]"}], "]"}], ",", RowBox[{"line", "[", RowBox[{"[", "2", "]"}], "]"}]}], "}"}]}], ";", "\[IndentingNewLine]", RowBox[{"u0", "=", RowBox[{"{", RowBox[{ RowBox[{"-", RowBox[{"line", "[", RowBox[{"[", "2", "]"}], "]"}]}], ",", RowBox[{"line", "[", RowBox[{"[", "1", "]"}], "]"}]}], "}"}]}], ";", "\[IndentingNewLine]", RowBox[{"d", "=", RowBox[{"Abs", "[", RowBox[{ RowBox[{ RowBox[{"line", "[", RowBox[{"[", "1", "]"}], "]"}], RowBox[{"T", "[", RowBox[{"[", "1", "]"}], "]"}]}], "+", RowBox[{ RowBox[{"line", "[", RowBox[{"[", "2", "]"}], "]"}], RowBox[{"T", "[", RowBox[{"[", "2", "]"}], "]"}]}], "+", RowBox[{"line", "[", RowBox[{"[", "3", "]"}], "]"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"Tp", "=", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{"T", ".", "u0"}], ")"}], "u0"}], "-", RowBox[{ RowBox[{"line", "[", RowBox[{"[", "3", "]"}], "]"}], " ", "n0"}]}]}], ";", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"d", ",", "Tp"}], "}"}]}]}], "\[IndentingNewLine]", "]"}]}]}]], "Input", CellChangeTimes->{{3.804660582707226*^9, 3.804660726746016*^9}, { 3.8046608075198083`*^9, 3.8046608079672318`*^9}, {3.8046616289908657`*^9, 3.8046616382433853`*^9}, {3.804661710074497*^9, 3.804661711908812*^9}, { 3.804684442137705*^9, 3.804684511082925*^9}, {3.80468454270592*^9, 3.80468462842653*^9}, {3.8208999461486716`*^9, 3.820899948625454*^9}, { 3.82089999046113*^9, 3.8209001039830046`*^9}, {3.820900163282563*^9, 3.820900182317277*^9}, {3.8209002202722216`*^9, 3.8209002611282854`*^9}, 3.822314844506218*^9}, ExpressionUUID -> "2d84f849-0398-495b-80e6-7a8fd8c9a1be"] }, Open ]] }, WindowSize->{1536, 779}, WindowMargins->{{-8, Automatic}, {Automatic, -8}}, 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, 1675, 46, 41, "Subsubsection"], Cell[2258, 70, 3162, 97, 85, "Text"], Cell[5423, 169, 2387, 64, 164, "Input"] }, Open ]] } ] *)