Skip to content

Instantly share code, notes, and snippets.

@andrejbauer
Last active September 25, 2020 10:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrejbauer/bf5caf76d9c1c780880ec365a83354a9 to your computer and use it in GitHub Desktop.
Save andrejbauer/bf5caf76d9c1c780880ec365a83354a9 to your computer and use it in GitHub Desktop.
Generation of constructible numbers in Mathematica
(* Content-type: application/vnd.wolfram.mathematica *)
(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)
(* CreatedBy='Mathematica 11.2' *)
(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[ 158, 7]
NotebookDataLength[ 51649, 1366]
NotebookOptionsPosition[ 49793, 1329]
NotebookOutlinePosition[ 50217, 1346]
CellTagsIndexPosition[ 50174, 1343]
WindowFrame->Normal*)
(* Beginning of Notebook Content *)
Notebook[{
Cell[CellGroupData[{
Cell["Constructible numbers", "Title",
CellChangeTimes->{{3.779040438376588*^9,
3.779040442050851*^9}},ExpressionUUID->"d0ee6d14-7f3f-4d5b-9c0b-\
20976882697d"],
Cell[BoxData[{
RowBox[{"ClearAll", "[", "dist", "]"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"dist", "[",
RowBox[{"p_", ",", "q_"}], "]"}], ":=",
RowBox[{"Norm", "[",
RowBox[{"p", "-", "q"}], "]"}]}]}], "Input",
CellChangeTimes->{{3.7790442870546007`*^9, 3.779044334370728*^9}},
CellLabel->"In[1]:=",ExpressionUUID->"175a20ad-2ae5-49df-8af8-28c63628f390"],
Cell[BoxData[{
RowBox[{"ClearAll", "[",
RowBox[{"equalTo", ",", "elemShape", ",", "elemPoint"}],
"]"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"equalTo", "[",
RowBox[{
RowBox[{"line", "[",
RowBox[{"a1_", ",", "b1_", ",", "c1_"}], "]"}], ",",
RowBox[{"line", "[",
RowBox[{"a2_", ",", "b2_", ",", "c2_"}], "]"}]}], "]"}], ":=",
"\[IndentingNewLine]",
RowBox[{"Reduce", "[",
RowBox[{
RowBox[{
RowBox[{
RowBox[{"a1", "*", "b2"}], "-",
RowBox[{"a2", "*", "b1"}]}], "\[Equal]", "0"}], "\[And]",
RowBox[{
RowBox[{"c1", "*", "a2"}], "\[Equal]",
RowBox[{"c2", "*", "a1"}]}], "\[And]",
RowBox[{
RowBox[{"c1", "*", "b2"}], "\[Equal]",
RowBox[{"c2", "*", "b1"}]}]}], "]"}]}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"equalTo", "[",
RowBox[{"l_line", ",", "c_circle"}], "]"}], ":=",
"False"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"equalTo", "[",
RowBox[{
RowBox[{"circle", "[",
RowBox[{
RowBox[{"{",
RowBox[{"x1_", ",", "y1_"}], "}"}], ",", "r1_"}], "]"}], ",",
RowBox[{"circle", "[",
RowBox[{
RowBox[{"{",
RowBox[{"x2_", ",", "y2_"}], "}"}], ",", "r2_"}], "]"}]}], "]"}], ":=",
"\[IndentingNewLine]",
RowBox[{"Reduce", "[",
RowBox[{
RowBox[{"x1", "\[Equal]", "x2"}], "\[And]",
RowBox[{"y1", "\[Equal]", "y2"}], "\[And]",
RowBox[{"r1", "\[Equal]", "r2"}]}], "]"}]}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"equalTo", "[",
RowBox[{"c_circle", ",", "l_line"}], "]"}], ":=", "False"}],
"\[IndentingNewLine]"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"elemShape", "::", "boole"}], "=",
"\"\<The value `1` is not True or False.\>\""}],
";"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"elemShape", "[",
RowBox[{"s_", ",",
RowBox[{"{", "}"}]}], "]"}], ":=", "False"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"elemShape", "[",
RowBox[{"s_", ",",
RowBox[{"{",
RowBox[{"t_", ",", "ts___"}], "}"}]}], "]"}], ":=",
RowBox[{"With", "[",
RowBox[{
RowBox[{"{",
RowBox[{"b", "=",
RowBox[{"equalTo", "[",
RowBox[{"s", ",", "t"}], "]"}]}], "}"}], ",", "\[IndentingNewLine]",
RowBox[{"Switch", "[",
RowBox[{
"b", ",", "\[IndentingNewLine]", "True", ",", "True", ",",
"\[IndentingNewLine]", "False", ",",
RowBox[{"elemShape", "[",
RowBox[{"s", ",",
RowBox[{"{", "ts", "}"}]}], "]"}], ",", "\[IndentingNewLine]", "_",
",",
RowBox[{"(",
RowBox[{
RowBox[{"Message", "[",
RowBox[{
RowBox[{"elemShape", "::", "boole"}], ",", "b"}], "]"}], ";",
RowBox[{"Abort", "[", "]"}]}], ")"}]}], "\[IndentingNewLine]",
"]"}]}], "\[IndentingNewLine]", "]"}]}],
"\[IndentingNewLine]"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"elemPoint", "::", "boole"}], "=",
"\"\<The value `1` is not True or False.\>\""}],
";"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"elemPoint", "[",
RowBox[{"p_", ",",
RowBox[{"{", "}"}]}], "]"}], ":=", "False"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"elemPoint", "[",
RowBox[{"p_", ",",
RowBox[{"{",
RowBox[{"q_", ",", "qs___"}], "}"}]}], "]"}], ":=",
RowBox[{"With", "[",
RowBox[{
RowBox[{"{",
RowBox[{"b", "=",
RowBox[{"Reduce", "[",
RowBox[{
RowBox[{
RowBox[{"p", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}],
"\[Equal]",
RowBox[{
"q", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], "&&",
RowBox[{
RowBox[{"p", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}],
"\[Equal]",
RowBox[{
"q", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}]}]}],
"]"}]}], "}"}], ",", "\[IndentingNewLine]",
RowBox[{"Switch", "[",
RowBox[{
"b", ",", "\[IndentingNewLine]", "True", ",", "True", ",",
"\[IndentingNewLine]", "False", ",",
RowBox[{"elemPoint", "[",
RowBox[{"p", ",",
RowBox[{"{", "qs", "}"}]}], "]"}], ",", "\[IndentingNewLine]", "_",
",",
RowBox[{"(",
RowBox[{
RowBox[{"Message", "[",
RowBox[{
RowBox[{"elemPoint", "::", "boole"}], ",", "b"}], "]"}], ";",
RowBox[{"Abort", "[", "]"}]}], ")"}]}], "\[IndentingNewLine]",
"]"}]}], "\[IndentingNewLine]", "]"}]}], "\[IndentingNewLine]"}], "Input",\
CellChangeTimes->{{3.779075228054405*^9, 3.7790752714989433`*^9}, {
3.77907538951341*^9, 3.7790754357301083`*^9}, {3.77907549355214*^9,
3.7790755005998173`*^9}, {3.77907585385707*^9, 3.779075873395331*^9}, {
3.779075917811008*^9, 3.779075924699594*^9}, {3.77907613858146*^9,
3.7790761915605307`*^9}, {3.779076361291265*^9, 3.779076416613443*^9}, {
3.77907700403061*^9, 3.7790771764968357`*^9}, {3.7790772190315*^9,
3.7790772312178593`*^9}, {3.7790772720128717`*^9, 3.77907731392869*^9}, {
3.7790774232111397`*^9, 3.7790774346398*^9}, {3.779077725747649*^9,
3.779077775946443*^9}, {3.779077808646714*^9, 3.779077848357255*^9}, {
3.779077976855464*^9, 3.779078004670417*^9}, {3.779078037210372*^9,
3.779078046888691*^9}, {3.779079052970264*^9, 3.779079239320182*^9}, {
3.779079777089425*^9, 3.779079783080798*^9}},
CellLabel->"In[3]:=",ExpressionUUID->"58bdd9ad-b7dc-4360-b65d-031d00810b1e"],
Cell[BoxData[{
RowBox[{"ClearAll", "[",
RowBox[{"circle", ",", "circles", ",", "line", ",", "lines"}],
"]"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"circles", "[",
RowBox[{"p_", ",", "q_"}], "]"}], ":=",
RowBox[{"With", "[",
RowBox[{
RowBox[{"{",
RowBox[{"r", "=",
RowBox[{"FullSimplify", "@",
RowBox[{"dist", "[",
RowBox[{"p", ",", "q"}], "]"}]}]}], "}"}], ",",
RowBox[{"{",
RowBox[{
RowBox[{"circle", "[",
RowBox[{"p", ",", "r"}], "]"}], ",",
RowBox[{"circle", "[",
RowBox[{"q", ",", "r"}], "]"}]}], "}"}]}],
"]"}]}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"lines", "[",
RowBox[{
RowBox[{"{",
RowBox[{"px_", ",", "py_"}], "}"}], ",",
RowBox[{"{",
RowBox[{"qx_", ",", "qy_"}], "}"}]}], "]"}], ":=",
RowBox[{"{",
RowBox[{"line", "[",
RowBox[{
RowBox[{"qy", "-", "py"}], ",",
RowBox[{"px", "-", "qx"}], ",",
RowBox[{
RowBox[{"px", "*", "qy"}], "-",
RowBox[{"py", "*", "qx"}]}]}], "]"}], "}"}]}]}], "Input",
CellChangeTimes->{{3.779044221209824*^9, 3.7790442749821577`*^9}, {
3.779044356191331*^9, 3.7790444175210333`*^9}, {3.7790444725653954`*^9,
3.7790445156856737`*^9}, {3.779077645248541*^9, 3.779077656914371*^9}, {
3.779078141285185*^9, 3.779078143682063*^9}, {3.779078834839727*^9,
3.779078838335267*^9}, {3.7790795166875*^9, 3.7790795172996387`*^9}},
CellLabel->"In[14]:=",ExpressionUUID->"c8612a4b-1454-4d16-9c93-86ad62c4093e"],
Cell[BoxData[{
RowBox[{"ClearAll", "[", "pointsOf", "]"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"pointsOf", "[", "solutions_", "]"}], ":=",
RowBox[{"Union", "[",
RowBox[{
RowBox[{
RowBox[{"(",
RowBox[{
RowBox[{"{",
RowBox[{"x", ",", "y"}], "}"}], "/.", "#"}], ")"}], "&"}], "/@",
"solutions"}], "]"}]}]}], "Input",
CellChangeTimes->{{3.77904394122855*^9, 3.779043964843912*^9}, {
3.7790795222479877`*^9, 3.77907952395959*^9}},
CellLabel->"In[17]:=",ExpressionUUID->"68470958-aef8-4568-bdca-11274cc65b1c"],
Cell[BoxData[{
RowBox[{"ClearAll", "[", "intersect", "]"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"intersect", "[",
RowBox[{
RowBox[{"circle", "[",
RowBox[{
RowBox[{"{",
RowBox[{"x1_", ",", "y1_"}], "}"}], ",", "r1_"}], "]"}], ",",
RowBox[{"circle", "[",
RowBox[{
RowBox[{"{",
RowBox[{"x2_", ",", "y2_"}], "}"}], ",", "r2_"}], "]"}]}], "]"}], ":=",
RowBox[{"pointsOf", "@",
RowBox[{"Solve", "[",
RowBox[{
RowBox[{"{",
RowBox[{
RowBox[{
RowBox[{
SuperscriptBox[
RowBox[{"(",
RowBox[{"x", "-", "x1"}], ")"}], "2"], "+",
SuperscriptBox[
RowBox[{"(",
RowBox[{"y", "-", "y1"}], ")"}], "2"]}], "\[Equal]",
SuperscriptBox["r1", "2"]}], ",",
RowBox[{
RowBox[{
SuperscriptBox[
RowBox[{"(",
RowBox[{"x", "-", "x2"}], ")"}], "2"], "+",
SuperscriptBox[
RowBox[{"(",
RowBox[{"y", "-", "y2"}], ")"}], "2"]}], "\[Equal]",
SuperscriptBox["r2", "2"]}]}], "}"}], ",",
RowBox[{"{",
RowBox[{"x", ",", "y"}], "}"}], ",", "Reals"}], "]"}]}]}],
"\[IndentingNewLine]"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"intersect", "[",
RowBox[{
RowBox[{"line", "[",
RowBox[{"a1_", ",", "b1_", ",", "c1_"}], "]"}], ",",
RowBox[{"line", "[",
RowBox[{"a2_", ",", "b2_", ",", "c2_"}], "]"}]}], "]"}], ":=",
"\[IndentingNewLine]",
RowBox[{"pointsOf", "@",
RowBox[{"Solve", "[",
RowBox[{
RowBox[{"{",
RowBox[{
RowBox[{
RowBox[{
RowBox[{"a1", "*", "x"}], "+",
RowBox[{"b1", "*", "y"}]}], "\[Equal]", "c1"}], ",",
RowBox[{
RowBox[{
RowBox[{"a2", "*", "x"}], "+",
RowBox[{"b2", "*", "y"}]}], "\[Equal]", "c2"}]}], "}"}], ",",
RowBox[{"{",
RowBox[{"x", ",", "y"}], "}"}]}], "]"}]}]}],
"\[IndentingNewLine]"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"intersect", "[",
RowBox[{
RowBox[{"line", "[",
RowBox[{"a1_", ",", "b1_", ",", "c1_"}], "]"}], ",",
RowBox[{"circle", "[",
RowBox[{
RowBox[{"{",
RowBox[{"x2_", ",", "y2_"}], "}"}], ",", "r2_"}], "]"}]}], "]"}], ":=",
"\[IndentingNewLine]",
RowBox[{"pointsOf", "@",
RowBox[{"Solve", "[",
RowBox[{
RowBox[{"{",
RowBox[{
RowBox[{
RowBox[{
RowBox[{"a1", "*", "x"}], "+",
RowBox[{"b1", "*", "y"}]}], "\[Equal]", "c1"}], ",", " ",
RowBox[{
RowBox[{
SuperscriptBox[
RowBox[{"(",
RowBox[{"x", "-", "x2"}], ")"}], "2"], "+",
SuperscriptBox[
RowBox[{"(",
RowBox[{"y", "-", "y2"}], ")"}], "2"]}], "\[Equal]",
SuperscriptBox["r2", "2"]}]}], "}"}], ",",
RowBox[{"{",
RowBox[{"x", ",", "y"}], "}"}], ",", "Reals"}], "]"}]}]}],
"\[IndentingNewLine]"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"intersect", "[",
RowBox[{
RowBox[{"circle", "[",
RowBox[{
RowBox[{"{",
RowBox[{"x1_", ",", "y1_"}], "}"}], ",", "r1_"}], "]"}], ",", " ",
RowBox[{"line", "[",
RowBox[{"a2_", ",", "b2_", ",", "c2_"}], "]"}]}], "]"}], ":=",
"\[IndentingNewLine]",
RowBox[{"pointsOf", "@",
RowBox[{"Solve", "[",
RowBox[{
RowBox[{"{",
RowBox[{
RowBox[{
RowBox[{
SuperscriptBox[
RowBox[{"(",
RowBox[{"x", "-", "x1"}], ")"}], "2"], "+",
SuperscriptBox[
RowBox[{"(",
RowBox[{"y", "-", "y1"}], ")"}], "2"]}], "\[Equal]",
SuperscriptBox["r1", "2"]}], ",", " ",
RowBox[{
RowBox[{
RowBox[{"a2", "*", "x"}], "+",
RowBox[{"b2", "*", "y"}]}], "\[Equal]", "c2"}]}], "}"}], ",",
RowBox[{"{",
RowBox[{"x", ",", "y"}], "}"}], ",", "Reals"}], "]"}]}]}]}], "Input",
CellChangeTimes->{{3.779040524007328*^9, 3.779040552741211*^9}, {
3.779040714660832*^9, 3.779040757324848*^9}, {3.7790436370641317`*^9,
3.77904367618001*^9}, {3.7790437624133883`*^9, 3.7790438513344593`*^9}, {
3.779043884688589*^9, 3.779043936117599*^9}, {3.779043970434897*^9,
3.7790442184016314`*^9}, {3.7790455356861677`*^9, 3.779045537693041*^9}, {
3.779079618235774*^9, 3.779079636425366*^9}, {3.779079680886754*^9,
3.779079689370858*^9}, {3.7790797460825872`*^9, 3.779079759168322*^9}},
CellLabel->"In[19]:=",ExpressionUUID->"641df187-11fe-4471-b5f4-c4525434fef2"],
Cell[BoxData[{
RowBox[{"ClearAll", "[",
RowBox[{
"addShape", ",", "addPoint", ",", "uniqueShapes", ",", "uniquePoints", ",",
"generateShapes", ",", " ", "generatePoints", ",", "generate"}],
"]"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"addShape", "[",
RowBox[{"shapes_List", ",", "s_"}], "]"}], ":=",
RowBox[{"If", "[",
RowBox[{
RowBox[{"elemShape", "[",
RowBox[{"s", ",", "shapes"}], "]"}], ",", "shapes", ",",
RowBox[{"Append", "[",
RowBox[{"shapes", ",", "s"}], "]"}]}], "]"}]}],
"\[IndentingNewLine]"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"uniqueShapes", "[",
RowBox[{"{", "}"}], "]"}], ":=",
RowBox[{"{", "}"}]}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"uniqueShapes", "[",
RowBox[{"{",
RowBox[{"s_", ",", "ss___"}], "}"}], "]"}], ":=",
RowBox[{"addShape", "[",
RowBox[{
RowBox[{"uniqueShapes", "[",
RowBox[{"{", "ss", "}"}], "]"}], ",", "s"}], "]"}]}],
"\[IndentingNewLine]"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"addPoint", "[",
RowBox[{"points_List", ",", "p_"}], "]"}], ":=",
RowBox[{"If", "[",
RowBox[{
RowBox[{"elemPoint", "[",
RowBox[{"p", ",", "points"}], "]"}], ",", "points", ",",
RowBox[{"Append", "[",
RowBox[{"points", ",", "p"}], "]"}]}], "]"}]}],
"\[IndentingNewLine]"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"uniquePoints", "[",
RowBox[{"{", "}"}], "]"}], ":=",
RowBox[{"{", "}"}]}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"uniquePoints", "[",
RowBox[{"{",
RowBox[{"p_", ",", "ps___"}], "}"}], "]"}], ":=",
RowBox[{"addPoint", "[",
RowBox[{
RowBox[{"uniquePoints", "[",
RowBox[{"{", "ps", "}"}], "]"}], ",", "p"}], "]"}]}],
"\[IndentingNewLine]"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"generateShapes", "[", "ps_", "]"}], ":=",
RowBox[{"uniqueShapes", "@",
RowBox[{"Flatten", "[",
RowBox[{
RowBox[{
RowBox[{"Function", "[",
RowBox[{"pq", ",",
RowBox[{"Join", "[",
RowBox[{
RowBox[{"circles", "[",
RowBox[{
RowBox[{
"pq", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}],
",",
RowBox[{
"pq", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}]}],
"]"}], ",",
RowBox[{"lines", "[",
RowBox[{
RowBox[{
"pq", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}],
",",
RowBox[{
"pq", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}]}],
"]"}]}], "]"}]}], "]"}], "/@",
RowBox[{"Subsets", "[",
RowBox[{"ps", ",",
RowBox[{"{", "2", "}"}]}], "]"}]}], ",", "1"}], "]"}]}]}],
"\[IndentingNewLine]"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"generatePoints", "[", "ps_", "]"}], ":=",
RowBox[{"uniquePoints", "@",
RowBox[{"Join", "[",
RowBox[{"ps", ",",
RowBox[{"Flatten", "[",
RowBox[{
RowBox[{
RowBox[{
RowBox[{"(",
RowBox[{"intersect", "@@", "#"}], ")"}], "&"}], "/@",
RowBox[{"Subsets", "[",
RowBox[{
RowBox[{"generateShapes", "[", "ps", "]"}], ",",
RowBox[{"{", "2", "}"}]}], "]"}]}], ",", "1"}], "]"}]}],
"]"}]}]}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"generate", "[",
RowBox[{"n_", ",",
RowBox[{"generators_", ":",
RowBox[{"{",
RowBox[{
RowBox[{"{",
RowBox[{
RowBox[{"-", "1"}], ",", "0"}], "}"}], ",",
RowBox[{"{",
RowBox[{"1", ",", "0"}], "}"}]}], "}"}]}]}], "]"}], ":=",
RowBox[{"Nest", "[",
RowBox[{"generatePoints", ",", "generators", ",", "n"}], "]"}]}]}], "Input",\
CellChangeTimes->CompressedData["
1:eJwdyV8oAwEAx/ELl3/FgzAedFrNeFyueFA3PEhaGt5IsZ1c+1fyjJSyFwlz
dKtRojATU3jjjVqGrjW6urvFWmt5OFsK8buHb5+Hb/OE1+4sIgjC8B8UlrmA
1pK1aqpnEyqxWwEeHFmikH+IX0KWmr+B2/yZCF+M+6/QP1UpQ7s4pEDCcZqD
FalrXdps+oQNwa4fSNZfVJeYs9Zfg1oLvSzTBE0+noIjXFkrPCm974QRea4b
7i0ae2HicLcPBp3t/TAn0aOwUMzovsWep2EgrOlG8pMr8K7jaRUOfCW3oCvT
I8CFjdkQHJZsO/DR4jiGdWG3rpRqPIdLYjwKkzWJD9jGqroMOZOH3zJRgFXv
VySJH6LK4XqadkMbN+aDnvFBP8y4lDX4B6sytWo=
"],
CellLabel->"In[24]:=",ExpressionUUID->"96d5ee16-b21c-4c3b-ab68-92bcbd9907f3"],
Cell[BoxData[{
RowBox[{"ClearAll", "[",
RowBox[{"toGraphics", ",", " ", "draw"}], "]"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"toGraphics", "[",
RowBox[{"circle", "[",
RowBox[{"p_", ",", "r_"}], "]"}], "]"}], ":=",
RowBox[{"Circle", "[",
RowBox[{"p", ",", "r"}], "]"}]}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"toGraphics", "[",
RowBox[{"line", "[",
RowBox[{"a_", ",", "0", ",", "c_"}], "]"}], "]"}], ":=",
RowBox[{"InfiniteLine", "[",
RowBox[{"{",
RowBox[{
RowBox[{"{",
RowBox[{
RowBox[{"c", "/", "a"}], ",", "0"}], "}"}], ",",
RowBox[{"{",
RowBox[{
RowBox[{"c", "/", "a"}], ",", "1"}], "}"}]}], "}"}],
"]"}]}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"toGraphics", "[",
RowBox[{"line", "[",
RowBox[{"a_", ",", "b_", ",", "c_"}], "]"}], "]"}], ":=",
RowBox[{"InfiniteLine", "[",
RowBox[{"{",
RowBox[{
RowBox[{"{",
RowBox[{"0", ",",
RowBox[{"c", "/", "b"}]}], "}"}], ",",
RowBox[{"{",
RowBox[{"1", ",",
RowBox[{
RowBox[{"(",
RowBox[{"c", "-", "a"}], ")"}], "/", "b"}]}], "}"}]}], "}"}],
"]"}]}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"toGraphics", "[", "obs_List", "]"}], ":=",
RowBox[{"toGraphics", "/@", "obs"}]}],
"\[IndentingNewLine]"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"draw", "[", "obs_", "]"}], ":=",
RowBox[{"Graphics", "[",
RowBox[{
RowBox[{"{",
RowBox[{"Thin", ",",
RowBox[{"toGraphics", "[", "obs", "]"}]}], "}"}], ",",
RowBox[{"AspectRatio", "\[Rule]", "Automatic"}]}], "]"}]}]}], "Input",
CellChangeTimes->{{3.809928213383772*^9, 3.809928272896276*^9}, {
3.8099283354470177`*^9, 3.809928355719696*^9}, {3.809928389324456*^9,
3.8099284531911077`*^9}, {3.8099285113219976`*^9, 3.809928551146323*^9}, {
3.80992876496803*^9, 3.809928807075822*^9}, {3.809929013402191*^9,
3.809929040750269*^9}, {3.809929095191041*^9, 3.809929124372908*^9}},
CellLabel->"In[92]:=",ExpressionUUID->"89b1bc03-7381-4a7d-8a06-01add0d5b780"],
Cell[BoxData[{
RowBox[{
RowBox[{"$MaxExtraPrecision", " ", "=", " ", "500"}],
";"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"lst", "=",
RowBox[{"generate", "[", "1", "]"}]}], ";"}], "\n",
RowBox[{"lst", "//", "Length"}]}], "Input",
CellChangeTimes->{{3.7790446608183517`*^9, 3.7790446699649553`*^9}, {
3.779044864433549*^9, 3.779044895857731*^9}, {3.779045110377612*^9,
3.779045113216424*^9}, {3.779045350877418*^9, 3.779045393833234*^9}, {
3.779045425055936*^9, 3.779045428071237*^9}, {3.7790455607282677`*^9,
3.779045606078291*^9}, {3.779045670971932*^9, 3.779045671979497*^9}, {
3.779045864050395*^9, 3.779045888885542*^9}, {3.779045919061735*^9,
3.779045928332878*^9}, {3.779076582540563*^9, 3.779076613198968*^9}, {
3.779076648024757*^9, 3.77907666079456*^9}, {3.77907669566971*^9,
3.779076732078848*^9}, 3.779077339087864*^9, {3.779077492233086*^9,
3.779077515218935*^9}, 3.779078086166368*^9, {3.779078162861031*^9,
3.779078167438842*^9}, {3.7790782312746153`*^9, 3.7790782411252747`*^9}, {
3.779078326394677*^9, 3.7790784546851683`*^9}, {3.7790788976852007`*^9,
3.779078929635998*^9}, {3.779078972231194*^9, 3.7790789880336533`*^9}, {
3.7790793418225813`*^9, 3.7790793419939528`*^9}, {3.7790797963266983`*^9,
3.779079859614422*^9}, {3.809925326911923*^9, 3.809925327029037*^9}, {
3.809927955328763*^9, 3.8099279554621058`*^9}},
CellLabel->"In[40]:=",ExpressionUUID->"eaee2c80-2e33-441d-9ba3-f97d473b60f4"],
Cell[CellGroupData[{
Cell[BoxData["lst"], "Input",
CellChangeTimes->{{3.8099279616188917`*^9, 3.809927961864201*^9}},
CellLabel->"In[43]:=",ExpressionUUID->"2cbe8269-6d84-4883-9df3-55cf6f5c392e"],
Cell[BoxData[
RowBox[{"{",
RowBox[{
RowBox[{"{",
RowBox[{"0", ",",
SqrtBox["3"]}], "}"}], ",",
RowBox[{"{",
RowBox[{"0", ",",
RowBox[{"-",
SqrtBox["3"]}]}], "}"}], ",",
RowBox[{"{",
RowBox[{"1", ",", "0"}], "}"}], ",",
RowBox[{"{",
RowBox[{
RowBox[{"-", "3"}], ",", "0"}], "}"}], ",",
RowBox[{"{",
RowBox[{"3", ",", "0"}], "}"}], ",",
RowBox[{"{",
RowBox[{
RowBox[{"-", "1"}], ",", "0"}], "}"}]}], "}"}]], "Output",
CellChangeTimes->{
3.779079894545371*^9, 3.779080805718521*^9, {3.809925320746222*^9,
3.809925330354307*^9}, {3.8099279570796213`*^9, 3.809927962429791*^9}},
CellLabel->"Out[43]=",ExpressionUUID->"183b1c38-adfc-4bd0-8dd5-eaf8a2b2884d"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{
RowBox[{"generateShapes", "[",
RowBox[{"generate", "[", "1", "]"}], "]"}], "//", "draw"}]], "Input",
CellChangeTimes->{{3.809927974500395*^9, 3.809927976510808*^9}, {
3.809928067828821*^9, 3.809928121356572*^9}, {3.80992820514935*^9,
3.809928206160118*^9}, {3.809928811735507*^9, 3.8099288130258837`*^9}, {
3.809928991892107*^9, 3.809929056432959*^9}, {3.8099291388417177`*^9,
3.80992915937175*^9}},
CellLabel->
"In[100]:=",ExpressionUUID->"2c7bcc2b-04ff-47b2-b10e-0ca10685dabc"],
Cell[BoxData[
GraphicsBox[
{Thickness[Tiny],
TagBox[ConicHullRegionBox[{{0, 0}, {1, 0}}],
"InfiniteLine"], CircleBox[{-1, 0}, 4], CircleBox[{3, 0}, 4],
CircleBox[{-1, 0}, 2], CircleBox[{-3, 0}, 2], CircleBox[{3, 0}, 6],
CircleBox[{-3, 0}, 6], CircleBox[{1, 0}, 2], CircleBox[{3, 0}, 2],
CircleBox[{-3, 0}, 4], CircleBox[{1, 0}, 4],
TagBox[
ConicHullRegionBox[
NCache[{{0, -3^Rational[1, 2]}, {1, (-2) 3^Rational[1, 2]}}, {{
0, -1.7320508075688772`}, {1, -3.4641016151377544`}}]],
"InfiniteLine"],
CircleBox[NCache[{0, -3^Rational[1, 2]}, {0, -1.7320508075688772`}], 2],
TagBox[
ConicHullRegionBox[
NCache[{{0, -3^Rational[1, 2]}, {1, (-2) 3^Rational[-1, 2]}}, {{
0, -1.7320508075688772`}, {1, -1.1547005383792517`}}]],
"InfiniteLine"],
CircleBox[{3, 0}, NCache[2 3^Rational[1, 2], 3.4641016151377544`]],
CircleBox[NCache[{0, -3^Rational[1, 2]}, {0, -1.7320508075688772`}],
NCache[2 3^Rational[1, 2], 3.4641016151377544`]],
TagBox[
ConicHullRegionBox[
NCache[{{0, -3^Rational[1, 2]}, {1, (-4) 3^Rational[-1, 2]}}, {{
0, -1.7320508075688772`}, {1, -2.3094010767585034`}}]],
"InfiniteLine"],
CircleBox[{-3, 0}, NCache[2 3^Rational[1, 2], 3.4641016151377544`]],
TagBox[
ConicHullRegionBox[
NCache[{{0, -3^Rational[1, 2]}, {1, 0}}, {{0, -1.7320508075688772`}, {1,
0}}]],
"InfiniteLine"],
TagBox[
ConicHullRegionBox[
NCache[{{0, 3^Rational[1, 2]}, {1, 2 3^Rational[1, 2]}}, {{
0, 1.7320508075688772`}, {1, 3.4641016151377544`}}]],
"InfiniteLine"],
CircleBox[NCache[{0, 3^Rational[1, 2]}, {0, 1.7320508075688772`}], 2],
TagBox[
ConicHullRegionBox[
NCache[{{0, 3^Rational[1, 2]}, {1, 2 3^Rational[-1, 2]}}, {{
0, 1.7320508075688772`}, {1, 1.1547005383792517`}}]],
"InfiniteLine"],
CircleBox[NCache[{0, 3^Rational[1, 2]}, {0, 1.7320508075688772`}], NCache[
2 3^Rational[1, 2], 3.4641016151377544`]],
TagBox[
ConicHullRegionBox[
NCache[{{0, 3^Rational[1, 2]}, {1, 4 3^Rational[-1, 2]}}, {{
0, 1.7320508075688772`}, {1, 2.3094010767585034`}}]],
"InfiniteLine"],
TagBox[
ConicHullRegionBox[
NCache[{{0, 3^Rational[1, 2]}, {1, 0}}, {{0, 1.7320508075688772`}, {1,
0}}]],
"InfiniteLine"],
TagBox[ConicHullRegionBox[{{0, 0}, {0, 1}}],
"InfiniteLine"]},
AspectRatio->Automatic]], "Output",
CellChangeTimes->{{3.809928068571397*^9, 3.8099281223567743`*^9},
3.8099282065850983`*^9, 3.809928813597769*^9, {3.809928992299959*^9,
3.8099290567985783`*^9}, {3.809929103818162*^9, 3.8099291597409143`*^9}},
CellLabel->
"Out[100]=",ExpressionUUID->"6bc01c3a-be1e-42f0-9e8b-9fad7955acd8"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"Reduce", "[",
RowBox[{
RowBox[{
RowBox[{
RowBox[{
SuperscriptBox[
RowBox[{"(",
RowBox[{"x", "-", "x1"}], ")"}], "2"], "+",
SuperscriptBox[
RowBox[{"(",
RowBox[{"y", "-", "y1"}], ")"}], "2"]}], "\[Equal]",
SuperscriptBox["r1", "2"]}], "\[And]",
RowBox[{
RowBox[{
SuperscriptBox[
RowBox[{"(",
RowBox[{"x", "-", "x2"}], ")"}], "2"], "+",
SuperscriptBox[
RowBox[{"(",
RowBox[{"y", "-", "y2"}], ")"}], "2"]}], "\[Equal]",
SuperscriptBox["r2", "2"]}]}], ",",
RowBox[{"{",
RowBox[{"x", ",", "y"}], "}"}]}], "]"}]], "Input",
CellChangeTimes->{{3.809933034147395*^9, 3.809933054958552*^9},
3.809933173119825*^9},
CellLabel->
"In[110]:=",ExpressionUUID->"37726551-294a-4c29-ae5b-d372989890fc"],
Cell[BoxData[
RowBox[{
RowBox[{"(",
RowBox[{
RowBox[{"y1", "\[Equal]", "y2"}], "&&",
RowBox[{"x1", "\[Equal]", "x2"}], "&&",
RowBox[{"(",
RowBox[{
RowBox[{"r1", "\[Equal]",
RowBox[{"-", "r2"}]}], "||",
RowBox[{"r1", "\[Equal]", "r2"}]}], ")"}], "&&",
RowBox[{"(",
RowBox[{
RowBox[{"y", "\[Equal]",
RowBox[{
RowBox[{"-",
SqrtBox[
RowBox[{
SuperscriptBox["r2", "2"], "-",
SuperscriptBox["x", "2"], "+",
RowBox[{"2", " ", "x", " ", "x2"}], "-",
SuperscriptBox["x2", "2"]}]]}], "+", "y2"}]}], "||",
RowBox[{"y", "\[Equal]",
RowBox[{
SqrtBox[
RowBox[{
SuperscriptBox["r2", "2"], "-",
SuperscriptBox["x", "2"], "+",
RowBox[{"2", " ", "x", " ", "x2"}], "-",
SuperscriptBox["x2", "2"]}]], "+", "y2"}]}]}], ")"}]}], ")"}], "||",
RowBox[{"(",
RowBox[{
RowBox[{"y1", "\[Equal]", "y2"}], "&&",
RowBox[{
RowBox[{"x1", "-", "x2"}], "\[NotEqual]", "0"}], "&&",
RowBox[{"x", "\[Equal]",
FractionBox[
RowBox[{
RowBox[{"-",
SuperscriptBox["r1", "2"]}], "+",
SuperscriptBox["r2", "2"], "+",
SuperscriptBox["x1", "2"], "-",
SuperscriptBox["x2", "2"]}],
RowBox[{"2", " ",
RowBox[{"(",
RowBox[{"x1", "-", "x2"}], ")"}]}]]}], "&&",
RowBox[{"(",
RowBox[{
RowBox[{"y", "\[Equal]",
RowBox[{
RowBox[{"-",
SqrtBox[
RowBox[{
SuperscriptBox["r2", "2"], "-",
SuperscriptBox["x", "2"], "+",
RowBox[{"2", " ", "x", " ", "x2"}], "-",
SuperscriptBox["x2", "2"]}]]}], "+", "y2"}]}], "||",
RowBox[{"y", "\[Equal]",
RowBox[{
SqrtBox[
RowBox[{
SuperscriptBox["r2", "2"], "-",
SuperscriptBox["x", "2"], "+",
RowBox[{"2", " ", "x", " ", "x2"}], "-",
SuperscriptBox["x2", "2"]}]], "+", "y2"}]}]}], ")"}]}], ")"}], "||",
RowBox[{"(",
RowBox[{
RowBox[{"(",
RowBox[{
RowBox[{"x1", "\[Equal]",
RowBox[{"x2", "-",
SqrtBox[
RowBox[{
RowBox[{"-",
SuperscriptBox["y1", "2"]}], "+",
RowBox[{"2", " ", "y1", " ", "y2"}], "-",
SuperscriptBox["y2", "2"]}]]}]}], "||",
RowBox[{"x1", "\[Equal]",
RowBox[{"x2", "+",
SqrtBox[
RowBox[{
RowBox[{"-",
SuperscriptBox["y1", "2"]}], "+",
RowBox[{"2", " ", "y1", " ", "y2"}], "-",
SuperscriptBox["y2", "2"]}]]}]}]}], ")"}], "&&",
RowBox[{
RowBox[{
RowBox[{"(",
RowBox[{
SuperscriptBox["r1", "2"], "-",
SuperscriptBox["r2", "2"]}], ")"}], " ",
RowBox[{"(",
RowBox[{"x1", "-", "x2"}], ")"}]}], "\[NotEqual]", "0"}], "&&",
RowBox[{"x", "\[Equal]",
RowBox[{
FractionBox["1",
RowBox[{"4", " ",
RowBox[{"(",
RowBox[{
SuperscriptBox["r1", "2"], "-",
SuperscriptBox["r2", "2"]}], ")"}], " ",
RowBox[{"(",
RowBox[{"x1", "-", "x2"}], ")"}]}]],
RowBox[{"(",
RowBox[{
RowBox[{"-",
SuperscriptBox["r1", "4"]}], "+",
RowBox[{"2", " ",
SuperscriptBox["r1", "2"], " ",
SuperscriptBox["r2", "2"]}], "-",
SuperscriptBox["r2", "4"], "+",
RowBox[{"4", " ",
SuperscriptBox["r1", "2"], " ", "x1", " ", "x2"}], "-",
RowBox[{"4", " ",
SuperscriptBox["r2", "2"], " ", "x1", " ", "x2"}], "-",
RowBox[{"4", " ",
SuperscriptBox["r1", "2"], " ",
SuperscriptBox["x2", "2"]}], "+",
RowBox[{"4", " ",
SuperscriptBox["r2", "2"], " ",
SuperscriptBox["x2", "2"]}], "+",
RowBox[{"4", " ",
SuperscriptBox["r2", "2"], " ",
SuperscriptBox["y1", "2"]}], "-",
RowBox[{"8", " ",
SuperscriptBox["r2", "2"], " ", "y1", " ", "y2"}], "+",
RowBox[{"4", " ",
SuperscriptBox["r2", "2"], " ",
SuperscriptBox["y2", "2"]}]}], ")"}]}]}], "&&",
RowBox[{"y", "\[Equal]",
RowBox[{
FractionBox["1",
RowBox[{
RowBox[{"(",
RowBox[{
SuperscriptBox["r1", "2"], "-",
SuperscriptBox["r2", "2"]}], ")"}], " ",
RowBox[{"(",
RowBox[{"x1", "-", "x2"}], ")"}]}]],
RowBox[{"(",
RowBox[{
RowBox[{
RowBox[{"-",
SuperscriptBox["r1", "2"]}], " ", "x", " ", "y1"}], "+",
RowBox[{
SuperscriptBox["r2", "2"], " ", "x", " ", "y1"}], "-",
RowBox[{"2", " ",
SuperscriptBox["r2", "2"], " ", "x1", " ", "y1"}], "+",
RowBox[{
SuperscriptBox["r1", "2"], " ", "x2", " ", "y1"}], "+",
RowBox[{
SuperscriptBox["r2", "2"], " ", "x2", " ", "y1"}], "+",
RowBox[{
SuperscriptBox["r1", "2"], " ", "x", " ", "y2"}], "-",
RowBox[{
SuperscriptBox["r2", "2"], " ", "x", " ", "y2"}], "+",
RowBox[{
SuperscriptBox["r1", "2"], " ", "x1", " ", "y2"}], "+",
RowBox[{
SuperscriptBox["r2", "2"], " ", "x1", " ", "y2"}], "-",
RowBox[{"2", " ",
SuperscriptBox["r1", "2"], " ", "x2", " ", "y2"}]}], ")"}]}]}]}],
")"}], "||",
RowBox[{"(",
RowBox[{
RowBox[{
RowBox[{
SuperscriptBox["x1", "2"], "-",
RowBox[{"2", " ", "x1", " ", "x2"}], "+",
SuperscriptBox["x2", "2"], "+",
SuperscriptBox["y1", "2"], "-",
RowBox[{"2", " ", "y1", " ", "y2"}], "+",
SuperscriptBox["y2", "2"]}], "\[NotEqual]", "0"}], "&&",
RowBox[{"(",
RowBox[{
RowBox[{"x", "\[Equal]",
RowBox[{
RowBox[{"(",
RowBox[{
RowBox[{
RowBox[{"-", "4"}], " ",
SuperscriptBox["r1", "2"], " ", "x1"}], "+",
RowBox[{"4", " ",
SuperscriptBox["r2", "2"], " ", "x1"}], "+",
RowBox[{"4", " ",
SuperscriptBox["x1", "3"]}], "+",
RowBox[{"4", " ",
SuperscriptBox["r1", "2"], " ", "x2"}], "-",
RowBox[{"4", " ",
SuperscriptBox["r2", "2"], " ", "x2"}], "-",
RowBox[{"4", " ",
SuperscriptBox["x1", "2"], " ", "x2"}], "-",
RowBox[{"4", " ", "x1", " ",
SuperscriptBox["x2", "2"]}], "+",
RowBox[{"4", " ",
SuperscriptBox["x2", "3"]}], "+",
RowBox[{"4", " ", "x1", " ",
SuperscriptBox["y1", "2"]}], "+",
RowBox[{"4", " ", "x2", " ",
SuperscriptBox["y1", "2"]}], "-",
RowBox[{"8", " ", "x1", " ", "y1", " ", "y2"}], "-",
RowBox[{"8", " ", "x2", " ", "y1", " ", "y2"}], "+",
RowBox[{"4", " ", "x1", " ",
SuperscriptBox["y2", "2"]}], "+",
RowBox[{"4", " ", "x2", " ",
SuperscriptBox["y2", "2"]}], "-",
RowBox[{"\[Sqrt]",
RowBox[{"(",
RowBox[{
SuperscriptBox[
RowBox[{"(",
RowBox[{
RowBox[{"4", " ",
SuperscriptBox["r1", "2"], " ", "x1"}], "-",
RowBox[{"4", " ",
SuperscriptBox["r2", "2"], " ", "x1"}], "-",
RowBox[{"4", " ",
SuperscriptBox["x1", "3"]}], "-",
RowBox[{"4", " ",
SuperscriptBox["r1", "2"], " ", "x2"}], "+",
RowBox[{"4", " ",
SuperscriptBox["r2", "2"], " ", "x2"}], "+",
RowBox[{"4", " ",
SuperscriptBox["x1", "2"], " ", "x2"}], "+",
RowBox[{"4", " ", "x1", " ",
SuperscriptBox["x2", "2"]}], "-",
RowBox[{"4", " ",
SuperscriptBox["x2", "3"]}], "-",
RowBox[{"4", " ", "x1", " ",
SuperscriptBox["y1", "2"]}], "-",
RowBox[{"4", " ", "x2", " ",
SuperscriptBox["y1", "2"]}], "+",
RowBox[{"8", " ", "x1", " ", "y1", " ", "y2"}], "+",
RowBox[{"8", " ", "x2", " ", "y1", " ", "y2"}], "-",
RowBox[{"4", " ", "x1", " ",
SuperscriptBox["y2", "2"]}], "-",
RowBox[{"4", " ", "x2", " ",
SuperscriptBox["y2", "2"]}]}], ")"}], "2"], "-",
RowBox[{"4", " ",
RowBox[{"(",
RowBox[{
RowBox[{"4", " ",
SuperscriptBox["x1", "2"]}], "-",
RowBox[{"8", " ", "x1", " ", "x2"}], "+",
RowBox[{"4", " ",
SuperscriptBox["x2", "2"]}], "+",
RowBox[{"4", " ",
SuperscriptBox["y1", "2"]}], "-",
RowBox[{"8", " ", "y1", " ", "y2"}], "+",
RowBox[{"4", " ",
SuperscriptBox["y2", "2"]}]}], ")"}], " ",
RowBox[{"(",
RowBox[{
SuperscriptBox["r1", "4"], "-",
RowBox[{"2", " ",
SuperscriptBox["r1", "2"], " ",
SuperscriptBox["r2", "2"]}], "+",
SuperscriptBox["r2", "4"], "-",
RowBox[{"2", " ",
SuperscriptBox["r1", "2"], " ",
SuperscriptBox["x1", "2"]}], "+",
RowBox[{"2", " ",
SuperscriptBox["r2", "2"], " ",
SuperscriptBox["x1", "2"]}], "+",
SuperscriptBox["x1", "4"], "+",
RowBox[{"2", " ",
SuperscriptBox["r1", "2"], " ",
SuperscriptBox["x2", "2"]}], "-",
RowBox[{"2", " ",
SuperscriptBox["r2", "2"], " ",
SuperscriptBox["x2", "2"]}], "-",
RowBox[{"2", " ",
SuperscriptBox["x1", "2"], " ",
SuperscriptBox["x2", "2"]}], "+",
SuperscriptBox["x2", "4"], "-",
RowBox[{"2", " ",
SuperscriptBox["r1", "2"], " ",
SuperscriptBox["y1", "2"]}], "-",
RowBox[{"2", " ",
SuperscriptBox["r2", "2"], " ",
SuperscriptBox["y1", "2"]}], "+",
RowBox[{"2", " ",
SuperscriptBox["x1", "2"], " ",
SuperscriptBox["y1", "2"]}], "+",
RowBox[{"2", " ",
SuperscriptBox["x2", "2"], " ",
SuperscriptBox["y1", "2"]}], "+",
SuperscriptBox["y1", "4"], "+",
RowBox[{"4", " ",
SuperscriptBox["r1", "2"], " ", "y1", " ", "y2"}], "+",
RowBox[{"4", " ",
SuperscriptBox["r2", "2"], " ", "y1", " ", "y2"}], "-",
RowBox[{"4", " ",
SuperscriptBox["x1", "2"], " ", "y1", " ", "y2"}], "-",
RowBox[{"4", " ",
SuperscriptBox["x2", "2"], " ", "y1", " ", "y2"}], "-",
RowBox[{"4", " ",
SuperscriptBox["y1", "3"], " ", "y2"}], "-",
RowBox[{"2", " ",
SuperscriptBox["r1", "2"], " ",
SuperscriptBox["y2", "2"]}], "-",
RowBox[{"2", " ",
SuperscriptBox["r2", "2"], " ",
SuperscriptBox["y2", "2"]}], "+",
RowBox[{"2", " ",
SuperscriptBox["x1", "2"], " ",
SuperscriptBox["y2", "2"]}], "+",
RowBox[{"2", " ",
SuperscriptBox["x2", "2"], " ",
SuperscriptBox["y2", "2"]}], "+",
RowBox[{"6", " ",
SuperscriptBox["y1", "2"], " ",
SuperscriptBox["y2", "2"]}], "-",
RowBox[{"4", " ", "y1", " ",
SuperscriptBox["y2", "3"]}], "+",
SuperscriptBox["y2", "4"]}], ")"}]}]}], ")"}]}]}], ")"}], "/",
RowBox[{"(",
RowBox[{"2", " ",
RowBox[{"(",
RowBox[{
RowBox[{"4", " ",
SuperscriptBox["x1", "2"]}], "-",
RowBox[{"8", " ", "x1", " ", "x2"}], "+",
RowBox[{"4", " ",
SuperscriptBox["x2", "2"]}], "+",
RowBox[{"4", " ",
SuperscriptBox["y1", "2"]}], "-",
RowBox[{"8", " ", "y1", " ", "y2"}], "+",
RowBox[{"4", " ",
SuperscriptBox["y2", "2"]}]}], ")"}]}], ")"}]}]}], "||",
RowBox[{"x", "\[Equal]",
RowBox[{
RowBox[{"(",
RowBox[{
RowBox[{
RowBox[{"-", "4"}], " ",
SuperscriptBox["r1", "2"], " ", "x1"}], "+",
RowBox[{"4", " ",
SuperscriptBox["r2", "2"], " ", "x1"}], "+",
RowBox[{"4", " ",
SuperscriptBox["x1", "3"]}], "+",
RowBox[{"4", " ",
SuperscriptBox["r1", "2"], " ", "x2"}], "-",
RowBox[{"4", " ",
SuperscriptBox["r2", "2"], " ", "x2"}], "-",
RowBox[{"4", " ",
SuperscriptBox["x1", "2"], " ", "x2"}], "-",
RowBox[{"4", " ", "x1", " ",
SuperscriptBox["x2", "2"]}], "+",
RowBox[{"4", " ",
SuperscriptBox["x2", "3"]}], "+",
RowBox[{"4", " ", "x1", " ",
SuperscriptBox["y1", "2"]}], "+",
RowBox[{"4", " ", "x2", " ",
SuperscriptBox["y1", "2"]}], "-",
RowBox[{"8", " ", "x1", " ", "y1", " ", "y2"}], "-",
RowBox[{"8", " ", "x2", " ", "y1", " ", "y2"}], "+",
RowBox[{"4", " ", "x1", " ",
SuperscriptBox["y2", "2"]}], "+",
RowBox[{"4", " ", "x2", " ",
SuperscriptBox["y2", "2"]}], "+",
RowBox[{"\[Sqrt]",
RowBox[{"(",
RowBox[{
SuperscriptBox[
RowBox[{"(",
RowBox[{
RowBox[{"4", " ",
SuperscriptBox["r1", "2"], " ", "x1"}], "-",
RowBox[{"4", " ",
SuperscriptBox["r2", "2"], " ", "x1"}], "-",
RowBox[{"4", " ",
SuperscriptBox["x1", "3"]}], "-",
RowBox[{"4", " ",
SuperscriptBox["r1", "2"], " ", "x2"}], "+",
RowBox[{"4", " ",
SuperscriptBox["r2", "2"], " ", "x2"}], "+",
RowBox[{"4", " ",
SuperscriptBox["x1", "2"], " ", "x2"}], "+",
RowBox[{"4", " ", "x1", " ",
SuperscriptBox["x2", "2"]}], "-",
RowBox[{"4", " ",
SuperscriptBox["x2", "3"]}], "-",
RowBox[{"4", " ", "x1", " ",
SuperscriptBox["y1", "2"]}], "-",
RowBox[{"4", " ", "x2", " ",
SuperscriptBox["y1", "2"]}], "+",
RowBox[{"8", " ", "x1", " ", "y1", " ", "y2"}], "+",
RowBox[{"8", " ", "x2", " ", "y1", " ", "y2"}], "-",
RowBox[{"4", " ", "x1", " ",
SuperscriptBox["y2", "2"]}], "-",
RowBox[{"4", " ", "x2", " ",
SuperscriptBox["y2", "2"]}]}], ")"}], "2"], "-",
RowBox[{"4", " ",
RowBox[{"(",
RowBox[{
RowBox[{"4", " ",
SuperscriptBox["x1", "2"]}], "-",
RowBox[{"8", " ", "x1", " ", "x2"}], "+",
RowBox[{"4", " ",
SuperscriptBox["x2", "2"]}], "+",
RowBox[{"4", " ",
SuperscriptBox["y1", "2"]}], "-",
RowBox[{"8", " ", "y1", " ", "y2"}], "+",
RowBox[{"4", " ",
SuperscriptBox["y2", "2"]}]}], ")"}], " ",
RowBox[{"(",
RowBox[{
SuperscriptBox["r1", "4"], "-",
RowBox[{"2", " ",
SuperscriptBox["r1", "2"], " ",
SuperscriptBox["r2", "2"]}], "+",
SuperscriptBox["r2", "4"], "-",
RowBox[{"2", " ",
SuperscriptBox["r1", "2"], " ",
SuperscriptBox["x1", "2"]}], "+",
RowBox[{"2", " ",
SuperscriptBox["r2", "2"], " ",
SuperscriptBox["x1", "2"]}], "+",
SuperscriptBox["x1", "4"], "+",
RowBox[{"2", " ",
SuperscriptBox["r1", "2"], " ",
SuperscriptBox["x2", "2"]}], "-",
RowBox[{"2", " ",
SuperscriptBox["r2", "2"], " ",
SuperscriptBox["x2", "2"]}], "-",
RowBox[{"2", " ",
SuperscriptBox["x1", "2"], " ",
SuperscriptBox["x2", "2"]}], "+",
SuperscriptBox["x2", "4"], "-",
RowBox[{"2", " ",
SuperscriptBox["r1", "2"], " ",
SuperscriptBox["y1", "2"]}], "-",
RowBox[{"2", " ",
SuperscriptBox["r2", "2"], " ",
SuperscriptBox["y1", "2"]}], "+",
RowBox[{"2", " ",
SuperscriptBox["x1", "2"], " ",
SuperscriptBox["y1", "2"]}], "+",
RowBox[{"2", " ",
SuperscriptBox["x2", "2"], " ",
SuperscriptBox["y1", "2"]}], "+",
SuperscriptBox["y1", "4"], "+",
RowBox[{"4", " ",
SuperscriptBox["r1", "2"], " ", "y1", " ", "y2"}], "+",
RowBox[{"4", " ",
SuperscriptBox["r2", "2"], " ", "y1", " ", "y2"}], "-",
RowBox[{"4", " ",
SuperscriptBox["x1", "2"], " ", "y1", " ", "y2"}], "-",
RowBox[{"4", " ",
SuperscriptBox["x2", "2"], " ", "y1", " ", "y2"}], "-",
RowBox[{"4", " ",
SuperscriptBox["y1", "3"], " ", "y2"}], "-",
RowBox[{"2", " ",
SuperscriptBox["r1", "2"], " ",
SuperscriptBox["y2", "2"]}], "-",
RowBox[{"2", " ",
SuperscriptBox["r2", "2"], " ",
SuperscriptBox["y2", "2"]}], "+",
RowBox[{"2", " ",
SuperscriptBox["x1", "2"], " ",
SuperscriptBox["y2", "2"]}], "+",
RowBox[{"2", " ",
SuperscriptBox["x2", "2"], " ",
SuperscriptBox["y2", "2"]}], "+",
RowBox[{"6", " ",
SuperscriptBox["y1", "2"], " ",
SuperscriptBox["y2", "2"]}], "-",
RowBox[{"4", " ", "y1", " ",
SuperscriptBox["y2", "3"]}], "+",
SuperscriptBox["y2", "4"]}], ")"}]}]}], ")"}]}]}], ")"}], "/",
RowBox[{"(",
RowBox[{"2", " ",
RowBox[{"(",
RowBox[{
RowBox[{"4", " ",
SuperscriptBox["x1", "2"]}], "-",
RowBox[{"8", " ", "x1", " ", "x2"}], "+",
RowBox[{"4", " ",
SuperscriptBox["x2", "2"]}], "+",
RowBox[{"4", " ",
SuperscriptBox["y1", "2"]}], "-",
RowBox[{"8", " ", "y1", " ", "y2"}], "+",
RowBox[{"4", " ",
SuperscriptBox["y2", "2"]}]}], ")"}]}], ")"}]}]}]}], ")"}], "&&",
RowBox[{
RowBox[{"y1", "-", "y2"}], "\[NotEqual]", "0"}], "&&",
RowBox[{"y", "\[Equal]",
FractionBox[
RowBox[{
RowBox[{"-",
SuperscriptBox["r1", "2"]}], "+",
SuperscriptBox["r2", "2"], "-",
RowBox[{"2", " ", "x", " ", "x1"}], "+",
SuperscriptBox["x1", "2"], "+",
RowBox[{"2", " ", "x", " ", "x2"}], "-",
SuperscriptBox["x2", "2"], "+",
SuperscriptBox["y1", "2"], "-",
SuperscriptBox["y2", "2"]}],
RowBox[{"2", " ",
RowBox[{"(",
RowBox[{"y1", "-", "y2"}], ")"}]}]]}]}], ")"}], "||",
RowBox[{"(",
RowBox[{
RowBox[{"(",
RowBox[{
RowBox[{"x1", "\[Equal]",
RowBox[{"x2", "-",
SqrtBox[
RowBox[{
RowBox[{"-",
SuperscriptBox["y1", "2"]}], "+",
RowBox[{"2", " ", "y1", " ", "y2"}], "-",
SuperscriptBox["y2", "2"]}]]}]}], "||",
RowBox[{"x1", "\[Equal]",
RowBox[{"x2", "+",
SqrtBox[
RowBox[{
RowBox[{"-",
SuperscriptBox["y1", "2"]}], "+",
RowBox[{"2", " ", "y1", " ", "y2"}], "-",
SuperscriptBox["y2", "2"]}]]}]}]}], ")"}], "&&",
RowBox[{"r2", "\[Equal]", "0"}], "&&",
RowBox[{"r1", "\[Equal]", "0"}], "&&",
RowBox[{"x", "\[Equal]", "x2"}], "&&",
RowBox[{"y", "\[Equal]", "y2"}], "&&",
RowBox[{
RowBox[{"x1", "-", "x2"}], "\[NotEqual]", "0"}]}], ")"}], "||",
RowBox[{"(",
RowBox[{
RowBox[{"(",
RowBox[{
RowBox[{"x1", "\[Equal]",
RowBox[{"x2", "-",
SqrtBox[
RowBox[{
RowBox[{"-",
SuperscriptBox["y1", "2"]}], "+",
RowBox[{"2", " ", "y1", " ", "y2"}], "-",
SuperscriptBox["y2", "2"]}]]}]}], "||",
RowBox[{"x1", "\[Equal]",
RowBox[{"x2", "+",
SqrtBox[
RowBox[{
RowBox[{"-",
SuperscriptBox["y1", "2"]}], "+",
RowBox[{"2", " ", "y1", " ", "y2"}], "-",
SuperscriptBox["y2", "2"]}]]}]}]}], ")"}], "&&",
RowBox[{
RowBox[{
RowBox[{"(",
RowBox[{"x1", "-", "x2"}], ")"}], " ",
RowBox[{"(",
RowBox[{"y1", "-", "y2"}], ")"}]}], "\[NotEqual]", "0"}], "&&",
RowBox[{"r2", "\[Equal]", "0"}], "&&",
RowBox[{"r1", "\[Equal]", "0"}], "&&",
RowBox[{
RowBox[{
SuperscriptBox["r1", "2"], "+",
RowBox[{"2", " ", "x", " ", "x1"}], "-",
RowBox[{"2", " ", "x", " ", "x2"}], "-",
RowBox[{"2", " ", "x1", " ", "x2"}], "+",
RowBox[{"2", " ",
SuperscriptBox["x2", "2"]}]}], "\[NotEqual]", "0"}], "&&",
RowBox[{"y", "\[Equal]",
FractionBox[
RowBox[{
RowBox[{"2", " ",
SuperscriptBox["x", "2"], " ", "y1"}], "-",
RowBox[{"4", " ", "x", " ", "x2", " ", "y1"}], "+",
RowBox[{"2", " ",
SuperscriptBox["x2", "2"], " ", "y1"}], "+",
RowBox[{
SuperscriptBox["r1", "2"], " ", "y2"}], "-",
RowBox[{"2", " ",
SuperscriptBox["x", "2"], " ", "y2"}], "+",
RowBox[{"2", " ", "x", " ", "x1", " ", "y2"}], "+",
RowBox[{"2", " ", "x", " ", "x2", " ", "y2"}], "-",
RowBox[{"2", " ", "x1", " ", "x2", " ", "y2"}]}],
RowBox[{
SuperscriptBox["r1", "2"], "+",
RowBox[{"2", " ", "x", " ", "x1"}], "-",
RowBox[{"2", " ", "x", " ", "x2"}], "-",
RowBox[{"2", " ", "x1", " ", "x2"}], "+",
RowBox[{"2", " ",
SuperscriptBox["x2", "2"]}]}]]}]}], ")"}]}]], "Output",
CellChangeTimes->{3.809933173888938*^9},
CellLabel->
"Out[110]=",ExpressionUUID->"b4d87ef5-c14a-4892-b0a3-0428765a9d61"]
}, Closed]]
}, Open ]]
},
WindowSize->{1778, 1031},
WindowMargins->{{4, Automatic}, {0, Automatic}},
Magnification:>1.5 Inherited,
FrontEndVersion->"12.1 for Mac OS X x86 (64-bit) (March 18, 2020)",
StyleDefinitions->"Default.nb",
ExpressionUUID->"39ba56ef-d8b2-41c9-90d6-547ff92a81c3"
]
(* End of Notebook Content *)
(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{}
*)
(*CellTagsIndex
CellTagsIndex->{}
*)
(*NotebookFileOutline
Notebook[{
Cell[CellGroupData[{
Cell[580, 22, 164, 3, 219, "Title",ExpressionUUID->"d0ee6d14-7f3f-4d5b-9c0b-20976882697d"],
Cell[747, 27, 375, 8, 114, "Input",ExpressionUUID->"175a20ad-2ae5-49df-8af8-28c63628f390"],
Cell[1125, 37, 5490, 147, 1310, "Input",ExpressionUUID->"58bdd9ad-b7dc-4360-b65d-031d00810b1e"],
Cell[6618, 186, 1520, 41, 185, "Input",ExpressionUUID->"c8612a4b-1454-4d16-9c93-86ad62c4093e"],
Cell[8141, 229, 560, 14, 139, "Input",ExpressionUUID->"68470958-aef8-4568-bdca-11274cc65b1c"],
Cell[8704, 245, 4653, 134, 615, "Input",ExpressionUUID->"641df187-11fe-4471-b5f4-c4525434fef2"],
Cell[13360, 381, 4408, 126, 967, "Input",ExpressionUUID->"96d5ee16-b21c-4c3b-ab68-92bcbd9907f3"],
Cell[17771, 509, 2090, 57, 369, "Input",ExpressionUUID->"89b1bc03-7381-4a7d-8a06-01add0d5b780"],
Cell[19864, 568, 1485, 24, 185, "Input",ExpressionUUID->"eaee2c80-2e33-441d-9ba3-f97d473b60f4"],
Cell[CellGroupData[{
Cell[21374, 596, 176, 2, 92, "Input",ExpressionUUID->"2cbe8269-6d84-4883-9df3-55cf6f5c392e"],
Cell[21553, 600, 745, 23, 105, "Output",ExpressionUUID->"183b1c38-adfc-4bd0-8dd5-eaf8a2b2884d"]
}, Open ]],
Cell[CellGroupData[{
Cell[22335, 628, 523, 10, 92, "Input",ExpressionUUID->"2c7bcc2b-04ff-47b2-b10e-0ca10685dabc"],
Cell[22861, 640, 2733, 63, 613, "Output",ExpressionUUID->"6bc01c3a-be1e-42f0-9e8b-9fad7955acd8"]
}, Open ]],
Cell[CellGroupData[{
Cell[25631, 708, 851, 27, 96, "Input",ExpressionUUID->"37726551-294a-4c29-ae5b-d372989890fc"],
Cell[26485, 737, 23280, 588, 2512, "Output",ExpressionUUID->"b4d87ef5-c14a-4892-b0a3-0428765a9d61"]
}, Closed]]
}, Open ]]
}
]
*)
(* Content-type: application/vnd.wolfram.mathematica *)
(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)
(* CreatedBy='Mathematica 11.2' *)
(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[ 158, 7]
NotebookDataLength[ 39490, 1109]
NotebookOptionsPosition[ 35599, 1042]
NotebookOutlinePosition[ 36023, 1059]
CellTagsIndexPosition[ 35980, 1056]
WindowFrame->Normal*)
(* Beginning of Notebook Content *)
Notebook[{
Cell[CellGroupData[{
Cell["Konstruktibilne to\[CHacek]ke", "Title",
CellChangeTimes->{{3.779040438376588*^9, 3.779040442050851*^9}, {
3.8100108798929033`*^9,
3.810010897583909*^9}},ExpressionUUID->"d0ee6d14-7f3f-4d5b-9c0b-\
20976882697d"],
Cell["Andrej Bauer", "Author",
CellChangeTimes->{{3.810010901577932*^9,
3.8100109457914543`*^9}},ExpressionUUID->"2a7b5a77-fc04-4901-b8b8-\
2227c98ee5d7"],
Cell["Fakulteta za matematiko in fiziko", "Affiliation",
CellChangeTimes->{{3.8100109477106943`*^9,
3.810010955882674*^9}},ExpressionUUID->"e51f1c36-163d-4312-a153-\
83f1ca123488"],
Cell[CellGroupData[{
Cell["Koda", "Section",
CellChangeTimes->{{3.8100109920519457`*^9,
3.8100110077905283`*^9}},ExpressionUUID->"7dfa920f-e69e-4b4f-a438-\
009d85dfd51f"],
Cell["\<\
V tem razdelku je podporna koda za na\[CHacek]rtovanje konstruktibilnih to\
\[CHacek]k. Uporabimo naslednjo predsavitev podatkov:\
\>", "Text",
CellChangeTimes->{{3.810011010164069*^9,
3.81001104208073*^9}},ExpressionUUID->"d1b9606d-b91c-4ae1-8b12-\
3fddbe686929"],
Cell[CellGroupData[{
Cell[TextData[{
"To\[CHacek]ka je predstavljena s parom koordinat ",
Cell[BoxData[
FormBox[
RowBox[{"{",
RowBox[{"x", ",", "y"}], "}"}], TraditionalForm]],
FormatType->"TraditionalForm",ExpressionUUID->
"725ce453-1b40-404b-86cd-715aa9d05005"]
}], "Item",
CellChangeTimes->{{3.810011051384676*^9,
3.810011076385313*^9}},ExpressionUUID->"0982e539-fd96-48a4-ba81-\
efaef60f4bd4"],
Cell[TextData[{
"Premica ",
Cell[BoxData[
FormBox[
RowBox[{
RowBox[{
RowBox[{"a", " ", "x"}], " ", "+", " ",
RowBox[{"b", " ", "y"}]}], " ", "=", " ", "c"}], TraditionalForm]],
FormatType->"TraditionalForm",ExpressionUUID->
"3f89402a-de3d-4710-bf62-c55679872074"],
" je predstavljena z izrazom ",
Cell[BoxData[
FormBox[
RowBox[{"line", "[",
RowBox[{"a", ",", "b", ",", "c"}], "]"}], TraditionalForm]],
FormatType->"TraditionalForm",ExpressionUUID->
"85685fd9-89ad-42a0-b293-f4701838b03c"],
"."
}], "Item",
CellChangeTimes->{{3.810011051384676*^9,
3.810011092596599*^9}},ExpressionUUID->"0b556cc4-87b3-4824-8a26-\
340ca3add643"],
Cell[TextData[{
"Kro\[ZHacek]nica s sredi\[SHacek]\[CHacek]em ",
Cell[BoxData[
FormBox[
RowBox[{"(",
RowBox[{"x", ",", "y"}], ")"}], TraditionalForm]],
FormatType->"TraditionalForm",ExpressionUUID->
"fc0c739e-0230-4d65-9796-11b34ee07e33"],
" in polmerom ",
Cell[BoxData[
FormBox["r", TraditionalForm]],
FormatType->"TraditionalForm",ExpressionUUID->
"9ee52214-ea11-46d3-acc0-0fe749c5b113"],
" je predstavaljena z izrazom ",
Cell[BoxData[
FormBox[
RowBox[{"circle", "[",
RowBox[{
RowBox[{"{",
RowBox[{"x", ",", "y"}], "}"}], ",", "r"}], "]"}], TraditionalForm]],
FormatType->"TraditionalForm",ExpressionUUID->
"95e8b5ed-6acc-4df4-8139-89133d83b26d"],
"."
}], "Item",
CellChangeTimes->{{3.810011051384676*^9,
3.810011131834426*^9}},ExpressionUUID->"d61901d7-ecd0-4fcc-94ce-\
4460d1f230a7"]
}, Open ]],
Cell["Najprej definiramo naslednje pomo\[ZHacek]ne funkcije:", "Text",
CellChangeTimes->{{3.810011167958819*^9,
3.810011179703553*^9}},ExpressionUUID->"83379133-4245-4c3a-bb09-\
67b218c00488"],
Cell[CellGroupData[{
Cell[TextData[{
Cell[BoxData[
FormBox[
RowBox[{"dist", "[",
RowBox[{"p", ",", "q"}], "]"}], TraditionalForm]],
FormatType->"TraditionalForm",ExpressionUUID->
"7691f837-58da-4a5b-b34c-5a954e38c29f"],
" izra\[CHacek]una razdaljo med to\[CHacek]kama ",
Cell[BoxData[
FormBox["p", TraditionalForm]],
FormatType->"TraditionalForm",ExpressionUUID->
"3974e977-8d41-4391-b68a-763c5c2b88df"],
" in ",
Cell[BoxData[
FormBox["q", TraditionalForm]],
FormatType->"TraditionalForm",ExpressionUUID->
"eb799b48-311f-4f70-b1ad-b03c7b87e5c9"]
}], "Item",
CellChangeTimes->{{3.810011188946954*^9,
3.8100112019704113`*^9}},ExpressionUUID->"f3b08105-b9cc-43cf-826f-\
1417d3c4cf74"],
Cell[TextData[{
Cell[BoxData[
FormBox[
RowBox[{"equalTo", "[",
RowBox[{"u", ",", "v"}], "]"}], TraditionalForm]],
FormatType->"TraditionalForm",ExpressionUUID->
"74218350-664f-4758-868c-6e1bc3e50e20"],
" ugotovi, ali je geometrijski objekt ",
Cell[BoxData[
FormBox["u", TraditionalForm]],
FormatType->"TraditionalForm",ExpressionUUID->
"d9ee9d2d-ed1d-413e-b1ec-2b66ad8e3e89"],
" enak objektu ",
Cell[BoxData[
FormBox["v", TraditionalForm]],
FormatType->"TraditionalForm",ExpressionUUID->
"084f0dc4-8764-4c04-b974-eaff29f674f4"]
}], "Item",
CellChangeTimes->{{3.810011188946954*^9,
3.810011239231099*^9}},ExpressionUUID->"0e57e41b-c7b4-45db-a5b8-\
7266b7564d25"],
Cell[TextData[{
Cell[BoxData[
FormBox[
RowBox[{"elemShape", "[",
RowBox[{"u", ",", " ", "l"}], "]"}], TraditionalForm]],
FormatType->"TraditionalForm",ExpressionUUID->
"57be9d72-86f2-4d43-af5f-62e731db0981"],
" ugotovi, ali se geometrijski objekt pojavi v seznamu objektov ",
Cell[BoxData[
FormBox["l", TraditionalForm]],
FormatType->"TraditionalForm",ExpressionUUID->
"ae3888c4-9639-4c88-aa1e-6b7ed8cbd750"]
}], "Item",
CellChangeTimes->{{3.810011188946954*^9, 3.810011273677121*^9}, {
3.810011317170603*^9,
3.810011317170891*^9}},ExpressionUUID->"9854e4b6-6f67-4fe2-b9eb-\
3a487936ce15"],
Cell[TextData[{
Cell[BoxData[
FormBox[
RowBox[{"elemPoint", "[",
RowBox[{"p", ",", "l"}], "]"}], TraditionalForm]],
FormatType->"TraditionalForm",ExpressionUUID->
"9643a6df-76ff-461b-af08-0c7d1e6d1e72"],
" ugotovi, ali se to\[CHacek]ka ",
Cell[BoxData[
FormBox["p", TraditionalForm]],
FormatType->"TraditionalForm",ExpressionUUID->
"cd33835d-cca7-4175-8695-31803c67278d"],
" pojavi v seznamu to\[CHacek]k ",
Cell[BoxData[
FormBox["l", TraditionalForm]],
FormatType->"TraditionalForm",ExpressionUUID->
"7f3e81a5-60e1-4b8f-a27b-c63da148da70"]
}], "Item",
CellChangeTimes->{{3.810011188946954*^9, 3.810011273677121*^9}, {
3.810011317551585*^9,
3.810011338196541*^9}},ExpressionUUID->"afdeeec8-4da6-4d94-a531-\
b3007e9f0edb"]
}, Open ]],
Cell[BoxData[{
RowBox[{"ClearAll", "[",
RowBox[{
"dist", ",", "equalTo", ",", "elemShape", ",", "elemPoint", ",",
"elemShape"}], "]"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"dist", "[",
RowBox[{"p_", ",", "q_"}], "]"}], ":=",
RowBox[{"Norm", "[",
RowBox[{"p", "-", "q"}], "]"}]}],
"\[IndentingNewLine]"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"equalTo", "[",
RowBox[{
RowBox[{"line", "[",
RowBox[{"a1_", ",", "b1_", ",", "c1_"}], "]"}], ",",
RowBox[{"line", "[",
RowBox[{"a2_", ",", "b2_", ",", "c2_"}], "]"}]}], "]"}], ":=",
"\[IndentingNewLine]",
RowBox[{"Reduce", "[",
RowBox[{
RowBox[{
RowBox[{
RowBox[{"a1", "*", "b2"}], "-",
RowBox[{"a2", "*", "b1"}]}], "\[Equal]", "0"}], "\[And]",
RowBox[{
RowBox[{"c1", "*", "a2"}], "\[Equal]",
RowBox[{"c2", "*", "a1"}]}], "\[And]",
RowBox[{
RowBox[{"c1", "*", "b2"}], "\[Equal]",
RowBox[{"c2", "*", "b1"}]}]}], "]"}]}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"equalTo", "[",
RowBox[{"l_line", ",", "c_circle"}], "]"}], ":=",
"False"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"equalTo", "[",
RowBox[{
RowBox[{"circle", "[",
RowBox[{
RowBox[{"{",
RowBox[{"x1_", ",", "y1_"}], "}"}], ",", "r1_"}], "]"}], ",",
RowBox[{"circle", "[",
RowBox[{
RowBox[{"{",
RowBox[{"x2_", ",", "y2_"}], "}"}], ",", "r2_"}], "]"}]}], "]"}], ":=",
"\[IndentingNewLine]",
RowBox[{"Reduce", "[",
RowBox[{
RowBox[{"x1", "\[Equal]", "x2"}], "\[And]",
RowBox[{"y1", "\[Equal]", "y2"}], "\[And]",
RowBox[{"r1", "\[Equal]", "r2"}]}], "]"}]}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"equalTo", "[",
RowBox[{"c_circle", ",", "l_line"}], "]"}], ":=", "False"}],
"\[IndentingNewLine]"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"elemShape", "::", "boole"}], "=",
"\"\<The value `1` is not True or False.\>\""}],
";"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"elemShape", "[",
RowBox[{"s_", ",",
RowBox[{"{", "}"}]}], "]"}], ":=", "False"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"elemShape", "[",
RowBox[{"s_", ",",
RowBox[{"{",
RowBox[{"t_", ",", "ts___"}], "}"}]}], "]"}], ":=",
RowBox[{"With", "[",
RowBox[{
RowBox[{"{",
RowBox[{"b", "=",
RowBox[{"equalTo", "[",
RowBox[{"s", ",", "t"}], "]"}]}], "}"}], ",", "\[IndentingNewLine]",
RowBox[{"Switch", "[",
RowBox[{
"b", ",", "\[IndentingNewLine]", "True", ",", "True", ",",
"\[IndentingNewLine]", "False", ",",
RowBox[{"elemShape", "[",
RowBox[{"s", ",",
RowBox[{"{", "ts", "}"}]}], "]"}], ",", "\[IndentingNewLine]", "_",
",",
RowBox[{"(",
RowBox[{
RowBox[{"Message", "[",
RowBox[{
RowBox[{"elemShape", "::", "boole"}], ",", "b"}], "]"}], ";",
RowBox[{"Abort", "[", "]"}]}], ")"}]}], "\[IndentingNewLine]",
"]"}]}], "\[IndentingNewLine]", "]"}]}],
"\[IndentingNewLine]"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"elemPoint", "::", "boole"}], "=",
"\"\<The value `1` is not True or False.\>\""}],
";"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"elemPoint", "[",
RowBox[{"p_", ",",
RowBox[{"{", "}"}]}], "]"}], ":=", "False"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"elemPoint", "[",
RowBox[{"p_", ",",
RowBox[{"{",
RowBox[{"q_", ",", "qs___"}], "}"}]}], "]"}], ":=",
RowBox[{"With", "[",
RowBox[{
RowBox[{"{",
RowBox[{"b", "=",
RowBox[{
RowBox[{"(",
RowBox[{"p", "===", "q"}], ")"}], "\[Or]",
RowBox[{"Reduce", "[",
RowBox[{
RowBox[{
RowBox[{"p", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}],
"\[Equal]",
RowBox[{
"q", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], "&&",
RowBox[{
RowBox[{"p", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}],
"\[Equal]",
RowBox[{
"q", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}]}]}],
"]"}]}]}], "}"}], ",", "\[IndentingNewLine]",
RowBox[{"Switch", "[",
RowBox[{"b", ",", "\[IndentingNewLine]", "True", ",",
RowBox[{"(",
RowBox[{
RowBox[{"If", "[",
RowBox[{
RowBox[{
RowBox[{"Abs", "[",
RowBox[{
RowBox[{"size", "[", "p", "]"}], "-",
RowBox[{"size", "[", "q", "]"}]}], "]"}], ">", "1"}], ",",
RowBox[{"Print", "[",
RowBox[{"p", "\[Equal]", "q"}], "]"}]}], "]"}], ";", "True"}],
")"}], ",", "\[IndentingNewLine]", "False", ",",
RowBox[{"elemPoint", "[",
RowBox[{"p", ",",
RowBox[{"{", "qs", "}"}]}], "]"}], ",", "\[IndentingNewLine]", "_",
",",
RowBox[{"(",
RowBox[{
RowBox[{"Message", "[",
RowBox[{
RowBox[{"elemPoint", "::", "boole"}], ",", "b"}], "]"}], ";",
RowBox[{"Abort", "[", "]"}]}], ")"}]}], "\[IndentingNewLine]",
"]"}]}], "\[IndentingNewLine]", "]"}]}]}], "Input",
CellChangeTimes->{{3.779075228054405*^9, 3.7790752714989433`*^9}, {
3.77907538951341*^9, 3.7790754357301083`*^9}, {3.77907549355214*^9,
3.7790755005998173`*^9}, {3.77907585385707*^9, 3.779075873395331*^9}, {
3.779075917811008*^9, 3.779075924699594*^9}, {3.77907613858146*^9,
3.7790761915605307`*^9}, {3.779076361291265*^9, 3.779076416613443*^9}, {
3.77907700403061*^9, 3.7790771764968357`*^9}, {3.7790772190315*^9,
3.7790772312178593`*^9}, {3.7790772720128717`*^9, 3.77907731392869*^9}, {
3.7790774232111397`*^9, 3.7790774346398*^9}, {3.779077725747649*^9,
3.779077775946443*^9}, {3.779077808646714*^9, 3.779077848357255*^9}, {
3.779077976855464*^9, 3.779078004670417*^9}, {3.779078037210372*^9,
3.779078046888691*^9}, {3.779079052970264*^9, 3.779079239320182*^9}, {
3.779079777089425*^9, 3.779079783080798*^9}, {3.8100112811037073`*^9,
3.810011297134119*^9}, 3.810011350008862*^9, {3.810011775086047*^9,
3.81001181436937*^9}, {3.81001186857335*^9, 3.810011957932578*^9}, {
3.810011995182428*^9, 3.8100119955189037`*^9}, {3.810012044941864*^9,
3.810012059599791*^9}, {3.810012090133705*^9, 3.8100120957577457`*^9}, {
3.810012126696761*^9, 3.810012127068843*^9}},
CellLabel->
"In[238]:=",ExpressionUUID->"58bdd9ad-b7dc-4360-b65d-031d00810b1e"],
Cell["\<\
Nadalje imamo funkciji, ki konstruirata kro\[ZHacek]nici skozi dani to\
\[CHacek]ki ter premico skozi dani to\[CHacek]ki.\
\>", "Text",
CellChangeTimes->{{3.810011360943681*^9,
3.8100113959087677`*^9}},ExpressionUUID->"511aa655-dc46-401a-bbd1-\
2d5c1a73430f"],
Cell[BoxData[{
RowBox[{"ClearAll", "[",
RowBox[{"circle", ",", "circles", ",", "line", ",", "lines"}],
"]"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"circles", "[",
RowBox[{"p_", ",", "q_"}], "]"}], ":=",
RowBox[{"With", "[",
RowBox[{
RowBox[{"{",
RowBox[{"r", "=",
RowBox[{"FullSimplify", "@",
RowBox[{"dist", "[",
RowBox[{"p", ",", "q"}], "]"}]}]}], "}"}], ",",
RowBox[{"{",
RowBox[{
RowBox[{"circle", "[",
RowBox[{"p", ",", "r"}], "]"}], ",",
RowBox[{"circle", "[",
RowBox[{"q", ",", "r"}], "]"}]}], "}"}]}],
"]"}]}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"lines", "[",
RowBox[{
RowBox[{"{",
RowBox[{"px_", ",", "py_"}], "}"}], ",",
RowBox[{"{",
RowBox[{"qx_", ",", "qy_"}], "}"}]}], "]"}], ":=",
RowBox[{"{",
RowBox[{"line", "[",
RowBox[{
RowBox[{"qy", "-", "py"}], ",",
RowBox[{"px", "-", "qx"}], ",",
RowBox[{
RowBox[{"px", "*", "qy"}], "-",
RowBox[{"py", "*", "qx"}]}]}], "]"}], "}"}]}]}], "Input",
CellChangeTimes->{{3.779044221209824*^9, 3.7790442749821577`*^9}, {
3.779044356191331*^9, 3.7790444175210333`*^9}, {3.7790444725653954`*^9,
3.7790445156856737`*^9}, {3.779077645248541*^9, 3.779077656914371*^9}, {
3.779078141285185*^9, 3.779078143682063*^9}, {3.779078834839727*^9,
3.779078838335267*^9}, {3.7790795166875*^9, 3.7790795172996387`*^9}},
CellLabel->
"In[180]:=",ExpressionUUID->"c8612a4b-1454-4d16-9c93-86ad62c4093e"],
Cell[TextData[{
"Funkcija ",
Cell[BoxData[
FormBox[
RowBox[{"intersect", "[",
RowBox[{"u", ",", "v"}], "]"}], TraditionalForm]],
FormatType->"TraditionalForm",ExpressionUUID->
"74b984f3-f106-46a9-a939-5245374867a5"],
" izra\[CHacek]una prese\[CHacek]i\[SHacek]\[CHacek]a geometrijskih \
objektov ",
Cell[BoxData[
FormBox["u", TraditionalForm]],
FormatType->"TraditionalForm",ExpressionUUID->
"d06804bc-5a03-4971-9e84-6b4704f5f2d2"],
" in ",
Cell[BoxData[
FormBox["v", TraditionalForm]],
FormatType->"TraditionalForm",ExpressionUUID->
"2129d853-ed24-4107-9a72-749214d8677a"],
"."
}], "Text",
CellChangeTimes->{{3.810011431572085*^9,
3.810011457750819*^9}},ExpressionUUID->"b0861c87-ab3d-42ef-974d-\
773396935a3b"],
Cell[BoxData[{
RowBox[{
RowBox[{"ClearAll", "[",
RowBox[{"pointsOf", ",", " ", "intersect"}], "]"}],
"\[IndentingNewLine]"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"pointsOf", "[", "solutions_", "]"}], ":=",
RowBox[{"Union", "[",
RowBox[{
RowBox[{
RowBox[{"(",
RowBox[{
RowBox[{"{",
RowBox[{"x", ",", "y"}], "}"}], "/.", "#"}], ")"}], "&"}], "/@",
"solutions"}], "]"}]}], "\[IndentingNewLine]"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"intersect", "[",
RowBox[{
RowBox[{"circle", "[",
RowBox[{
RowBox[{"{",
RowBox[{"x1_", ",", "y1_"}], "}"}], ",", "r1_"}], "]"}], ",",
RowBox[{"circle", "[",
RowBox[{
RowBox[{"{",
RowBox[{"x2_", ",", "y2_"}], "}"}], ",", "r2_"}], "]"}]}], "]"}], ":=",
RowBox[{"pointsOf", "@",
RowBox[{"Solve", "[",
RowBox[{
RowBox[{"{",
RowBox[{
RowBox[{
RowBox[{
SuperscriptBox[
RowBox[{"(",
RowBox[{"x", "-", "x1"}], ")"}], "2"], "+",
SuperscriptBox[
RowBox[{"(",
RowBox[{"y", "-", "y1"}], ")"}], "2"]}], "\[Equal]",
SuperscriptBox["r1", "2"]}], ",",
RowBox[{
RowBox[{
SuperscriptBox[
RowBox[{"(",
RowBox[{"x", "-", "x2"}], ")"}], "2"], "+",
SuperscriptBox[
RowBox[{"(",
RowBox[{"y", "-", "y2"}], ")"}], "2"]}], "\[Equal]",
SuperscriptBox["r2", "2"]}]}], "}"}], ",",
RowBox[{"{",
RowBox[{"x", ",", "y"}], "}"}], ",", "Reals"}], "]"}]}]}],
"\[IndentingNewLine]"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"intersect", "[",
RowBox[{
RowBox[{"line", "[",
RowBox[{"a1_", ",", "b1_", ",", "c1_"}], "]"}], ",",
RowBox[{"line", "[",
RowBox[{"a2_", ",", "b2_", ",", "c2_"}], "]"}]}], "]"}], ":=",
"\[IndentingNewLine]",
RowBox[{"pointsOf", "@",
RowBox[{"Solve", "[",
RowBox[{
RowBox[{"{",
RowBox[{
RowBox[{
RowBox[{
RowBox[{"a1", "*", "x"}], "+",
RowBox[{"b1", "*", "y"}]}], "\[Equal]", "c1"}], ",",
RowBox[{
RowBox[{
RowBox[{"a2", "*", "x"}], "+",
RowBox[{"b2", "*", "y"}]}], "\[Equal]", "c2"}]}], "}"}], ",",
RowBox[{"{",
RowBox[{"x", ",", "y"}], "}"}]}], "]"}]}]}],
"\[IndentingNewLine]"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"intersect", "[",
RowBox[{
RowBox[{"line", "[",
RowBox[{"a1_", ",", "b1_", ",", "c1_"}], "]"}], ",",
RowBox[{"circle", "[",
RowBox[{
RowBox[{"{",
RowBox[{"x2_", ",", "y2_"}], "}"}], ",", "r2_"}], "]"}]}], "]"}], ":=",
"\[IndentingNewLine]",
RowBox[{"pointsOf", "@",
RowBox[{"Solve", "[",
RowBox[{
RowBox[{"{",
RowBox[{
RowBox[{
RowBox[{
RowBox[{"a1", "*", "x"}], "+",
RowBox[{"b1", "*", "y"}]}], "\[Equal]", "c1"}], ",", " ",
RowBox[{
RowBox[{
SuperscriptBox[
RowBox[{"(",
RowBox[{"x", "-", "x2"}], ")"}], "2"], "+",
SuperscriptBox[
RowBox[{"(",
RowBox[{"y", "-", "y2"}], ")"}], "2"]}], "\[Equal]",
SuperscriptBox["r2", "2"]}]}], "}"}], ",",
RowBox[{"{",
RowBox[{"x", ",", "y"}], "}"}], ",", "Reals"}], "]"}]}]}],
"\[IndentingNewLine]"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"intersect", "[",
RowBox[{
RowBox[{"circle", "[",
RowBox[{
RowBox[{"{",
RowBox[{"x1_", ",", "y1_"}], "}"}], ",", "r1_"}], "]"}], ",", " ",
RowBox[{"line", "[",
RowBox[{"a2_", ",", "b2_", ",", "c2_"}], "]"}]}], "]"}], ":=",
"\[IndentingNewLine]",
RowBox[{"pointsOf", "@",
RowBox[{"Solve", "[",
RowBox[{
RowBox[{"{",
RowBox[{
RowBox[{
RowBox[{
SuperscriptBox[
RowBox[{"(",
RowBox[{"x", "-", "x1"}], ")"}], "2"], "+",
SuperscriptBox[
RowBox[{"(",
RowBox[{"y", "-", "y1"}], ")"}], "2"]}], "\[Equal]",
SuperscriptBox["r1", "2"]}], ",", " ",
RowBox[{
RowBox[{
RowBox[{"a2", "*", "x"}], "+",
RowBox[{"b2", "*", "y"}]}], "\[Equal]", "c2"}]}], "}"}], ",",
RowBox[{"{",
RowBox[{"x", ",", "y"}], "}"}], ",", "Reals"}], "]"}]}]}]}], "Input",
CellChangeTimes->{{3.779040524007328*^9, 3.779040552741211*^9}, {
3.779040714660832*^9, 3.779040757324848*^9}, {3.7790436370641317`*^9,
3.77904367618001*^9}, {3.7790437624133883`*^9, 3.7790438513344593`*^9}, {
3.779043884688589*^9, 3.779043936117599*^9}, {3.779043970434897*^9,
3.7790442184016314`*^9}, {3.7790455356861677`*^9, 3.779045537693041*^9}, {
3.779079618235774*^9, 3.779079636425366*^9}, {3.779079680886754*^9,
3.779079689370858*^9}, {3.7790797460825872`*^9, 3.779079759168322*^9}, {
3.8100114115595703`*^9, 3.810011423236898*^9}},
CellLabel->
"In[183]:=",ExpressionUUID->"641df187-11fe-4471-b5f4-c4525434fef2"],
Cell[TextData[{
"Funkcija ",
Cell[BoxData[
FormBox[
RowBox[{"generate", "[", "n", "]"}], TraditionalForm]],
FormatType->"TraditionalForm",ExpressionUUID->
"b8cbf34e-f3ae-48af-8993-b76a9eb9c776"],
" generira konstruktibilne to\[CHacek]ke reda ",
Cell[BoxData[
FormBox["n", TraditionalForm]],
FormatType->"TraditionalForm",ExpressionUUID->
"e4492f9c-31d2-44c4-bbd9-70fc1f156b9d"],
"."
}], "Text",
CellChangeTimes->{{3.810011467920691*^9,
3.810011522585058*^9}},ExpressionUUID->"1a0ea55a-4b3b-4e1c-8961-\
48cfeb1564ff"],
Cell[BoxData[{
RowBox[{"ClearAll", "[",
RowBox[{
"addShape", ",", "addPoint", ",", "uniqueShapes", ",", "uniquePoints", ",",
"generateShapes", ",", " ", "generatePoints", ",", "generate"}],
"]"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"addShape", "[",
RowBox[{"shapes_List", ",", "s_"}], "]"}], ":=",
RowBox[{"If", "[",
RowBox[{
RowBox[{"elemShape", "[",
RowBox[{"s", ",", "shapes"}], "]"}], ",", "shapes", ",",
RowBox[{"Append", "[",
RowBox[{"shapes", ",", "s"}], "]"}]}], "]"}]}],
"\[IndentingNewLine]"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"uniqueShapes", "[",
RowBox[{"{", "}"}], "]"}], ":=",
RowBox[{"{", "}"}]}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"uniqueShapes", "[",
RowBox[{"{",
RowBox[{"s_", ",", "ss___"}], "}"}], "]"}], ":=",
RowBox[{"addShape", "[",
RowBox[{
RowBox[{"uniqueShapes", "[",
RowBox[{"{", "ss", "}"}], "]"}], ",", "s"}], "]"}]}],
"\[IndentingNewLine]"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"addPoint", "[",
RowBox[{"points_List", ",", "p_"}], "]"}], ":=",
RowBox[{"If", "[",
RowBox[{
RowBox[{"elemPoint", "[",
RowBox[{"p", ",", "points"}], "]"}], ",", "points", ",",
RowBox[{"Append", "[",
RowBox[{"points", ",", "p"}], "]"}]}], "]"}]}],
"\[IndentingNewLine]"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"uniquePoints", "[",
RowBox[{"{", "}"}], "]"}], ":=",
RowBox[{"{", "}"}]}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"uniquePoints", "[",
RowBox[{"{",
RowBox[{"p_", ",", "ps___"}], "}"}], "]"}], ":=",
RowBox[{"addPoint", "[",
RowBox[{
RowBox[{"uniquePoints", "[",
RowBox[{"{", "ps", "}"}], "]"}], ",", "p"}], "]"}]}],
"\[IndentingNewLine]"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"generateShapes", "[", "ps_", "]"}], ":=",
RowBox[{"uniqueShapes", "@",
RowBox[{"Flatten", "[",
RowBox[{
RowBox[{
RowBox[{"Function", "[",
RowBox[{"pq", ",",
RowBox[{"Join", "[",
RowBox[{
RowBox[{"circles", "[",
RowBox[{
RowBox[{
"pq", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}],
",",
RowBox[{
"pq", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}]}],
"]"}], ",",
RowBox[{"lines", "[",
RowBox[{
RowBox[{
"pq", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}],
",",
RowBox[{
"pq", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}]}],
"]"}]}], "]"}]}], "]"}], "/@",
RowBox[{"Subsets", "[",
RowBox[{"ps", ",",
RowBox[{"{", "2", "}"}]}], "]"}]}], ",", "1"}], "]"}]}]}],
"\[IndentingNewLine]"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"generatePoints", "[", "ps_", "]"}], ":=",
RowBox[{"uniquePoints", "@",
RowBox[{"Join", "[",
RowBox[{"ps", ",",
RowBox[{"Flatten", "[",
RowBox[{
RowBox[{
RowBox[{
RowBox[{"(",
RowBox[{"intersect", "@@", "#"}], ")"}], "&"}], "/@",
RowBox[{"Subsets", "[",
RowBox[{
RowBox[{"generateShapes", "[", "ps", "]"}], ",",
RowBox[{"{", "2", "}"}]}], "]"}]}], ",", "1"}], "]"}]}], "]"}]}]}],
"\[IndentingNewLine]"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"generate", "[",
RowBox[{"n_", ",",
RowBox[{"generators_", ":",
RowBox[{"{",
RowBox[{
RowBox[{"{",
RowBox[{
RowBox[{"-", "1"}], ",", "0"}], "}"}], ",",
RowBox[{"{",
RowBox[{"1", ",", "0"}], "}"}]}], "}"}]}]}], "]"}], ":=",
RowBox[{"Nest", "[",
RowBox[{"generatePoints", ",", "generators", ",",
RowBox[{"n", "-", "1"}]}], "]"}]}]}], "Input",
CellChangeTimes->CompressedData["
1:eJwdyU0og3EAx/EnPBmKg7ztoGk142ZZzUHt8VISS8NlkbIXedpb4YyUsouE
eWirUaIwj2wK5cCNWobWGq32kmmtJ4fZKMTvf/j2OXwbxm1aYwFFUeL/oGuJ
dWYbM0w2Yd2A8cCNC+4fKvyQuw+eQ5Nk7hpucach+Czde4GOibIY1IYG45Ay
nAiwNHlJVMplH7DO3f4D6ZqziiJ5hvmtTVRBm0ldD2V2TgKHWVETPC6+a4N8
bLYD7i5Iu2D4YKcHuo2tvVCIKkdgvlBNfA08TUKnN0vkc/pleKt6XIF9X5FN
aE53uuD8+owHDkU12/BBYTiC1V4LMZoU++BiKOiHkcrwO2w2JYhqeioHv2NU
HpanLmga3yMpgWtvSgvUsKN2aB0bcMC0Ob4KhenuFlqfYfp1V8RPEa+CrM5H
/AM7DsLG
"],
CellLabel->
"In[189]:=",ExpressionUUID->"96d5ee16-b21c-4c3b-ab68-92bcbd9907f3"],
Cell[TextData[{
"Funkcija ",
Cell[BoxData[
FormBox["draw", TraditionalForm]],
FormatType->"TraditionalForm",ExpressionUUID->
"32c3b3e4-8d0d-428a-8c44-7cb285af5b6f"],
" nari\[SHacek]e seznam geometrijskih objektov:"
}], "Text",
CellChangeTimes->{{3.8100115372671432`*^9, 3.810011552398116*^9}, {
3.810011592699139*^9,
3.8100115934497633`*^9}},ExpressionUUID->"1b745cd0-fc92-4b65-bfce-\
61f6e270c31b"],
Cell[BoxData[{
RowBox[{"ClearAll", "[",
RowBox[{"toGraphics", ",", " ", "draw"}], "]"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"toGraphics", "[",
RowBox[{"circle", "[",
RowBox[{"p_", ",", "r_"}], "]"}], "]"}], ":=",
RowBox[{"Circle", "[",
RowBox[{"p", ",", "r"}], "]"}]}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"toGraphics", "[",
RowBox[{"line", "[",
RowBox[{"a_", ",", "0", ",", "c_"}], "]"}], "]"}], ":=",
RowBox[{"InfiniteLine", "[",
RowBox[{"{",
RowBox[{
RowBox[{"{",
RowBox[{
RowBox[{"c", "/", "a"}], ",", "0"}], "}"}], ",",
RowBox[{"{",
RowBox[{
RowBox[{"c", "/", "a"}], ",", "1"}], "}"}]}], "}"}],
"]"}]}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"toGraphics", "[",
RowBox[{"line", "[",
RowBox[{"a_", ",", "b_", ",", "c_"}], "]"}], "]"}], ":=",
RowBox[{"InfiniteLine", "[",
RowBox[{"{",
RowBox[{
RowBox[{"{",
RowBox[{"0", ",",
RowBox[{"c", "/", "b"}]}], "}"}], ",",
RowBox[{"{",
RowBox[{"1", ",",
RowBox[{
RowBox[{"(",
RowBox[{"c", "-", "a"}], ")"}], "/", "b"}]}], "}"}]}], "}"}],
"]"}]}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{"toGraphics", "[", "obs_List", "]"}], ":=",
RowBox[{"toGraphics", "/@", "obs"}]}],
"\[IndentingNewLine]"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"draw", "[", "obs_", "]"}], ":=",
RowBox[{"Graphics", "[",
RowBox[{
RowBox[{"{",
RowBox[{"Thin", ",",
RowBox[{"toGraphics", "[", "obs", "]"}]}], "}"}], ",",
RowBox[{"AspectRatio", "\[Rule]", "Automatic"}]}], "]"}]}]}], "Input",
CellChangeTimes->{{3.809928213383772*^9, 3.809928272896276*^9}, {
3.8099283354470177`*^9, 3.809928355719696*^9}, {3.809928389324456*^9,
3.8099284531911077`*^9}, {3.8099285113219976`*^9, 3.809928551146323*^9}, {
3.80992876496803*^9, 3.809928807075822*^9}, {3.809929013402191*^9,
3.809929040750269*^9}, {3.809929095191041*^9, 3.809929124372908*^9}},
CellLabel->
"In[199]:=",ExpressionUUID->"89b1bc03-7381-4a7d-8a06-01add0d5b780"]
}, Closed]],
Cell[CellGroupData[{
Cell["Uporaba", "Section",
CellChangeTimes->{{3.810011560824685*^9,
3.810011561634335*^9}},ExpressionUUID->"9f798b97-4e1c-4330-b1be-\
a8fde92187e2"],
Cell[TextData[{
"To\[CHacek]ke reda ",
Cell[BoxData[
FormBox[
RowBox[{
RowBox[{"1", " ", "in", " ", "2"}], ":"}], TraditionalForm]],
FormatType->"TraditionalForm",ExpressionUUID->
"ed618554-fcfa-4fcc-913a-7ff5bd178711"]
}], "Text",
CellChangeTimes->{{3.810011579320016*^9,
3.810011615972919*^9}},ExpressionUUID->"d6cc7268-7a0b-4e9c-be0a-\
280605dee4d4"],
Cell[CellGroupData[{
Cell[BoxData[{
RowBox[{"generate", "[", "1", "]"}], "\[IndentingNewLine]",
RowBox[{"generate", "[", "2", "]"}]}], "Input",
CellChangeTimes->{{3.8100116016073236`*^9, 3.810011622025008*^9}, {
3.810012018807633*^9, 3.810012019402615*^9}},
CellLabel->
"In[222]:=",ExpressionUUID->"e937d31a-2c95-4591-8c65-35eb298b3430"],
Cell[BoxData[
RowBox[{"{",
RowBox[{
RowBox[{"{",
RowBox[{
RowBox[{"-", "1"}], ",", "0"}], "}"}], ",",
RowBox[{"{",
RowBox[{"1", ",", "0"}], "}"}]}], "}"}]], "Output",
CellChangeTimes->{{3.810011603562212*^9, 3.810011622838262*^9},
3.810011820980877*^9, 3.810011962825198*^9, {3.810012003896092*^9,
3.8100120209384527`*^9}, 3.810012068871879*^9, 3.810012108702901*^9},
CellLabel->
"Out[222]=",ExpressionUUID->"4b7797fa-8517-4001-a282-0d57fffaf0f5"],
Cell[BoxData[
RowBox[{"{",
RowBox[{
RowBox[{"{",
RowBox[{"0", ",",
SqrtBox["3"]}], "}"}], ",",
RowBox[{"{",
RowBox[{"0", ",",
RowBox[{"-",
SqrtBox["3"]}]}], "}"}], ",",
RowBox[{"{",
RowBox[{"1", ",", "0"}], "}"}], ",",
RowBox[{"{",
RowBox[{
RowBox[{"-", "3"}], ",", "0"}], "}"}], ",",
RowBox[{"{",
RowBox[{"3", ",", "0"}], "}"}], ",",
RowBox[{"{",
RowBox[{
RowBox[{"-", "1"}], ",", "0"}], "}"}]}], "}"}]], "Output",
CellChangeTimes->{{3.810011603562212*^9, 3.810011622838262*^9},
3.810011820980877*^9, 3.810011962825198*^9, {3.810012003896092*^9,
3.8100120209384527`*^9}, 3.810012068871879*^9, 3.810012108704674*^9},
CellLabel->
"Out[223]=",ExpressionUUID->"44c5b112-72ec-4fbb-ba5f-868ea45eb225"]
}, Open ]],
Cell["\<\
Nari\[SHacek]imo premice in kro\[ZHacek]nice, s katerimi smo dobili 6 to\
\[CHacek]k reda 2:\
\>", "Text",
CellChangeTimes->{{3.810011638506778*^9,
3.810011659870357*^9}},ExpressionUUID->"7cd65404-15eb-4be3-a665-\
84f4902feccd"],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{
RowBox[{"generateShapes", "[",
RowBox[{"generate", "[", "1", "]"}], "]"}], "//", "draw"}]], "Input",
CellChangeTimes->{{3.809927974500395*^9, 3.809927976510808*^9}, {
3.809928067828821*^9, 3.809928121356572*^9}, {3.80992820514935*^9,
3.809928206160118*^9}, {3.809928811735507*^9, 3.8099288130258837`*^9}, {
3.809928991892107*^9, 3.809929056432959*^9}, {3.8099291388417177`*^9,
3.80992915937175*^9}},
CellLabel->"In[42]:=",ExpressionUUID->"2c7bcc2b-04ff-47b2-b10e-0ca10685dabc"],
Cell[BoxData[
GraphicsBox[
{Thickness[Tiny],
TagBox[ConicHullRegionBox[{{0, 0}, {1, 0}}],
"InfiniteLine"], CircleBox[{1, 0}, 2], CircleBox[{-1, 0}, 2]},
AspectRatio->Automatic]], "Output",
CellChangeTimes->{{3.809928068571397*^9, 3.8099281223567743`*^9},
3.8099282065850983`*^9, 3.809928813597769*^9, {3.809928992299959*^9,
3.8099290567985783`*^9}, {3.809929103818162*^9, 3.8099291597409143`*^9},
3.810011664319454*^9},
CellLabel->"Out[42]=",ExpressionUUID->"f48179fe-0d3a-4216-b718-e2e22da12eeb"]
}, Open ]],
Cell["To\[CHacek]ke reda 3:", "Text",
CellChangeTimes->{{3.810011669511825*^9,
3.81001167274049*^9}},ExpressionUUID->"46baf343-fd04-4219-95b3-\
5ef336439dff"],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{
RowBox[{"generate", "[", "3", "]"}], " ", "//", " ", "Length"}]], "Input",
CellChangeTimes->{{3.810011676871415*^9, 3.810011695927318*^9}},
CellLabel->
"In[224]:=",ExpressionUUID->"015182fb-a7f6-4c0d-b6d6-21fd83e9d6a3"],
Cell[BoxData["203"], "Output",
CellChangeTimes->{{3.81001168164939*^9, 3.810011698975574*^9},
3.8100118298030977`*^9, 3.810011970068899*^9, 3.810012074399053*^9,
3.810012114857216*^9},
CellLabel->
"Out[224]=",ExpressionUUID->"0d44542f-3d80-4e16-a265-b27328119020"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{
RowBox[{"generateShapes", "[",
RowBox[{"generate", "[", "2", "]"}], "]"}], "//", "draw"}]], "Input",
CellChangeTimes->{{3.810011711554142*^9, 3.8100117116548843`*^9}},
CellLabel->
"In[225]:=",ExpressionUUID->"28cecefb-058b-4a74-80ed-bed6bb5c3988"],
Cell[BoxData[
GraphicsBox[
{Thickness[Tiny],
TagBox[ConicHullRegionBox[{{0, 0}, {1, 0}}],
"InfiniteLine"], CircleBox[{-1, 0}, 4], CircleBox[{3, 0}, 4],
CircleBox[{-1, 0}, 2], CircleBox[{-3, 0}, 2], CircleBox[{3, 0}, 6],
CircleBox[{-3, 0}, 6], CircleBox[{1, 0}, 2], CircleBox[{3, 0}, 2],
CircleBox[{-3, 0}, 4], CircleBox[{1, 0}, 4],
TagBox[
ConicHullRegionBox[
NCache[{{0, -3^Rational[1, 2]}, {1, (-2) 3^Rational[1, 2]}}, {{
0, -1.7320508075688772`}, {1, -3.4641016151377544`}}]],
"InfiniteLine"],
CircleBox[NCache[{0, -3^Rational[1, 2]}, {0, -1.7320508075688772`}], 2],
TagBox[
ConicHullRegionBox[
NCache[{{0, -3^Rational[1, 2]}, {1, (-2) 3^Rational[-1, 2]}}, {{
0, -1.7320508075688772`}, {1, -1.1547005383792517`}}]],
"InfiniteLine"],
CircleBox[{3, 0}, NCache[2 3^Rational[1, 2], 3.4641016151377544`]],
CircleBox[NCache[{0, -3^Rational[1, 2]}, {0, -1.7320508075688772`}],
NCache[2 3^Rational[1, 2], 3.4641016151377544`]],
TagBox[
ConicHullRegionBox[
NCache[{{0, -3^Rational[1, 2]}, {1, (-4) 3^Rational[-1, 2]}}, {{
0, -1.7320508075688772`}, {1, -2.3094010767585034`}}]],
"InfiniteLine"],
CircleBox[{-3, 0}, NCache[2 3^Rational[1, 2], 3.4641016151377544`]],
TagBox[
ConicHullRegionBox[
NCache[{{0, -3^Rational[1, 2]}, {1, 0}}, {{0, -1.7320508075688772`}, {1,
0}}]],
"InfiniteLine"],
TagBox[
ConicHullRegionBox[
NCache[{{0, 3^Rational[1, 2]}, {1, 2 3^Rational[1, 2]}}, {{
0, 1.7320508075688772`}, {1, 3.4641016151377544`}}]],
"InfiniteLine"],
CircleBox[NCache[{0, 3^Rational[1, 2]}, {0, 1.7320508075688772`}], 2],
TagBox[
ConicHullRegionBox[
NCache[{{0, 3^Rational[1, 2]}, {1, 2 3^Rational[-1, 2]}}, {{
0, 1.7320508075688772`}, {1, 1.1547005383792517`}}]],
"InfiniteLine"],
CircleBox[NCache[{0, 3^Rational[1, 2]}, {0, 1.7320508075688772`}], NCache[
2 3^Rational[1, 2], 3.4641016151377544`]],
TagBox[
ConicHullRegionBox[
NCache[{{0, 3^Rational[1, 2]}, {1, 4 3^Rational[-1, 2]}}, {{
0, 1.7320508075688772`}, {1, 2.3094010767585034`}}]],
"InfiniteLine"],
TagBox[
ConicHullRegionBox[
NCache[{{0, 3^Rational[1, 2]}, {1, 0}}, {{0, 1.7320508075688772`}, {1,
0}}]],
"InfiniteLine"],
TagBox[ConicHullRegionBox[{{0, 0}, {0, 1}}],
"InfiniteLine"]},
AspectRatio->Automatic]], "Output",
CellChangeTimes->{3.810011712459634*^9, 3.810012117759121*^9},
CellLabel->
"Out[225]=",ExpressionUUID->"1dc53543-95b0-4d5b-9131-97b1d12684d8"]
}, Open ]]
}, Open ]]
}, Open ]]
},
WindowSize->{1778, 1031},
WindowMargins->{{4, Automatic}, {0, Automatic}},
Magnification:>1.5 Inherited,
FrontEndVersion->"12.1 for Mac OS X x86 (64-bit) (March 18, 2020)",
StyleDefinitions->"Default.nb",
ExpressionUUID->"528250c3-8187-46b0-bf72-32ef5bac7ead"
]
(* End of Notebook Content *)
(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{}
*)
(*CellTagsIndex
CellTagsIndex->{}
*)
(*NotebookFileOutline
Notebook[{
Cell[CellGroupData[{
Cell[580, 22, 223, 4, 219, "Title",ExpressionUUID->"d0ee6d14-7f3f-4d5b-9c0b-20976882697d"],
Cell[806, 28, 158, 3, 71, "Author",ExpressionUUID->"2a7b5a77-fc04-4901-b8b8-2227c98ee5d7"],
Cell[967, 33, 184, 3, 69, "Affiliation",ExpressionUUID->"e51f1c36-163d-4312-a153-83f1ca123488"],
Cell[CellGroupData[{
Cell[1176, 40, 153, 3, 150, "Section",ExpressionUUID->"7dfa920f-e69e-4b4f-a438-009d85dfd51f"],
Cell[1332, 45, 278, 6, 129, "Text",ExpressionUUID->"d1b9606d-b91c-4ae1-8b12-3fddbe686929"],
Cell[CellGroupData[{
Cell[1635, 55, 396, 11, 72, "Item",ExpressionUUID->"0982e539-fd96-48a4-ba81-efaef60f4bd4"],
Cell[2034, 68, 674, 21, 72, "Item",ExpressionUUID->"0b556cc4-87b3-4824-8a26-340ca3add643"],
Cell[2711, 91, 844, 26, 72, "Item",ExpressionUUID->"d61901d7-ecd0-4fcc-94ce-4460d1f230a7"]
}, Open ]],
Cell[3570, 120, 196, 3, 78, "Text",ExpressionUUID->"83379133-4245-4c3a-bb09-67b218c00488"],
Cell[CellGroupData[{
Cell[3791, 127, 695, 20, 72, "Item",ExpressionUUID->"f3b08105-b9cc-43cf-826f-1417d3c4cf74"],
Cell[4489, 149, 696, 20, 72, "Item",ExpressionUUID->"0e57e41b-c7b4-45db-a5b8-7266b7564d25"],
Cell[5188, 171, 618, 16, 72, "Item",ExpressionUUID->"9854e4b6-6f67-4fe2-b9eb-3a487936ce15"],
Cell[5809, 189, 758, 21, 72, "Item",ExpressionUUID->"afdeeec8-4da6-4d94-a531-b3007e9f0edb"]
}, Open ]],
Cell[6582, 213, 6565, 172, 1381, "Input",ExpressionUUID->"58bdd9ad-b7dc-4360-b65d-031d00810b1e"],
Cell[13150, 387, 273, 6, 78, "Text",ExpressionUUID->"511aa655-dc46-401a-bbd1-2d5c1a73430f"],
Cell[13426, 395, 1524, 42, 185, "Input",ExpressionUUID->"c8612a4b-1454-4d16-9c93-86ad62c4093e"],
Cell[14953, 439, 750, 23, 79, "Text",ExpressionUUID->"b0861c87-ab3d-42ef-974d-773396935a3b"],
Cell[15706, 464, 5124, 150, 753, "Input",ExpressionUUID->"641df187-11fe-4471-b5f4-c4525434fef2"],
Cell[20833, 616, 540, 16, 79, "Text",ExpressionUUID->"1a0ea55a-4b3b-4e1c-8961-48cfeb1564ff"],
Cell[21376, 634, 4512, 129, 1013, "Input",ExpressionUUID->"96d5ee16-b21c-4c3b-ab68-92bcbd9907f3"],
Cell[25891, 765, 414, 11, 79, "Text",ExpressionUUID->"1b745cd0-fc92-4b65-bfce-61f6e270c31b"],
Cell[26308, 778, 2094, 58, 369, "Input",ExpressionUUID->"89b1bc03-7381-4a7d-8a06-01add0d5b780"]
}, Closed]],
Cell[CellGroupData[{
Cell[28439, 841, 152, 3, 113, "Section",ExpressionUUID->"9f798b97-4e1c-4330-b1be-a8fde92187e2"],
Cell[28594, 846, 372, 11, 79, "Text",ExpressionUUID->"d6cc7268-7a0b-4e9c-be0a-280605dee4d4"],
Cell[CellGroupData[{
Cell[28991, 861, 325, 6, 139, "Input",ExpressionUUID->"e937d31a-2c95-4591-8c65-35eb298b3430"],
Cell[29319, 869, 485, 12, 101, "Output",ExpressionUUID->"4b7797fa-8517-4001-a282-0d57fffaf0f5"],
Cell[29807, 883, 794, 24, 105, "Output",ExpressionUUID->"44c5b112-72ec-4fbb-ba5f-868ea45eb225"]
}, Open ]],
Cell[30616, 910, 242, 6, 78, "Text",ExpressionUUID->"7cd65404-15eb-4be3-a665-84f4902feccd"],
Cell[CellGroupData[{
Cell[30883, 920, 519, 9, 92, "Input",ExpressionUUID->"2c7bcc2b-04ff-47b2-b10e-0ca10685dabc"],
Cell[31405, 931, 524, 10, 613, "Output",ExpressionUUID->"f48179fe-0d3a-4216-b718-e2e22da12eeb"]
}, Open ]],
Cell[31944, 944, 162, 3, 78, "Text",ExpressionUUID->"46baf343-fd04-4219-95b3-5ef336439dff"],
Cell[CellGroupData[{
Cell[32131, 951, 249, 5, 92, "Input",ExpressionUUID->"015182fb-a7f6-4c0d-b6d6-21fd83e9d6a3"],
Cell[32383, 958, 276, 5, 101, "Output",ExpressionUUID->"0d44542f-3d80-4e16-a265-b27328119020"]
}, Open ]],
Cell[CellGroupData[{
Cell[32696, 968, 281, 6, 92, "Input",ExpressionUUID->"28cecefb-058b-4a74-80ed-bed6bb5c3988"],
Cell[32980, 976, 2579, 61, 613, "Output",ExpressionUUID->"1dc53543-95b0-4d5b-9131-97b1d12684d8"]
}, Open ]]
}, Open ]]
}, Open ]]
}
]
*)

Koliko je konstruktibilnih točk četrtega reda?

Povzetek: Konstruktibilne točke tvorimo tako, da začnemo z dvema točkama na ravnini. V naslednjem koraku z ravnilom narišemo vse premice, ki potekajo skozi vsaj dve od predhodno konstruiranih točk, s šestilom pa vse krožnice, ki imajo središče v eni od točk in vsebujejo še eno od točk. V drugem koraku tako dobimo 6 točk (prvotni dve in še štiri presečišča med dvema krožnicama in premico). V tretjem koraku dobimo 203 točke. Katero število dobimo v čertem koraku? Hitro vidimo, da je število zelo veliko in da ga ne moremo kar tako stresti iz rokava. Pomagamo si lahko z računalniki, a moramo pred tem spoznati še konstruktibilna števila in postopke za računanje z njimi.

Konstruktibilne točke

V klasični geometriji uporabljamo (neoznačeno) ravinolo in šestilo. Z ravnilom lahko povlečemo premico skozi dve točki, s šestilom pa narišemo krožnico z danim središčem in polmerom. Mi se bomo omejili le na risanje krožnic z danim središčem in dano točko na krožnici, tako bodo razmisleki nekoliko bolj preprosti, a še vedno zanimmivi. (Se pravi, da ne moremo odmeriti polmera na daljici in ga prenesti v neko tretjo točko.)

Točko lahko konstruiramo kot sečišče dveh premic, krožnica, ali krožnice in premice.

Definicija: Točka je konstruktibilna, če jo lahko načrtamo z ravnilom in šestilom kot presečišče premic in krožnic, začenši z dvema danima točkama, ki določata enotsko daljico.

Posvetili se bomo naslednjemu vprašanju:

Koliko točk lahko skonstruiramo na ta način v nekaj korakih?

Prvi korak: začnimo z dvema točkama.

Drugi korak: narišemo eno premico in dve krožnici, skupaj dobimo 6 točk.

Tretji korak? Kaj dobimo v tretjem koraku? Na roko bomo težko vse narisal. Sicer imamo simetrijo, to bo malce pomagalo, a je še vedno preveč. Pomagali si bomo z računalnikom.

Konstruktibilna števila

Pri delu z računalnikom bomo delali analitično, se pravi, da uvedemo koordinatni sistem in računamo koordinate točk.

Najprej premislimo, kako zapleteni bodo izračuni.

Premica je podana z enačbo oblike a x + b y = c

Krožnica s središčem (x₁,y₁) in polmerom r je podana z enačbo oblike (x - x₁)² + (y - y₁)² = r².

Če želimo izračunati koordinate presečišč, moramo rešiti sistem enačb:

  • premica-premica: dve linearni enačbi z dvema neznankama
  • premica-krožnica: ena linearna in ena kvadratna enačba z dvema neznankama
  • krožnica-krožnica: dve kvadratni enačbi z dvema neznankama

Paziti je treba tudi na število rešitev (od 0 do 4). Poleg tega bomo dobivali rešitve v komplesnih številih, ki jih zavržemo. Seveda takih enačb ne bomo reševali na roko, pomagamo si z Mathematico.

S kakšnimi števili imamo opravka pri reševanju enačb? Geometrijsko gledano, gre za števila, ki jih lahko "konstruiramo" z ravnilom in šestilom:

Definicija: Število r je konstruktibilno, če lahko začenši z daljico dolžine 1 z ravnilom in šestilom načrtamo daljico dolžine r.

Iz stališča algebre gre za števila, ki jih lahko tvorimo iz 0 in 1 z operacijami +, ×, -, / in . (Kvadratni koreni izhajajo iz reševanja kvadratnih enačb.) Če bi imeli le prve štiri operacije, bi dobili natanko vsa racionalna števila. Kvadratni koren pa nabor števil razširi, na primer: √2, √(√2), 2 + √(3 + √5) itd. Konstruktibilna števila tvorijo obseg K, ki je hkrati zaprt še za kvadratne korene.

Kaj še lahko povemo o obsegu K? Zagotovo vsebuje racionalna števila , je razširitev obsega racionalnih števil. Če bi na primer razširili samo z enim kvadratnim korenom √r, bi dobili razširitev ℚ(√r). Imamo dve množnosti:

  1. √r je racionalno število (če je r = a^2/b^2 za neki celi števili a in b), v tem primeru ℚ(√r) = ℚ.
  2. √r je iracionalno število, v tem primeru so elementi ℚ(√r) oblike p + q √r, kjer sta p, q ∈ ℚ.

Kako računamo v obsegu ℚ(√r)? Vprašajmo Mathematico!

V splošnem je obseg K bolj kompliciran. Vsako konstruktibilno število dobimo z nekim zaporedjem razširitev s kvadratnimi koreni:

ℚ(√r₁)(√r₂)⋯(√rᵢ)

To je r₁ ∈ ℚ, r₂ ∈ ℚ(√r₁), ... Pravila za računanje postanejo bolj zapletena in se vanje ne bomo spuščali.

Konstruktibilne točke v Mathematici

Oglejmo si, kako v Mathematici sestavimo program, ki za nas konstruira točke, jih prešteje in tudi nariše.

Dobimo odgovor:

Konstruktibilnih točk tretjea reda je 203.

Koliko je konstruktibilnih točk čertega reda?

Če poskusimo v Mathematici izračunati, koliko je konstruktibilnih točk četrtega, ne dobimo odgovora. Koliko jih sploh je? Ali lahko naredimo kakšno zgornjo oceno?

Naredimo zelo grobo oceno. Denimo, da imamo n točk. Iz njih lahko tvorimo:

  • največ premic, po eno za vsaki dve točki (pravzaprav n(n-1)/2, a poenostavimo)
  • največ krožnic, po dve za vsaki dve točki
  • največ n⁴ parov premic, ki dajo največ n⁴ presečišč
  • največ n⁴ parov premica-krožnica, ki dajo največ 2 n⁴ presečišč
  • največ n⁴ parov krožnica-krožnica, ki dajo največ 2 n⁴ presečišč

Skupaj torej ne več kot 5 n⁴ točk v naslednjem koraku. Dobimo torej naslednje ocene:

  • prvi red: največ 2 točki
  • drugi red: največ 5 · 2⁴ = 80 točk (v resnici 6)
  • tretji red: največ 5 · 80⁴ = 204.800.000 ≈ 200 · 10⁶ točk (v resnici 203)
  • četrti red: največ 5 · 204800000⁴ = 8796093022208000000000000000000000 ≈ 10³⁴ točk

A ta zgornja ocena je precej groba, čeprav nas opozarja, da bo število zares veliko.

Koliko je konstruktibilnih točk četrtega reda, je pvrašal Joel Hamkins na math.stackexchange.com.

Kar z nekaj truda je nanj odgovoril Teofil Camarasu. Poglejmo, kako je to naredil in kakšen je odgovor.

Napisal je program v Haskellu (Mathematica je prepočasna), uporabil je knjižnico za računanje s konstruktibilnimi števili. Ker je računanje s konstruktibilnimi števili precej počasnejše od vgrajenih števil s plavajočo vejico (ki jih ne smemo uporabiti!), je za pospešitev vsako konstruktibilno število izračunal še približno spodnjo iz zgornjo oceno, saj je lahko tako hitro ugotovil, ali sta števili različni. Za račuanje presečiš premic in krožnic je uporabil še nekatere algoritme iz računske geometrije. Uporabil je tudi simetrijo med kvadranti, da ni bilo treba računati vsega.

Šest vzporednih procesov je na treh računalnikih 6 dni računalo odgovor. Nikoli niso presegli uporabe več kot 5 GB pomnilnika. Odgovor je:

Konstruktibilnih točk četrtega reda je 1723816861.

Zaporedje je zavedeno v OEIS pod A333944.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment