(* Content-type: application/vnd.wolfram.mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 8.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 157, 7] NotebookDataLength[ 26026, 675] NotebookOptionsPosition[ 24820, 628] NotebookOutlinePosition[ 25462, 653] CellTagsIndexPosition[ 25419, 650] WindowTitle->Simple Best-Fit Line - Source WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell["Simple Best-Fit Line", "Section", CellFrame->{{0, 0}, {0, 0}}, ShowCellBracket->False, FontColor->RGBColor[0.597406, 0, 0.0527047]], Cell[BoxData[ GraphicsBox[RasterBox[CompressedData[" 1:eJztnVuSozgWQDNiPqa3MJ+zpVlCbaB3WlGVNV9dvYH6TQRUph/ZGIHQmwvG xoZzQu3Aku7VfUj4Nk53//fLn//78q+Xl5f/NP/88e+Xl8v154Xj5+fp89y0 4+X63L7VnQu02XqOt9FzjRK5qtRMoYZFpk11/Ji+WDye92+r7+fFfbnGkuu9 eIQ4LBVJ+YRo5DPnRdITDp0TLRg6m/62nY/n08f5+H461G37fWqum57z4Xy2 jby0prMZOh4/jodLOx2bt6fzRSEA3B/KMKGSBy/DSKVcyYOn8krHqajvqed6 G6iol4qkfAIVNQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADsizPA/lj72AEA AMCmWLu0AXh01j6jAAAAcdb+hNwUJ5e1zZnPDEeey/e1jx0AAABsirVLm03x XFVlhs1X1JNY+4wCAAB02B9PJ4BdsvYpBAAAgOeGihpADo9GAUDIr+Lnr7ef a9vw16/i73VtMPx6+2v1gGwMijeAE89FAQA2DRW1BxX14lBRA0wi+lx0baMA AAAAAAAAAAAAbkj0uegR4L4cDoe1TYA1YQMAbIaDy9rm3JU9+w4AjwB3np3D BgDYDHuuKu/su3k0ynNRACGLHMy93dm2ijCPpHvD7LliAQAAmA0VNRioqIGK Gl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KqC ys+f+tE5aZVoBSU0T87U+sr2emq4Ur7k9eQrhydiaqiF3LqSX4QFfacMk684 yaT7l2GkUr7iJJOoqKMrUlGPritxZ9RyT9aIUFHn133e3IVQUQvVUlHPhor6 1r6r/k9G9X1A/47+dDrZ/9+lb9++vbr8+PHDe7X7w077rafHU+JNTo1GF/Wu U52hhtCjqGEZJVGdoZsp5ZmZoRe2kc3Fd0tnKGKvJQ9UKr8pRh15dY0MZTOO e/pTa43OSUmFpn5Pbzzv7agveTNCJRnZ70FCX4OU5ZWn9KfiELrpLZ3aIZn0 RYmGN+NRPsIpd7y19pa7qIhQZ15coicVmamMLjpb1SLmLUgmzlOtzau6RRAm bYxFTJoh9Vy+U4aNKonqDN1MKc/MDL2wjXydWIaRylElz5LKVExSS2Scigqm HHl1jQxlM457+lNrjc5JSYWmUlF7jqQ2RmqHZNIXJRrejEf5CKfc8dbaW+6i IkKdeXGJnlRkpjK66GxVi5i3IJk4T7U2r+oWQZi0MRYxaYbUZnyPLvH/lte2 FP/69esnAAAAAAAAAAAAwM74B4thROM= "], {{0, 0}, {1800, 25}}, {0, 255}, ColorFunction->RGBColor], ImageSize->{1800, 25}, PlotRange->{{0, 1800}, {0, 25}}]], "Section", CellFrame->{{0, 0}, {0, 0}}, ShowCellBracket->False], Cell[BoxData[ RowBox[{"Manipulate", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{ RowBox[{"clr", "[", "test_", "]"}], ":=", RowBox[{"If", "[", RowBox[{ RowBox[{"MemberQ", "[", RowBox[{"includepts", ",", "test"}], "]"}], ",", RowBox[{"RGBColor", "[", RowBox[{".9", ",", ".42", ",", ".17"}], "]"}], ",", "Gray"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"datalist", "=", RowBox[{"{", RowBox[{ "ptA", ",", "ptB", ",", "ptC", ",", "ptD", ",", "ptE", ",", "ptF"}], "}"}]}], ";", "\[IndentingNewLine]", RowBox[{"points", "=", RowBox[{"Graphics", "[", RowBox[{"{", RowBox[{ RowBox[{"PointSize", "[", "0.03", "]"}], ",", RowBox[{"{", RowBox[{ RowBox[{"RGBColor", "[", RowBox[{".9", ",", ".42", ",", ".17"}], "]"}], ",", RowBox[{"Point", "[", "ptA", "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"RGBColor", "[", RowBox[{".9", ",", ".42", ",", ".17"}], "]"}], ",", RowBox[{"Point", "[", "ptB", "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"clr", "[", "cc", "]"}], ",", RowBox[{"Point", "[", "ptC", "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"clr", "[", "dd", "]"}], ",", RowBox[{"Point", "[", "ptD", "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"clr", "[", "ee", "]"}], ",", RowBox[{"Point", "[", "ptE", "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"clr", "[", "ff", "]"}], ",", RowBox[{"Point", "[", "ptF", "]"}]}], "}"}]}], "}"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"labels", "=", RowBox[{"Graphics", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{"Text", "[", RowBox[{ RowBox[{"Style", "[", RowBox[{ RowBox[{ RowBox[{"CharacterRange", "[", RowBox[{"\"\\"", ",", "\"\\""}], "]"}], "[", RowBox[{"[", "i", "]"}], "]"}], ",", "Bold", ",", "\"\\"", ",", "14"}], "]"}], ",", RowBox[{ RowBox[{"datalist", "[", RowBox[{"[", "i", "]"}], "]"}], "+", RowBox[{"{", RowBox[{"0.45", ",", "0"}], "}"}]}]}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{"Length", "[", "datalist", "]"}]}], "}"}]}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"adjustedlist", "=", RowBox[{"DeleteCases", "[", RowBox[{ RowBox[{"{", RowBox[{"ptA", ",", "ptB", ",", RowBox[{"If", "[", RowBox[{ RowBox[{"MemberQ", "[", RowBox[{"includepts", ",", "cc"}], "]"}], ",", "ptC", ",", RowBox[{"{", "}"}]}], "]"}], ",", RowBox[{"If", "[", RowBox[{ RowBox[{"MemberQ", "[", RowBox[{"includepts", ",", "dd"}], "]"}], ",", "ptD", ",", RowBox[{"{", "}"}]}], "]"}], ",", RowBox[{"If", "[", RowBox[{ RowBox[{"MemberQ", "[", RowBox[{"includepts", ",", "ee"}], "]"}], ",", "ptE", ",", RowBox[{"{", "}"}]}], "]"}], ",", RowBox[{"If", "[", RowBox[{ RowBox[{"MemberQ", "[", RowBox[{"includepts", ",", "ff"}], "]"}], ",", "ptF", ",", RowBox[{"{", "}"}]}], "]"}]}], "}"}], ",", RowBox[{"{", "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"fitline", "=", RowBox[{"Fit", "[", RowBox[{"adjustedlist", ",", RowBox[{"{", RowBox[{"1", ",", "x"}], "}"}], ",", "x"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"lineplot", "=", RowBox[{"Plot", "[", RowBox[{"fitline", ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "5"}], ",", "5"}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"Deploy", "[", RowBox[{"Show", "[", RowBox[{"lineplot", ",", "points", ",", "labels", ",", RowBox[{"PlotRange", "\[Rule]", "5"}], ",", RowBox[{"AspectRatio", "\[Rule]", "Automatic"}], ",", RowBox[{"ImageSize", "\[Rule]", "300"}], ",", RowBox[{"BaseStyle", "\[Rule]", RowBox[{"{", "12", "}"}]}], ",", RowBox[{"GridLines", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{"n", " ", ",", RowBox[{"Lighter", "[", RowBox[{"Gray", ",", "0.7"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"n", ",", RowBox[{"-", "7"}], ",", "7", ",", "1"}], "}"}]}], "]"}], ",", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{"n", ",", RowBox[{"Lighter", "[", RowBox[{"Gray", ",", "0.7"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"n", ",", RowBox[{"-", "7"}], ",", "7", ",", "1"}], "}"}]}], "]"}]}], "}"}]}], ",", RowBox[{"AxesOrigin", "\[Rule]", RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}]}]}], "]"}], "]"}]}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"ptA", ",", RowBox[{"{", RowBox[{"1", ",", "2"}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "5"}], ",", RowBox[{"-", "5"}]}], "}"}], ",", RowBox[{"{", RowBox[{"5", ",", "5"}], "}"}], ",", "Locator", ",", RowBox[{"Appearance", "\[Rule]", RowBox[{"Style", "[", RowBox[{"\"\<\[FilledCircle]\>\"", ",", RowBox[{"Opacity", "[", "0", "]"}], ",", "1"}], "]"}]}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"ptB", ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", RowBox[{"-", "3"}]}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "5"}], ",", RowBox[{"-", "5"}]}], "}"}], ",", RowBox[{"{", RowBox[{"5", ",", "5"}], "}"}], ",", "Locator"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"ptC", ",", RowBox[{"{", RowBox[{"4", ",", "5"}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "5"}], ",", RowBox[{"-", "5"}]}], "}"}], ",", RowBox[{"{", RowBox[{"5", ",", "5"}], "}"}], ",", "Locator"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"ptD", ",", RowBox[{"{", RowBox[{"1", ",", "1"}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "5"}], ",", RowBox[{"-", "5"}]}], "}"}], ",", RowBox[{"{", RowBox[{"5", ",", "5"}], "}"}], ",", "Locator"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"ptE", ",", RowBox[{"{", RowBox[{ RowBox[{"-", "2"}], ",", RowBox[{"-", "4"}]}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "5"}], ",", RowBox[{"-", "5"}]}], "}"}], ",", RowBox[{"{", RowBox[{"5", ",", "5"}], "}"}], ",", "Locator"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"ptF", ",", RowBox[{"{", RowBox[{"0", ",", RowBox[{"-", "1"}]}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "5"}], ",", RowBox[{"-", "5"}]}], "}"}], ",", RowBox[{"{", RowBox[{"5", ",", "5"}], "}"}], ",", "Locator"}], "}"}], ",", "\[IndentingNewLine]", "\"\\"", ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"includepts", ",", RowBox[{"{", RowBox[{"cc", ",", "dd", ",", "ee", ",", "ff"}], "}"}], ",", "\"\<\>\""}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"cc", "\[Rule]", "\"\< C\>\""}], ",", RowBox[{"dd", "\[Rule]", "\"\< D\>\""}], ",", RowBox[{"ee", "\[Rule]", "\"\< E\>\""}], ",", RowBox[{"ff", "\[Rule]", "\"\< F\>\""}]}], "}"}], ",", RowBox[{"ControlType", "\[Rule]", "CheckboxBar"}], ",", RowBox[{"Appearance", "\[Rule]", "\"\\""}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"ControlPlacement", "\[Rule]", "Right"}], ",", RowBox[{"TrackedSymbols", "\[RuleDelayed]", RowBox[{"{", RowBox[{ "ptA", ",", "ptB", ",", "ptC", ",", "ptD", ",", "ptE", ",", "ptF", ",", "includepts"}], "}"}]}]}], "\[IndentingNewLine]", "]"}]], "Input", CellChangeTimes->{ 3.35757176568782*^9, 3.36855704150822*^9, {3.36926480609112*^9, 3.36926480829429*^9}, 3.373836757683876*^9, {3.379168233919354*^9, 3.379168238966612*^9}, {3.379268811303317*^9, 3.3792688273964577`*^9}, { 3.3792688720606813`*^9, 3.3792688874428*^9}, {3.384188041443163*^9, 3.384188045929614*^9}, {3.3907407264921637`*^9, 3.390740729463767*^9}}, CellID->1496021318] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ TagBox[ StyleBox[ DynamicModuleBox[{$CellContext`includepts$$ = {$CellContext`cc, \ $CellContext`dd, $CellContext`ee, $CellContext`ff}, $CellContext`ptA$$ = {1, 2}, $CellContext`ptB$$ = {-1, -3}, $CellContext`ptC$$ = {4, 5}, $CellContext`ptD$$ = {1, 1}, $CellContext`ptE$$ = {-2, -4}, $CellContext`ptF$$ = {0, -1}, Typeset`show$$ = True, Typeset`bookmarkList$$ = {}, Typeset`bookmarkMode$$ = "Menu", Typeset`animator$$, Typeset`animvar$$ = 1, Typeset`name$$ = "\"untitled\"", Typeset`specs$$ = {{{ Hold[$CellContext`ptA$$], {1, 2}}, {-5, -5}, {5, 5}}, {{ Hold[$CellContext`ptB$$], {-1, -3}}, {-5, -5}, {5, 5}}, {{ Hold[$CellContext`ptC$$], {4, 5}}, {-5, -5}, {5, 5}}, {{ Hold[$CellContext`ptD$$], {1, 1}}, {-5, -5}, {5, 5}}, {{ Hold[$CellContext`ptE$$], {-2, -4}}, {-5, -5}, {5, 5}}, {{ Hold[$CellContext`ptF$$], {0, -1}}, {-5, -5}, {5, 5}}, { Hold["include"], Manipulate`Dump`ThisIsNotAControl}, {{ Hold[$CellContext`includepts$$], {$CellContext`cc, $CellContext`dd, \ $CellContext`ee, $CellContext`ff}, ""}, {$CellContext`cc -> " C", $CellContext`dd -> " D", $CellContext`ee -> " E", $CellContext`ff -> " F"}}}, Typeset`size$$ = { 300., {147., 153.}}, Typeset`update$$ = 0, Typeset`initDone$$, Typeset`skipInitDone$$ = True, $CellContext`ptA$55489$$ = {0, 0}, $CellContext`ptB$55490$$ = {0, 0}, $CellContext`ptC$55491$$ = {0, 0}, $CellContext`ptD$55492$$ = {0, 0}, $CellContext`ptE$55493$$ = {0, 0}, $CellContext`includepts$55494$$ = False}, DynamicBox[Manipulate`ManipulateBoxes[ 1, StandardForm, "Variables" :> {$CellContext`includepts$$ = {$CellContext`cc, \ $CellContext`dd, $CellContext`ee, $CellContext`ff}, $CellContext`ptA$$ = {1, 2}, $CellContext`ptB$$ = {-1, -3}, $CellContext`ptC$$ = {4, 5}, $CellContext`ptD$$ = {1, 1}, $CellContext`ptE$$ = {-2, -4}, $CellContext`ptF$$ = {0, -1}}, "ControllerVariables" :> { Hold[$CellContext`ptA$$, $CellContext`ptA$55489$$, {0, 0}], Hold[$CellContext`ptB$$, $CellContext`ptB$55490$$, {0, 0}], Hold[$CellContext`ptC$$, $CellContext`ptC$55491$$, {0, 0}], Hold[$CellContext`ptD$$, $CellContext`ptD$55492$$, {0, 0}], Hold[$CellContext`ptE$$, $CellContext`ptE$55493$$, {0, 0}], Hold[$CellContext`includepts$$, $CellContext`includepts$55494$$, False]}, "OtherVariables" :> { Typeset`show$$, Typeset`bookmarkList$$, Typeset`bookmarkMode$$, Typeset`animator$$, Typeset`animvar$$, Typeset`name$$, Typeset`specs$$, Typeset`size$$, Typeset`update$$, Typeset`initDone$$, Typeset`skipInitDone$$}, "Body" :> ($CellContext`clr[ Pattern[$CellContext`test$, Blank[]]] := If[ MemberQ[$CellContext`includepts$$, $CellContext`test$], RGBColor[0.9, 0.42, 0.17], Gray]; $CellContext`datalist = {$CellContext`ptA$$, \ $CellContext`ptB$$, $CellContext`ptC$$, $CellContext`ptD$$, \ $CellContext`ptE$$, $CellContext`ptF$$}; $CellContext`points = Graphics[{ PointSize[0.03], { RGBColor[0.9, 0.42, 0.17], Point[$CellContext`ptA$$]}, { RGBColor[0.9, 0.42, 0.17], Point[$CellContext`ptB$$]}, { $CellContext`clr[$CellContext`cc], Point[$CellContext`ptC$$]}, { $CellContext`clr[$CellContext`dd], Point[$CellContext`ptD$$]}, { $CellContext`clr[$CellContext`ee], Point[$CellContext`ptE$$]}, { $CellContext`clr[$CellContext`ff], Point[$CellContext`ptF$$]}}]; $CellContext`labels = Graphics[ Table[ Text[ Style[ Part[ CharacterRange["A", "F"], $CellContext`i], Bold, "Label", 14], Part[$CellContext`datalist, $CellContext`i] + { 0.45, 0}], {$CellContext`i, 1, Length[$CellContext`datalist]}]]; $CellContext`adjustedlist = DeleteCases[{$CellContext`ptA$$, $CellContext`ptB$$, If[ MemberQ[$CellContext`includepts$$, $CellContext`cc], \ $CellContext`ptC$$, {}], If[ MemberQ[$CellContext`includepts$$, $CellContext`dd], \ $CellContext`ptD$$, {}], If[ MemberQ[$CellContext`includepts$$, $CellContext`ee], \ $CellContext`ptE$$, {}], If[ MemberQ[$CellContext`includepts$$, $CellContext`ff], \ $CellContext`ptF$$, {}]}, {}]; $CellContext`fitline = Fit[$CellContext`adjustedlist, { 1, $CellContext`x}, $CellContext`x]; $CellContext`lineplot = Plot[$CellContext`fitline, {$CellContext`x, -5, 5}]; Deploy[ Show[$CellContext`lineplot, $CellContext`points, $CellContext`labels, PlotRange -> 5, AspectRatio -> Automatic, ImageSize -> 300, BaseStyle -> {12}, GridLines -> { Table[{$CellContext`n, Lighter[Gray, 0.7]}, {$CellContext`n, -7, 7, 1}], Table[{$CellContext`n, Lighter[Gray, 0.7]}, {$CellContext`n, -7, 7, 1}]}, AxesOrigin -> {0, 0}]]), "Specifications" :> {{{$CellContext`ptA$$, {1, 2}}, {-5, -5}, {5, 5}, ControlType -> Locator, Appearance -> Style["\[FilledCircle]", Opacity[0], 1]}, {{$CellContext`ptB$$, {-1, -3}}, {-5, -5}, {5, 5}, ControlType -> Locator}, {{$CellContext`ptC$$, {4, 5}}, {-5, -5}, { 5, 5}, ControlType -> Locator}, {{$CellContext`ptD$$, {1, 1}}, {-5, -5}, {5, 5}, ControlType -> Locator}, {{$CellContext`ptE$$, {-2, -4}}, {-5, -5}, { 5, 5}, ControlType -> Locator}, {{$CellContext`ptF$$, {0, -1}}, {-5, -5}, {5, 5}, ControlType -> Locator}, "include", {{$CellContext`includepts$$, {$CellContext`cc, \ $CellContext`dd, $CellContext`ee, $CellContext`ff}, ""}, {$CellContext`cc -> " C", $CellContext`dd -> " D", $CellContext`ee -> " E", $CellContext`ff -> " F"}, ControlType -> CheckboxBar, Appearance -> "Vertical"}}, "Options" :> { ControlPlacement -> Right, TrackedSymbols :> {$CellContext`ptA$$, $CellContext`ptB$$, \ $CellContext`ptC$$, $CellContext`ptD$$, $CellContext`ptE$$, \ $CellContext`ptF$$, $CellContext`includepts$$}}, "DefaultOptions" :> {ControllerLinking -> True}], ImageSizeCache->{386., {179., 184.}}, SingleEvaluation->True], Deinitialization:>None, DynamicModuleValues:>{}, SynchronousInitialization->True, UnsavedVariables:>{Typeset`initDone$$}, UntrackedVariables:>{Typeset`size$$}], "Manipulate", Deployed->True, StripOnInput->False], Manipulate`InterpretManipulate[1]]], "Output", CellID->44408767], Cell[CellGroupData[{ Cell["CAPTION", "Section", CellFrame->{{0, 0}, {1, 0}}, CellFrameColor->RGBColor[0.87, 0.87, 0.87], FontFamily->"Helvetica", FontSize->12, FontWeight->"Bold", FontColor->RGBColor[0.597406, 0, 0.0527047]], Cell["\<\ Move the points and see how the line fits those points. You can exclude \ points from the best-fit calculation by unchecking the appropriate boxes.\ \>", "Text"] }, Close]] }, Open ]], Cell[CellGroupData[{ Cell["THIS NOTEBOOK IS THE SOURCE CODE FROM", "Text", CellFrame->{{0, 0}, {0, 0}}, CellMargins->{{48, 10}, {4, 28}}, CellGroupingRules->{"SectionGrouping", 25}, CellFrameMargins->{{48, 48}, {6, 5}}, CellFrameColor->RGBColor[0.87, 0.87, 0.87], FontFamily->"Helvetica", FontSize->10, FontWeight->"Bold", FontColor->RGBColor[0.597406, 0, 0.0527047]], Cell[TextData[{ "\"", ButtonBox["Simple Best-Fit Line", BaseStyle->"Hyperlink", ButtonData->{ URL["http://demonstrations.wolfram.com/SimpleBestFitLine/"], None}, ButtonNote->"http://demonstrations.wolfram.com/SimpleBestFitLine/"], "\"", " from ", ButtonBox["the Wolfram Demonstrations Project", BaseStyle->"Hyperlink", ButtonData->{ URL["http://demonstrations.wolfram.com/"], None}, ButtonNote->"http://demonstrations.wolfram.com/"], "\[ParagraphSeparator]\[NonBreakingSpace]", ButtonBox["http://demonstrations.wolfram.com/SimpleBestFitLine/", BaseStyle->"Hyperlink", ButtonData->{ URL["http://demonstrations.wolfram.com/SimpleBestFitLine/"], None}, ButtonNote->"http://demonstrations.wolfram.com/SimpleBestFitLine/"] }], "Text", CellMargins->{{48, Inherited}, {0, Inherited}}, FontFamily->"Verdana", FontSize->10, FontColor->GrayLevel[0.5]], Cell[TextData[{ "Contributed by: ", ButtonBox["Abby Brown", BaseStyle->"Hyperlink", ButtonData->{ URL["http://demonstrations.wolfram.com/author.html?author=Abby+Brown"], None}] }], "Text", CellDingbat->"\[FilledSmallSquare]", CellMargins->{{66, 48}, {2, 4}}, FontFamily->"Verdana", FontSize->10, FontColor->GrayLevel[0.6], CellID->408570679], Cell[CellGroupData[{ Cell[TextData[{ "A full-function Wolfram ", StyleBox["Mathematica", FontSlant->"Italic"], " system (Version 6 or higher) is required to edit this notebook.\n", StyleBox[ButtonBox["GET WOLFRAM MATHEMATICA \[RightGuillemet]", BaseStyle->"Hyperlink", ButtonData->{ URL["http://www.wolfram.com/products/mathematica/"], None}, ButtonNote->"http://www.wolfram.com/products/mathematica/"], FontFamily->"Helvetica", FontWeight->"Bold", FontSlant->"Italic", FontColor->RGBColor[1, 0.42, 0]] }], "Text", CellFrame->True, CellMargins->{{48, 68}, {8, 28}}, CellFrameMargins->12, CellFrameColor->RGBColor[0.87, 0.87, 0.87], CellChangeTimes->{3.3750111182355957`*^9}, ParagraphSpacing->{1., 1.}, FontFamily->"Verdana", FontSize->10, FontColor->GrayLevel[0.411765], Background->RGBColor[1, 1, 1]], Cell[TextData[{ "\[Copyright] ", StyleBox[ButtonBox["Wolfram Demonstrations Project & Contributors", BaseStyle->"Hyperlink", ButtonData->{ URL["http://demonstrations.wolfram.com/"], None}, ButtonNote->"http://demonstrations.wolfram.com/"], FontColor->GrayLevel[0.6]], "\[ThickSpace]\[ThickSpace]\[ThickSpace]|\[ThickSpace]\[ThickSpace]\ \[ThickSpace]", StyleBox[ButtonBox["Terms of Use", BaseStyle->"Hyperlink", ButtonData->{ URL["http://demonstrations.wolfram.com/termsofuse.html"], None}, ButtonNote->"http://demonstrations.wolfram.com/termsofuse.html"], FontColor->GrayLevel[0.6]], "\[ThickSpace]\[ThickSpace]\[ThickSpace]|\[ThickSpace]\[ThickSpace]\ \[ThickSpace]", StyleBox[ButtonBox["Make a new version of this Demonstration \ \[RightGuillemet]", BaseStyle->"Hyperlink", ButtonData->{ URL["http://demonstrations.wolfram.com/participate/upload.jsp?id=\ SimpleBestFitLine"], None}, ButtonNote->None], FontColor->GrayLevel[0.6]] }], "Text", CellFrame->{{0, 0}, {0, 0.5}}, CellMargins->{{48, 10}, {20, 50}}, CellFrameMargins->{{6, 0}, {6, 6}}, CellFrameColor->GrayLevel[0.6], FontFamily->"Verdana", FontSize->9, FontColor->GrayLevel[0.6]] }, Open ]] }, Open ]] }, Editable->True, Saveable->False, ScreenStyleEnvironment->"Working", CellInsertionPointCell->None, WindowSize->{710, 650}, WindowMargins->{{Inherited, Inherited}, {Inherited, 0}}, WindowElements->{ "StatusArea", "MemoryMonitor", "MagnificationPopUp", "VerticalScrollBar", "MenuBar"}, WindowTitle->"Simple Best-Fit Line - Source", DockedCells->{}, CellContext->Notebook, FrontEndVersion->"8.0 for Microsoft Windows (32-bit) (November 7, 2010)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[622, 23, 140, 3, 70, "Section"], Cell[765, 28, 3700, 64, 70, "Section"], Cell[4468, 94, 9337, 257, 70, "Input", CellID->1496021318] }, Open ]], Cell[CellGroupData[{ Cell[13842, 356, 6857, 134, 70, "Output", CellID->44408767], Cell[CellGroupData[{ Cell[20724, 494, 209, 6, 70, "Section"], Cell[20936, 502, 171, 3, 70, "Text"] }, Close]] }, Open ]], Cell[CellGroupData[{ Cell[21155, 511, 355, 9, 70, "Text", CellGroupingRules->{"SectionGrouping", 25}], Cell[21513, 522, 882, 24, 70, "Text"], Cell[22398, 548, 362, 13, 70, "Text", CellID->408570679], Cell[CellGroupData[{ Cell[22785, 565, 815, 24, 70, "Text"], Cell[23603, 591, 1189, 33, 70, "Text"] }, Open ]] }, Open ]] } ] *) (* End of internal cache information *) (* NotebookSignature RRNNDMaNsjywBD0VlNidV1zi *)