(* 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[ 18659, 358] NotebookOptionsPosition[ 17981, 339] NotebookOutlinePosition[ 18384, 355] CellTagsIndexPosition[ 18341, 352] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell[TextData[StyleBox["Density Based Clustering index for optimal partition \ with geometrical objects ", FontColor->RGBColor[1, 0, 0]]], "Subsubsection", CellChangeTimes->{{3.73112424028771*^9, 3.7311242546173754`*^9}, { 3.8106047392458076`*^9, 3.8106047456549196`*^9}, {3.8131286886441045`*^9, 3.8131286920600576`*^9}, 3.8210125983161287`*^9, 3.8210128058509197`*^9, 3.822554546013409*^9},ExpressionUUID->"e66d6e93-d6b2-4c5b-9154-\ 8959b5b959a5"], Cell[BoxData[ RowBox[{"(*", " ", RowBox[{ RowBox[{"DBC", "-", RowBox[{"modul", " ", "gives", " ", "QD", " ", "value", " ", "for", " ", RowBox[{"Oval", ".", " ", "Ako"}], " ", "se", " ", "\[ZHacek]eli", " ", "koristiti", " ", "za", " ", "druge", " ", "krivulje"}]}], ",", " ", RowBox[{"umjesto", " ", RowBox[{"DGcir", "[", "]"}], "treba", " ", "pozvati", " ", "modul", " ", "za", " ", "udaljenost", " ", "to\[CHacek]ke", " ", "do", " ", "te", " ", RowBox[{"krivulje", "."}]}]}], " ", "*)"}]], "Input", CellChangeTimes->{{3.8229821981043024`*^9, 3.8229823405480886`*^9}, { 3.8229986590399027`*^9, 3.822998662970648*^9}, {3.8229988000725007`*^9, 3.8229988104179645`*^9}, {3.8229988751260157`*^9, 3.822998875709693*^9}, { 3.822998908071754*^9, 3.822998960175069*^9}, {3.8229989986126733`*^9, 3.822999015828765*^9}},ExpressionUUID->"5b0b3e1d-c6d7-458a-915d-\ cee4f00b1fbc"], Cell[BoxData[{ RowBox[{ RowBox[{ StyleBox["Input", FontColor->RGBColor[1, 0, 0]], StyleBox[":", FontColor->RGBColor[1, 0, 0]], " ", RowBox[{ RowBox[{ "partition", " ", "\[CapitalPi]", " ", "of", " ", "the", " ", "set", " ", "\[ScriptCapitalA]"}], " ", "\[Subset]", " ", SuperscriptBox["\[DoubleStruckCapitalR]", "n"]}]}], ",", " ", RowBox[{ RowBox[{"geometrical", " ", "objects"}], ";"}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{ StyleBox["Output", FontColor->RGBColor[1, 0, 0]], StyleBox[":", FontColor->RGBColor[1, 0, 0]], " ", RowBox[{ "QD", " ", "index", " ", "of", " ", "the", " ", "partition", " ", "\[CapitalPi]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ StyleBox["Submodules", FontColor->RGBColor[1, 0, 0]], StyleBox[":", FontColor->RGBColor[1, 0, 0]], StyleBox[" ", FontColor->RGBColor[1, 0, 0]], RowBox[{"DGcir", "[", "]"}]}], " "}], "\[IndentingNewLine]"}], "Text", CellChangeTimes->{{3.7311239388490767`*^9, 3.7311241887665453`*^9}, { 3.731124262852821*^9, 3.7311242818390455`*^9}, {3.731124334688675*^9, 3.7311243931480875`*^9}, {3.731124464437002*^9, 3.7311245820590296`*^9}, { 3.731124626641944*^9, 3.7311246685996666`*^9}, 3.73112478187739*^9, 3.7311249716632557`*^9, 3.731125008229858*^9, {3.731131363164089*^9, 3.7311315307912507`*^9}, {3.8106047626816826`*^9, 3.810604763185858*^9}, { 3.810606445967278*^9, 3.810606530225013*^9}, {3.810606641466092*^9, 3.810606684833495*^9}, {3.810606749868683*^9, 3.810606752984932*^9}, { 3.8106068274532113`*^9, 3.810606866094061*^9}, {3.810606901083395*^9, 3.810607019637113*^9}, {3.810607054277118*^9, 3.8106071829172134`*^9}, { 3.8106072199097958`*^9, 3.8106072546405845`*^9}, 3.8106074697262*^9, { 3.8131282699269085`*^9, 3.813128270182798*^9}, {3.8131283217992973`*^9, 3.8131283433443713`*^9}, {3.8131285602764816`*^9, 3.813128631734671*^9}, { 3.813128716159551*^9, 3.8131287310664387`*^9}, {3.813128829720832*^9, 3.8131288437367177`*^9}, {3.8131288968861256`*^9, 3.8131288976456766`*^9}, {3.8208206004327154`*^9, 3.820820602339464*^9}, { 3.8208232348027654`*^9, 3.820823235970901*^9}, {3.8210126257677174`*^9, 3.8210126431522183`*^9}, {3.8210126931585455`*^9, 3.8210127495586214`*^9}, {3.82227632906433*^9, 3.8222763387744713`*^9}, { 3.822286682657259*^9, 3.8222866948935103`*^9}, {3.822554555438804*^9, 3.8225546074094253`*^9}}, FontSize->12, FontColor->RGBColor[ 0, 0, 1],ExpressionUUID->"a16ffa28-7742-4592-bcc2-c1a697822085"], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"DBC", "[", RowBox[{"PI_", ",", "Circles_"}], "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{"k1", ",", "h", ",", RowBox[{"rho", "=", RowBox[{"{", "}"}]}], ",", RowBox[{"mad", "=", RowBox[{"{", "}"}]}], ",", RowBox[{"QAD", "=", RowBox[{"{", "}"}]}], ",", "rj"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"k1", "=", RowBox[{"Length", "[", "Circles", "]"}]}], ";", " ", "\[IndentingNewLine]", RowBox[{"Do", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"mj", "=", RowBox[{"Length", "[", RowBox[{"PI", "[", RowBox[{"[", "j", "]"}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"dC", "=", RowBox[{ RowBox[{"2", "Pi", " ", RowBox[{"Circles", "[", RowBox[{"[", RowBox[{"j", ",", "2"}], "]"}], "]"}]}], "+", RowBox[{"2", RowBox[{"Norm", "[", RowBox[{ RowBox[{"Circles", "[", RowBox[{"[", RowBox[{"j", ",", "1", ",", "1"}], "]"}], "]"}], "-", RowBox[{"Circles", "[", RowBox[{"[", RowBox[{"j", ",", "1", ",", "2"}], "]"}], "]"}]}], "]"}]}]}]}], ";", "\[IndentingNewLine]", RowBox[{"ud1", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"DGcir1", "[", RowBox[{ RowBox[{"PI", "[", RowBox[{"[", RowBox[{"j", ",", "s", ",", "2"}], "]"}], "]"}], ",", RowBox[{"Circles", "[", RowBox[{"[", RowBox[{"j", ",", "1"}], "]"}], "]"}], ",", RowBox[{"Circles", "[", RowBox[{"[", RowBox[{"j", ",", "2"}], "]"}], "]"}]}], "]"}], ",", RowBox[{"{", RowBox[{"s", ",", "mj"}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"QAD", "=", RowBox[{"Append", "[", RowBox[{"QAD", ",", RowBox[{ RowBox[{"Mean", "[", "ud1", "]"}], "+", RowBox[{"2", RowBox[{"Sqrt", "[", RowBox[{"Variance", "[", "ud1", "]"}], "]"}]}]}]}], "]"}]}], ";"}], "\[IndentingNewLine]", ",", RowBox[{"{", RowBox[{"j", ",", RowBox[{"Length", "[", "Circles", "]"}]}], "}"}]}], "]"}], ";", " ", "\[IndentingNewLine]", RowBox[{"Print", "[", RowBox[{ "\"\\"", ",", "k1", ",", "\"\< klastera: \>\"", ",", RowBox[{"LPI", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"Length", "[", RowBox[{"PI", "[", RowBox[{"[", "j", "]"}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"j", ",", "k1"}], "}"}]}], "]"}]}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"(*", RowBox[{ RowBox[{"Print", "[", RowBox[{ "\"\\"", ",", "QAD", ",", " ", "\"\<; Max[QAD] = \>\"", ",", RowBox[{"Max", "[", "QAD", "]"}]}], "]"}], ";"}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"Max", "[", "QAD", "]"}], ",", "QAD"}], "}"}]}]}], "\[IndentingNewLine]", "]"}]}], ";"}]], "Input", CellChangeTimes->{ 3.7362233902186794`*^9, {3.736223433946621*^9, 3.7362234852607455`*^9}, { 3.7362236446402264`*^9, 3.736223661856814*^9}, {3.7362237010334797`*^9, 3.7362238545064297`*^9}, {3.7362238869847918`*^9, 3.736223894102953*^9}, { 3.7362239735362825`*^9, 3.7362239750943837`*^9}, 3.736225313719769*^9, { 3.7363819298518734`*^9, 3.7363819344950895`*^9}, {3.736381975746106*^9, 3.7363819931420417`*^9}, {3.7363820953047285`*^9, 3.7363821891027985`*^9}, {3.7363822951169863`*^9, 3.736382303467432*^9}, { 3.7363823976009607`*^9, 3.7363824592341127`*^9}, 3.7363825111556315`*^9, { 3.736382716161333*^9, 3.736382784134231*^9}, {3.7363834609927645`*^9, 3.7363834666876135`*^9}, {3.7363839158368425`*^9, 3.736384005010475*^9}, 3.73638403523626*^9, {3.7363854240889406`*^9, 3.7363854267516603`*^9}, { 3.736385498246292*^9, 3.736385510614292*^9}, {3.7363865949658775`*^9, 3.736386703974923*^9}, {3.7363867475463023`*^9, 3.736386765130476*^9}, { 3.736386820182021*^9, 3.7363869385364666`*^9}, 3.7363870582452755`*^9, { 3.736387163475957*^9, 3.736387216980803*^9}, {3.736387334134575*^9, 3.736387334599639*^9}, {3.736387416059576*^9, 3.73638745105206*^9}, 3.7363877316072783`*^9, {3.7363878034663444`*^9, 3.736387826212455*^9}, { 3.736387891307604*^9, 3.7363879174695573`*^9}, 3.7363881195816555`*^9, { 3.7363888461820936`*^9, 3.7363888588992805`*^9}, {3.736389260524787*^9, 3.73638926110116*^9}, {3.736480835976326*^9, 3.7364809374694443`*^9}, { 3.7364813831978407`*^9, 3.736481413772037*^9}, {3.736481544119508*^9, 3.7364815585531163`*^9}, {3.7364823571364746`*^9, 3.7364823622516785`*^9}, {3.7364899104365864`*^9, 3.7364899187997913`*^9}, {3.736489965220625*^9, 3.7364899870272303`*^9}, { 3.736490087440727*^9, 3.7364901088904257`*^9}, {3.7364925672532063`*^9, 3.736492598776657*^9}, 3.736492635928765*^9, {3.736492762260789*^9, 3.736492798903942*^9}, {3.7364929721203356`*^9, 3.7364929760689*^9}, { 3.736493114189128*^9, 3.736493138963595*^9}, {3.7364964844718*^9, 3.736496520691388*^9}, {3.7364966421983733`*^9, 3.7364966471906404`*^9}, 3.7364966816414347`*^9, 3.7364967132457914`*^9, {3.7364969793706784`*^9, 3.7364969829741993`*^9}, 3.7364971338340297`*^9, {3.7364972643782463`*^9, 3.736497297073783*^9}, 3.7364974906284943`*^9, {3.7365626250196133`*^9, 3.736562637093058*^9}, {3.7366108995670414`*^9, 3.7366109051303234`*^9}, { 3.737637570303402*^9, 3.737637572537387*^9}, {3.73763927300869*^9, 3.737639277205859*^9}, {3.737639314778799*^9, 3.737639335733493*^9}, { 3.7376393918327026`*^9, 3.737639424219845*^9}, 3.737639858825759*^9, { 3.7379411200452747`*^9, 3.737941129578671*^9}, {3.7379416344263973`*^9, 3.737941796147574*^9}, {3.7379418659822807`*^9, 3.7379418823067327`*^9}, { 3.7379419339279923`*^9, 3.7379419440539336`*^9}, {3.7379419951448236`*^9, 3.737942043817322*^9}, {3.7379420801298513`*^9, 3.7379421945221157`*^9}, 3.737943077336174*^9, {3.7379432840239096`*^9, 3.737943337240453*^9}, { 3.737944481941667*^9, 3.737944539130804*^9}, {3.73794482583533*^9, 3.7379448531951103`*^9}, {3.737945367931177*^9, 3.7379453973323717`*^9}, { 3.737945710980399*^9, 3.7379457357041616`*^9}, {3.7379459528497257`*^9, 3.737945953251832*^9}, {3.737945992383873*^9, 3.737946063855008*^9}, { 3.7379461133646593`*^9, 3.7379461195491443`*^9}, {3.737946263407737*^9, 3.7379462711132307`*^9}, {3.737946308749333*^9, 3.7379463205748234`*^9}, { 3.7379464342401056`*^9, 3.737946444081283*^9}, {3.7379464789320135`*^9, 3.737946481086709*^9}, {3.7379467229219294`*^9, 3.7379467249954476`*^9}, { 3.7379467991977997`*^9, 3.7379468085968037`*^9}, {3.73795644478891*^9, 3.737956493106577*^9}, 3.7379587119398932`*^9, {3.7379588709723377`*^9, 3.737958888755762*^9}, {3.737961960234312*^9, 3.73796197887956*^9}, { 3.73812777590506*^9, 3.7381278185088773`*^9}, {3.7381278505822506`*^9, 3.7381279111919293`*^9}, {3.738128335172887*^9, 3.738128341001073*^9}, { 3.738132047731757*^9, 3.738132052051295*^9}, {3.73839496587904*^9, 3.738394966879236*^9}, {3.7383950129622116`*^9, 3.7383950559200597`*^9}, { 3.738395226360083*^9, 3.738395282303426*^9}, {3.738395331808699*^9, 3.7383953789231195`*^9}, {3.7383954358510942`*^9, 3.738395436413927*^9}, { 3.7383954800902505`*^9, 3.7383954809027977`*^9}, 3.738414436205058*^9, { 3.7384145083380737`*^9, 3.738414509291294*^9}, {3.7384146343513365`*^9, 3.738414634914136*^9}, {3.73841482460626*^9, 3.7384148266065507`*^9}, { 3.7384150285029187`*^9, 3.7384150289250317`*^9}, {3.738415075492365*^9, 3.7384151314672766`*^9}, {3.738415754547442*^9, 3.7384158098817263`*^9}, 3.738416243677947*^9, {3.7384163354377813`*^9, 3.7384163360787582`*^9}, { 3.738416400319951*^9, 3.7384164018042684`*^9}, {3.738417109208248*^9, 3.7384171132086773`*^9}, {3.738417220532855*^9, 3.7384172253146887`*^9}, { 3.738417264084386*^9, 3.7384172693194103`*^9}, {3.7384173558752775`*^9, 3.7384173577351513`*^9}, 3.738417426304906*^9, {3.7384177504843454`*^9, 3.738417756688103*^9}, {3.73841796803864*^9, 3.738417977602358*^9}, { 3.738418217377862*^9, 3.7384182267384343`*^9}, {3.7384183400160074`*^9, 3.7384183529392653`*^9}, {3.7384184489184957`*^9, 3.738418450262446*^9}, { 3.7384780235696383`*^9, 3.7384780388525653`*^9}, {3.7384780718718877`*^9, 3.73847809721338*^9}, {3.7384782268476553`*^9, 3.738478241537001*^9}, { 3.7384782785096393`*^9, 3.7384782792440953`*^9}, {3.738478397100283*^9, 3.7384784482935476`*^9}, {3.7384788085169973`*^9, 3.7384788500214453`*^9}, {3.738479007303647*^9, 3.738479011991686*^9}, { 3.7384801342372894`*^9, 3.7384801647249327`*^9}, {3.738480298035934*^9, 3.738480303146018*^9}, {3.738480395030673*^9, 3.738480439707347*^9}, { 3.738481062602091*^9, 3.73848106644635*^9}, {3.7384811594560413`*^9, 3.738481160346955*^9}, {3.7384812532004952`*^9, 3.7384812563570523`*^9}, { 3.738495308589227*^9, 3.7384953095424547`*^9}, {3.738495382371191*^9, 3.738495383152525*^9}, {3.738495514689903*^9, 3.7384955155496063`*^9}, { 3.7384964276639338`*^9, 3.73849645322922*^9}, {3.738496484185811*^9, 3.738496551818149*^9}, {3.738496591665888*^9, 3.738496646250064*^9}, { 3.7384966900047526`*^9, 3.73849672060178*^9}, 3.7384970351118793`*^9, 3.7384972857796516`*^9, {3.7384977871456137`*^9, 3.7384978058197875`*^9}, { 3.738497902704879*^9, 3.738497906752445*^9}, {3.73849815535699*^9, 3.738498176453169*^9}, {3.73849826744728*^9, 3.73849826799422*^9}, { 3.73849852742581*^9, 3.738498530269867*^9}, {3.738499280235734*^9, 3.7384993068323383`*^9}, {3.7384996268041105`*^9, 3.7384996370241385`*^9}, {3.7384997076411753`*^9, 3.7384997095161023`*^9}, 3.738500179816704*^9, {3.7386302694070044`*^9, 3.738630292529331*^9}, { 3.738630642028632*^9, 3.7386306456638527`*^9}, {3.7386307289075885`*^9, 3.738630731738645*^9}, {3.738632241471073*^9, 3.7386323471337905`*^9}, { 3.7387150887669983`*^9, 3.73871522676186*^9}, {3.7387152766968203`*^9, 3.738715294104946*^9}, {3.7387154849079933`*^9, 3.7387154886178937`*^9}, { 3.7387165817426224`*^9, 3.7387165827654295`*^9}, 3.7387206006843615`*^9, { 3.73872073343501*^9, 3.738720737093293*^9}, {3.7387208631582537`*^9, 3.7387209150474634`*^9}, {3.739344192554881*^9, 3.739344220534587*^9}, { 3.7393442816151004`*^9, 3.7393443424135094`*^9}, {3.739344450875293*^9, 3.7393444514654937`*^9}, {3.739408725001717*^9, 3.739408741153547*^9}, 3.7394087942823133`*^9, {3.739408830424265*^9, 3.739408853589138*^9}, { 3.7394088963113194`*^9, 3.739408916938924*^9}, {3.7394105116773453`*^9, 3.739410512548293*^9}, {3.7394134344485664`*^9, 3.7394134415199237`*^9}, { 3.7395802766677074`*^9, 3.739580310321542*^9}, 3.7395803610602655`*^9, 3.739580419283676*^9, {3.7395806292147107`*^9, 3.739580651722886*^9}, { 3.739580746282484*^9, 3.7395808367924404`*^9}, {3.7395809236126547`*^9, 3.7395809376555953`*^9}, {3.739581213406556*^9, 3.739581224758216*^9}, { 3.7395812641210384`*^9, 3.739581275703332*^9}, {3.73958131082475*^9, 3.7395813133434963`*^9}, {3.7395813611405573`*^9, 3.7395814161617746`*^9}, 3.739581794456417*^9, {3.7395824833448114`*^9, 3.7395825296526117`*^9}, { 3.739585241563775*^9, 3.739585244214543*^9}, 3.7395853455714116`*^9, { 3.7395862244515734`*^9, 3.7395862813698583`*^9}, {3.739600112840098*^9, 3.739600150921996*^9}, {3.7396002720598955`*^9, 3.739600272575822*^9}, { 3.7396003212839193`*^9, 3.7396003574130197`*^9}, {3.73960052982172*^9, 3.7396005342755923`*^9}, {3.7397531173179703`*^9, 3.7397531506335764`*^9}, {3.739753290820388*^9, 3.739753308676875*^9}, { 3.739758894827696*^9, 3.7397589021301265`*^9}, {3.7398015153382688`*^9, 3.7398015453711395`*^9}, 3.739801622586483*^9, 3.739801925537116*^9, { 3.7398020117093086`*^9, 3.7398020137186184`*^9}, {3.739966915601386*^9, 3.7399669602222943`*^9}, {3.7399670099210844`*^9, 3.7399670111937447`*^9}, {3.7399670570499945`*^9, 3.739967207773419*^9}, { 3.739968696502956*^9, 3.739968697002965*^9}, {3.7399689354141703`*^9, 3.739968952692974*^9}, {3.739969096444254*^9, 3.7399691085443172`*^9}, { 3.739969266603644*^9, 3.739969267064685*^9}, 3.7399697822355795`*^9, { 3.7399698555299788`*^9, 3.739969856055562*^9}, {3.739969941968858*^9, 3.7399699421972733`*^9}, {3.7399700540841417`*^9, 3.7399700542872076`*^9}, {3.74113267211073*^9, 3.741132679726599*^9}, { 3.7413343715764728`*^9, 3.7413343944791584`*^9}, {3.741334454801077*^9, 3.7413344970364914`*^9}, {3.7413348166664004`*^9, 3.7413348930489836`*^9}, {3.741335038089163*^9, 3.7413350446540604`*^9}, 3.741337158490567*^9, 3.822397415075363*^9, 3.8223974851575627`*^9}, CellLabel->"In[14]:=",ExpressionUUID->"e0a6c231-d907-4fbc-b752-9b22d657226a"] }, Open ]] }, WindowSize->{754, 463}, WindowMargins->{{Automatic, 157}, {Automatic, 94}}, TaggingRules->{"SlideshowSettings" -> {"Toolbar" -> True}}, FrontEndVersion->"12.0 for Microsoft Windows (64-bit) (April 8, 2019)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[580, 22, 462, 7, 44, "Subsubsection",ExpressionUUID->"e66d6e93-d6b2-4c5b-9154-8959b5b959a5"], Cell[1045, 31, 923, 16, 48, "Input",ExpressionUUID->"5b0b3e1d-c6d7-458a-915d-cee4f00b1fbc"], Cell[1971, 49, 2588, 55, 84, "Text",ExpressionUUID->"a16ffa28-7742-4592-bcc2-c1a697822085"], Cell[4562, 106, 13403, 230, 238, "Input",ExpressionUUID->"e0a6c231-d907-4fbc-b752-9b22d657226a"] }, Open ]] } ] *)