Cell[CellGroupData[{Cell[BoxData[ RowBox[{"Manipulate", "[", " ", RowBox[{ RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{ "DegenerateTriangle", ",", "NoneCoincide", ",", "anglea", ",", "angleb", ",", "anglec", ",", "pt123", ",", "pt213", ",", "pt312", ",", RowBox[{"m12", "=", RowBox[{"Mean", "[", RowBox[{"{", RowBox[{"pt1", ",", "pt2"}], "}"}], "]"}]}], ",", RowBox[{"m13", "=", RowBox[{"Mean", "[", RowBox[{"{", RowBox[{"pt1", ",", "pt3"}], "}"}], "]"}]}], ",", RowBox[{"r", "=", RowBox[{ RowBox[{"u", " ", "pt2"}], "+", RowBox[{ RowBox[{"(", RowBox[{"1", "-", "u"}], ")"}], "pt1"}]}]}], ",", RowBox[{"s", "=", RowBox[{ RowBox[{"v", " ", "pt3"}], "+", RowBox[{ RowBox[{"(", RowBox[{"1", "-", "v"}], ")"}], "pt2"}]}]}], ",", RowBox[{"t", "=", RowBox[{ RowBox[{"w", " ", "pt3"}], "+", RowBox[{ RowBox[{"(", RowBox[{"1", "-", "w"}], ")"}], "pt1"}]}]}], ",", "AcuteTriangle"}], "}"}], ",", RowBox[{ RowBox[{"DegenerateTriangle", "=", RowBox[{ RowBox[{"AreaOfTriangle", "[", RowBox[{"pt1", ",", "pt2", ",", "pt3"}], "]"}], "<", SuperscriptBox["10", RowBox[{"-", "5"}]]}]}], ";", RowBox[{"NoneCoincide", "=", RowBox[{ RowBox[{"Length", "@", RowBox[{"Union", "[", RowBox[{ RowBox[{"{", RowBox[{"pt1", ",", "pt2", ",", "pt3"}], "}"}], ",", RowBox[{"SameTest", "->", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"EuclideanDistance", "[", RowBox[{"#1", ",", "#2"}], "]"}], "<", SuperscriptBox["10", RowBox[{"-", "5"}]]}], "&"}], ")"}]}]}], "]"}]}], "===", "3"}]}], ";", RowBox[{"If", "[", RowBox[{ RowBox[{"NoneCoincide", "&&", RowBox[{"Not", "@", "DegenerateTriangle"}]}], ",", RowBox[{ RowBox[{"pt123", "=", RowBox[{"CorrespondingAltitudePoint", "[", RowBox[{"pt1", ",", "pt2", ",", "pt3"}], "]"}]}], ";", RowBox[{"pt213", "=", RowBox[{"CorrespondingAltitudePoint", "[", RowBox[{"pt2", ",", "pt1", ",", "pt3"}], "]"}]}], ";", RowBox[{"pt312", "=", RowBox[{"CorrespondingAltitudePoint", "[", RowBox[{"pt3", ",", "pt1", ",", "pt2"}], "]"}]}], ";", RowBox[{"anglea", "=", RowBox[{"VectorAngle", "[", RowBox[{ RowBox[{"pt2", "-", "pt1"}], ",", RowBox[{"pt3", "-", "pt1"}]}], "]"}]}], ";", RowBox[{"angleb", "=", RowBox[{"VectorAngle", "[", RowBox[{ RowBox[{"pt1", "-", "pt2"}], ",", RowBox[{"pt3", "-", "pt2"}]}], "]"}]}], ";", RowBox[{"anglec", "=", RowBox[{"VectorAngle", "[", RowBox[{ RowBox[{"pt1", "-", "pt3"}], ",", RowBox[{"pt2", "-", "pt3"}]}], "]"}]}], ";", RowBox[{"AcuteTriangle", "=", RowBox[{ RowBox[{"anglea", "<", FractionBox["\[Pi]", "2"]}], "&&", RowBox[{"angleb", "<", FractionBox["\[Pi]", "2"]}], "&&", RowBox[{"anglec", "<", FractionBox["\[Pi]", "2"]}]}]}]}]}], "]"}], ";", RowBox[{"Grid", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"Pane", "[", RowBox[{ RowBox[{"Style", "[", RowBox[{ RowBox[{"Which", "[", RowBox[{ RowBox[{ RowBox[{"Not", "@", "NoneCoincide"}], "||", "DegenerateTriangle"}], ",", RowBox[{ "Framed", "[", "\"\\"", "]"}], ",", RowBox[{"Not", "@", "AcuteTriangle"}], ",", RowBox[{ "Framed", "[", "\"\\"", "]"}], ",", "True", ",", RowBox[{"Grid", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"Grid", "[", RowBox[{ RowBox[{"{", RowBox[{"{", RowBox[{ "\"\\"", ",", "\"\<~~\>\"", ",", RowBox[{"NumberForm", "[", RowBox[{ RowBox[{"EuclideanDistance", "[", RowBox[{"pt123", ",", "pt213"}], "]"}], " ", ",", RowBox[{"{", RowBox[{"5", ",", "2"}], "}"}]}], "]"}], ",", "\"\\"", ",", "\"\<~~\>\"", ",", RowBox[{"NumberForm", "[", RowBox[{ RowBox[{"EuclideanDistance", "[", RowBox[{"pt213", ",", "pt312"}], "]"}], ",", RowBox[{"{", RowBox[{"5", ",", "2"}], "}"}]}], "]"}], ",", "\"\\"", ",", "\"\<~~\>\"", ",", RowBox[{"NumberForm", "[", RowBox[{ RowBox[{"EuclideanDistance", "[", RowBox[{"pt123", ",", "pt312"}], "]"}], ",", RowBox[{"{", RowBox[{"5", ",", "2"}], "}"}]}], "]"}]}], "}"}], "}"}], ",", RowBox[{"Dividers", "->", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ "True", ",", "False", ",", "False", ",", "True", ",", "False", ",", "False", ",", "True", ",", "False", ",", "False", ",", "True"}], "}"}], ",", "All"}], "}"}]}], ",", RowBox[{"Spacings", "->", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"1", "->", "1"}], ",", RowBox[{"2", "->", ".2"}], ",", RowBox[{"3", "->", ".2"}], ",", RowBox[{"4", "->", "1"}], ",", RowBox[{"5", "->", ".2"}], ",", RowBox[{"6", "->", ".2"}], ",", RowBox[{"7", "->", "1"}], ",", RowBox[{"8", "->", ".2"}], ",", RowBox[{"9", "->", ".2"}], ",", RowBox[{"10", "->", "1"}]}], "}"}], ",", "Automatic"}], "}"}]}]}], "]"}], "}"}], ",", "\n", RowBox[{"{", RowBox[{"Grid", "[", RowBox[{ RowBox[{"{", RowBox[{"{", RowBox[{ "\"\\"", ",", "\"\<~~\>\"", ",", RowBox[{"NumberForm", "[", RowBox[{ RowBox[{"EuclideanDistance", "[", RowBox[{"r", ",", "s"}], "]"}], " ", ",", RowBox[{"{", RowBox[{"5", ",", "2"}], "}"}]}], "]"}], ",", "\"\\"", ",", "\"\<~~\>\"", ",", RowBox[{"NumberForm", "[", RowBox[{ RowBox[{"EuclideanDistance", "[", RowBox[{"s", ",", "t"}], "]"}], ",", RowBox[{"{", RowBox[{"5", ",", "2"}], "}"}]}], "]"}], ",", "\"\\"", ",", "\"\<~~\>\"", ",", RowBox[{"NumberForm", "[", RowBox[{ RowBox[{"EuclideanDistance", "[", RowBox[{"r", ",", "t"}], "]"}], ",", RowBox[{"{", RowBox[{"5", ",", "2"}], "}"}]}], "]"}]}], "}"}], "}"}], ",", RowBox[{"Dividers", "->", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ "True", ",", "False", ",", "False", ",", "True", ",", "False", ",", "False", ",", "True", ",", "False", ",", "False", ",", "True"}], "}"}], ",", "All"}], "}"}]}], ",", RowBox[{"Spacings", "->", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"1", "->", "1"}], ",", RowBox[{"2", "->", ".2"}], ",", RowBox[{"3", "->", ".2"}], ",", RowBox[{"4", "->", "1"}], ",", RowBox[{"5", "->", ".2"}], ",", RowBox[{"6", "->", ".2"}], ",", RowBox[{"7", "->", "1"}], ",", RowBox[{"8", "->", ".2"}], ",", RowBox[{"9", "->", ".2"}], ",", RowBox[{"10", "->", "1"}]}], "}"}], ",", "Automatic"}], "}"}]}]}], "]"}], "}"}], ",", RowBox[{"{", RowBox[{"Grid", "[", RowBox[{ RowBox[{"{", RowBox[{"{", RowBox[{ "\"\\"", ",", "\"\<~~\>\"", ",", RowBox[{"NumberForm", "[", RowBox[{ RowBox[{ RowBox[{"EuclideanDistance", "[", RowBox[{"pt123", ",", "pt213"}], "]"}], "+", " ", RowBox[{"EuclideanDistance", "[", RowBox[{"pt213", ",", "pt312"}], "]"}], "+", RowBox[{"EuclideanDistance", "[", RowBox[{"pt123", ",", "pt312"}], "]"}]}], ",", RowBox[{"{", RowBox[{"5", ",", "2"}], "}"}]}], "]"}], ",", "\"\\"", ",", "\"\<~~\>\"", ",", RowBox[{"NumberForm", "[", RowBox[{ RowBox[{ RowBox[{"EuclideanDistance", "[", RowBox[{"r", ",", "s"}], "]"}], "+", " ", RowBox[{"EuclideanDistance", "[", RowBox[{"s", ",", "t"}], "]"}], "+", RowBox[{"EuclideanDistance", "[", RowBox[{"r", ",", "t"}], "]"}]}], ",", RowBox[{"{", RowBox[{"5", ",", "2"}], "}"}]}], "]"}]}], "}"}], "}"}], ",", RowBox[{"Dividers", "->", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ "True", ",", "False", ",", "False", ",", "True", ",", "False", ",", "False", ",", "True"}], "}"}], ",", "All"}], "}"}]}], ",", RowBox[{"Spacings", "->", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"1", "->", "1"}], ",", RowBox[{"2", "->", ".2"}], ",", RowBox[{"3", "->", ".2"}], ",", RowBox[{"4", "->", "1"}], ",", RowBox[{"5", "->", ".2"}], ",", RowBox[{"6", "->", ".2"}], ",", RowBox[{"7", "->", "1"}]}], "}"}], ",", "Automatic"}], "}"}]}]}], "]"}], "}"}]}], "}"}], "]"}]}], "]"}], ",", "14", ",", "\"\\""}], "]"}], ",", RowBox[{"ImageSize", "->", RowBox[{"{", RowBox[{"430", ",", "100"}], "}"}]}], ",", RowBox[{"Alignment", "->", RowBox[{"{", RowBox[{"Center", ",", "Center"}], "}"}]}]}], "]"}], "}"}], ",", RowBox[{"{", RowBox[{"Graphics", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"Thickness", "[", ".015", "]"}], ",", RowBox[{"RGBColor", "[", RowBox[{".33", ",", ".26", ",", ".78"}], "]"}], ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{"pt1", ",", "pt2", ",", "pt3", ",", "pt1"}], "}"}], "]"}], ",", RowBox[{"PointSize", "[", ".035", "]"}], ",", RowBox[{"If", "[", RowBox[{ RowBox[{ "f", "&&", "NoneCoincide", "&&", "AcuteTriangle", "&&", RowBox[{"Not", "@", "DegenerateTriangle"}]}], ",", RowBox[{"Unevaluated", "[", RowBox[{"Sequence", "[", RowBox[{ RowBox[{"Thickness", "[", ".01", "]"}], ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{"pt1", ",", "pt123"}], "}"}], "]"}], ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{"pt2", ",", "pt213"}], "}"}], "]"}], ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{"pt3", ",", "pt312"}], "}"}], "]"}]}], "]"}], "]"}], ",", RowBox[{"{", "}"}]}], "]"}], ",", RowBox[{"RGBColor", "[", RowBox[{"1", ",", ".26", ",", "0"}], "]"}], ",", RowBox[{"Thickness", "[", ".015", "]"}], ",", RowBox[{"If", "[", RowBox[{ RowBox[{ "NoneCoincide", "&&", "AcuteTriangle", "&&", RowBox[{"Not", "@", "DegenerateTriangle"}]}], ",", RowBox[{"Unevaluated", "[", RowBox[{"Sequence", "[", RowBox[{ RowBox[{"Point", "[", RowBox[{"{", RowBox[{"pt123", ",", "pt213", ",", "pt312"}], "}"}], "]"}], ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ "pt312", ",", "pt213", ",", "pt123", ",", "pt312"}], "}"}], "]"}]}], "]"}], "]"}], ",", RowBox[{"{", "}"}]}], "]"}], ",", RowBox[{"RGBColor", "[", RowBox[{".45", ",", ".7", ",", ".55"}], "]"}], ",", RowBox[{"Point", "[", RowBox[{"{", RowBox[{"r", ",", "s", ",", "t"}], "}"}], "]"}], ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{"r", ",", "s", ",", "t", ",", "r"}], "}"}], "]"}], ",", "Black", ",", RowBox[{"Text", "[", RowBox[{ RowBox[{"Style", "[", RowBox[{ "\"\\"", ",", "20", ",", "\"\\""}], "]"}], ",", RowBox[{"r", "+", RowBox[{"{", RowBox[{"0", ",", ".9"}], "}"}]}]}], "]"}], ",", RowBox[{"Text", "[", RowBox[{ RowBox[{"Style", "[", RowBox[{ "\"\\"", ",", "20", ",", "\"\\""}], "]"}], ",", RowBox[{"s", "+", RowBox[{"{", RowBox[{"0", ",", ".9"}], "}"}]}]}], "]"}], ",", RowBox[{"Text", "[", RowBox[{ RowBox[{"Style", "[", RowBox[{ "\"\\"", ",", "20", ",", "\"\\""}], "]"}], ",", RowBox[{"t", "+", RowBox[{"{", RowBox[{"0", ",", ".9"}], "}"}]}]}], "]"}], ",", RowBox[{"Text", "[", RowBox[{ RowBox[{"Style", "[", RowBox[{ "\"\\"", ",", "20", ",", "\"\\""}], "]"}], ",", RowBox[{"pt1", "+", RowBox[{"{", RowBox[{"0", ",", ".9"}], "}"}]}]}], "]"}], ",", RowBox[{"Text", "[", RowBox[{ RowBox[{"Style", "[", RowBox[{ "\"\\"", ",", "20", ",", "\"\\""}], "]"}], ",", RowBox[{"pt2", "+", RowBox[{"{", RowBox[{"0", ",", ".9"}], "}"}]}]}], "]"}], ",", RowBox[{"Text", "[", RowBox[{ RowBox[{"Style", "[", RowBox[{ "\"\\"", ",", "20", ",", "\"\\""}], "]"}], ",", RowBox[{"pt3", "+", RowBox[{"{", RowBox[{"0", ",", ".9"}], "}"}]}]}], "]"}], ",", RowBox[{"If", "[", RowBox[{ RowBox[{ "NoneCoincide", "&&", "AcuteTriangle", "&&", RowBox[{"Not", "@", "DegenerateTriangle"}]}], ",", RowBox[{"Unevaluated", "[", RowBox[{"Sequence", "[", RowBox[{ RowBox[{"Text", "[", RowBox[{ RowBox[{"Style", "[", RowBox[{ "\"\\"", ",", "20", ",", "\"\\""}], "]"}], ",", RowBox[{"pt123", "+", RowBox[{"{", RowBox[{"0", ",", ".9"}], "}"}]}]}], "]"}], ",", RowBox[{"Text", "[", RowBox[{ RowBox[{"Style", "[", RowBox[{ "\"\\"", ",", "20", ",", "\"\\""}], "]"}], ",", RowBox[{"pt213", "+", RowBox[{"{", RowBox[{"0", ",", ".9"}], "}"}]}]}], "]"}], ",", RowBox[{"Text", "[", RowBox[{ RowBox[{"Style", "[", RowBox[{ "\"\\"", ",", "20", ",", "\"\\""}], "]"}], ",", RowBox[{"pt312", "+", RowBox[{"{", RowBox[{"0", ",", ".9"}], "}"}]}]}], "]"}]}], "]"}], "]"}], ",", RowBox[{"{", "}"}]}], "]"}]}], "}"}], ",", RowBox[{"ImageSize", "->", RowBox[{"{", RowBox[{"355", ",", "325"}], "}"}]}], ",", RowBox[{"PlotRange", "->", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "9"}], ",", "9"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "9"}], ",", "9"}], "}"}]}], "}"}]}]}], "]"}], "}"}]}], "}"}], ",", RowBox[{"ItemSize", "->", RowBox[{"{", RowBox[{"35", ",", RowBox[{"{", RowBox[{"8", ",", "Automatic"}], "}"}]}], "}"}]}], ",", RowBox[{"Alignment", "->", RowBox[{"{", RowBox[{"Center", ",", "Top"}], "}"}]}]}], "]"}]}]}], "]"}], ",", " ", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"f", ",", "False", ",", "\"\\""}], "}"}], ",", RowBox[{"{", RowBox[{"True", ",", "False"}], "}"}], ",", RowBox[{"ControlPlacement", "->", "Top"}]}], "}"}], ",", " ", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"u", ",", ".59", ",", "\"\\""}], "}"}], ",", "0", ",", "1", ",", ".01", ",", RowBox[{"Appearance", "->", "\"\\""}], ",", RowBox[{"ImageSize", "->", "Tiny"}]}], "}"}], ",", " ", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"v", ",", ".50", ",", "\"\\""}], "}"}], ",", "0", ",", "1", ",", ".01", ",", RowBox[{"Appearance", "->", "\"\\""}], ",", RowBox[{"ImageSize", "->", "Tiny"}]}], "}"}], ",", " ", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"w", ",", ".40", ",", "\"\\""}], "}"}], ",", "0", ",", "1", ",", ".01", ",", RowBox[{"Appearance", "->", "\"\\""}], ",", RowBox[{"ImageSize", "->", "Tiny"}]}], "}"}], ",", " ", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"pt1", ",", RowBox[{"{", RowBox[{ RowBox[{"-", "8.5"}], ",", RowBox[{"-", "5.86"}]}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "8.5"}], ",", RowBox[{"-", "8.5"}]}], "}"}], ",", RowBox[{"{", RowBox[{"8.5", ",", "7.4"}], "}"}], ",", "Locator"}], "}"}], ",", " ", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"pt2", ",", RowBox[{"{", RowBox[{ RowBox[{"-", "6.26"}], ",", "7.4"}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "8.5"}], ",", RowBox[{"-", "8.5"}]}], "}"}], ",", RowBox[{"{", RowBox[{"8.5", ",", "7.4"}], "}"}], ",", "Locator"}], "}"}], ",", " ", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"pt3", ",", RowBox[{"{", RowBox[{"8", ",", RowBox[{"-", "3.3"}]}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "8.5"}], ",", RowBox[{"-", "8.5"}]}], "}"}], ",", RowBox[{"{", RowBox[{"8.5", ",", "7.4"}], "}"}], ",", "Locator"}], "}"}], ",", " ", RowBox[{"ControlPlacement", "->", "Left"}], ",", RowBox[{"Initialization", ":>", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"AreaOfTriangle", "[", RowBox[{"p_", ",", "q_", ",", "r_"}], "]"}], ":=", RowBox[{ RowBox[{ RowBox[{"\[Sqrt]", RowBox[{"(", RowBox[{"#", RowBox[{"(", RowBox[{"#", "-", RowBox[{"EuclideanDistance", "[", RowBox[{"p", ",", "q"}], "]"}]}], ")"}], RowBox[{"(", RowBox[{"#", "-", RowBox[{"EuclideanDistance", "[", RowBox[{"q", ",", "r"}], "]"}]}], ")"}], RowBox[{"(", RowBox[{"#", "-", RowBox[{"EuclideanDistance", "[", RowBox[{"p", ",", "r"}], "]"}]}], ")"}]}], ")"}]}], "&"}], "[", RowBox[{ FractionBox["1", "2"], RowBox[{"(", RowBox[{ RowBox[{"EuclideanDistance", "[", RowBox[{"p", ",", "q"}], "]"}], "+", RowBox[{"EuclideanDistance", "[", RowBox[{"q", ",", "r"}], "]"}], "+", RowBox[{"EuclideanDistance", "[", RowBox[{"p", ",", "r"}], "]"}]}], ")"}]}], "]"}]}], ";", RowBox[{ RowBox[{"CorrespondingAltitudePoint", "[", RowBox[{"p1_", ",", "p2_", ",", "p3_"}], "]"}], ":=", RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"x", ",", "y"}], "}"}], ",", RowBox[{ RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{"#", "=!=", RowBox[{"{", "}"}]}], ",", RowBox[{ RowBox[{"{", RowBox[{"x", ",", "y"}], "}"}], "/.", RowBox[{"#", "[", RowBox[{"[", "1", "]"}], "]"}]}], ",", RowBox[{"{", "}"}]}], "]"}], "&"}], "[", RowBox[{"NSolve", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{ RowBox[{"(", RowBox[{"y", "-", RowBox[{"p1", "[", RowBox[{"[", "2", "]"}], "]"}]}], ")"}], RowBox[{"(", RowBox[{ RowBox[{"p2", "[", RowBox[{"[", "2", "]"}], "]"}], "-", RowBox[{"p3", "[", RowBox[{"[", "2", "]"}], "]"}]}], ")"}]}], "==", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"p3", "[", RowBox[{"[", "1", "]"}], "]"}], "-", RowBox[{"p2", "[", RowBox[{"[", "1", "]"}], "]"}]}], ")"}], RowBox[{"(", RowBox[{"x", "-", RowBox[{"p1", "[", RowBox[{"[", "1", "]"}], "]"}]}], ")"}]}]}], ",", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{"y", "-", RowBox[{"p2", "[", RowBox[{"[", "2", "]"}], "]"}]}], ")"}], RowBox[{"(", RowBox[{ RowBox[{"p3", "[", RowBox[{"[", "1", "]"}], "]"}], "-", RowBox[{"p2", "[", " ", RowBox[{"[", "1", "]"}], "]"}]}], ")"}]}], "==", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"p3", "[", RowBox[{"[", "2", "]"}], "]"}], "-", RowBox[{"p2", "[", RowBox[{"[", "2", "]"}], "]"}]}], ")"}], RowBox[{"(", RowBox[{"x", "-", RowBox[{"p2", "[", RowBox[{"[", "1", "]"}], "]"}]}], ")"}]}]}]}], "}"}], ",", RowBox[{"{", RowBox[{"x", ",", "y"}], "}"}]}], "]"}], "]"}]}], "]"}]}], ";", RowBox[{ RowBox[{"IntersectionOfLinesThroughMeans", "[", RowBox[{ "m1_", ",", "p1_", ",", "p2_", ",", "m2_", ",", "p3_", ",", "p4_"}], "]"}], ":=", RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"x", ",", "y"}], "}"}], ",", RowBox[{ RowBox[{"{", RowBox[{"x", ",", "y"}], "}"}], "/.", RowBox[{ RowBox[{"NSolve", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{ RowBox[{"(", RowBox[{"y", "-", RowBox[{"m1", "[", RowBox[{"[", "2", "]"}], "]"}]}], ")"}], RowBox[{"(", RowBox[{ RowBox[{"p2", "[", RowBox[{"[", "2", "]"}], "]"}], "-", RowBox[{"p1", "[", RowBox[{"[", "2", "]"}], "]"}]}], ")"}]}], "==", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"p1", "[", RowBox[{"[", "1", "]"}], "]"}], "-", RowBox[{"p2", "[", RowBox[{"[", "1", "]"}], "]"}]}], ")"}], RowBox[{"(", RowBox[{"x", "-", RowBox[{"m1", "[", RowBox[{"[", "1", "]"}], "]"}]}], ")"}]}]}], ",", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{"y", "-", RowBox[{"m2", "[", RowBox[{"[", "2", "]"}], "]"}]}], ")"}], RowBox[{"(", RowBox[{ RowBox[{"p4", "[", RowBox[{"[", "2", "]"}], "]"}], "-", RowBox[{"p3", "[", RowBox[{"[", "2", "]"}], "]"}]}], ")"}]}], "==", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"p3", "[", RowBox[{"[", "1", "]"}], "]"}], "-", RowBox[{"p4", "[", RowBox[{"[", "1", "]"}], "]"}]}], ")"}], RowBox[{"(", RowBox[{"x", "-", RowBox[{"m2", "[", RowBox[{"[", "1", "]"}], "]"}]}], ")"}]}]}]}], "}"}], ",", RowBox[{"{", RowBox[{"x", ",", "y"}], "}"}]}], "]"}], "[", RowBox[{"[", "1", "]"}], "]"}]}]}], "]"}]}]}], ")"}]}]}], "]"}]], "Input", CellGroupingRules->{"GroupTogetherGrouping", 10000.}, CellChangeTimes->{ 3.35696210375764*^9, {3.4173454104667125`*^9, 3.4173454361987815`*^9}, {3.417363219953336*^9, 3.417363332297995*^9}, {3.4173633652090893`*^9, 3.4173633941508484`*^9}, 3.4173673248171787`*^9, { 3.4173674269727745`*^9, 3.4173675130815988`*^9}, { 3.4173675615812883`*^9, 3.417367585674884*^9}, { 3.4173676165340614`*^9, 3.41736762772149*^9}, { 3.417369505097625*^9, 3.4173695055351667`*^9}, { 3.4173704913172927`*^9, 3.4173704917079554`*^9}, { 3.417370557667412*^9, 3.417370596452385*^9}, {3.417371738988403*^9, 3.417371743207774*^9}, {3.4173744292749796`*^9, 3.4173745625758486`*^9}, 3.759767472258112*^9}, CellID->34201996], Cell[BoxData[ TagBox[ StyleBox[ DynamicModuleBox[{$CellContext`f$$ = False, $CellContext`pt1$$ = {-8.5, -5.86}, $CellContext`pt2$$ = \ {-6.26, 7.4}, $CellContext`pt3$$ = {8, -3.3}, $CellContext`u$$ = 0.59, $CellContext`v$$ = 0.5, $CellContext`w$$ = 0.4, Typeset`show$$ = True, Typeset`bookmarkList$$ = {}, Typeset`bookmarkMode$$ = "Menu", Typeset`animator$$, Typeset`animvar$$ = 1, Typeset`name$$ = "\"untitled\"", Typeset`specs$$ = {{{ Hold[$CellContext`f$$], False, "show altitudes"}, { True, False}}, {{ Hold[$CellContext`u$$], 0.59, "R"}, 0, 1, 0.01}, {{ Hold[$CellContext`v$$], 0.5, "S"}, 0, 1, 0.01}, {{ Hold[$CellContext`w$$], 0.4, "T"}, 0, 1, 0.01}, {{ Hold[$CellContext`pt1$$], {-8.5, -5.86}}, {-8.5, -8.5}, {8.5, 7.4}}, {{ Hold[$CellContext`pt2$$], {-6.26, 7.4}}, {-8.5, -8.5}, {8.5, 7.4}}, {{ Hold[$CellContext`pt3$$], {8, -3.3}}, {-8.5, -8.5}, {8.5, 7.4}}}, Typeset`size$$ = { 492., {212.134033203125, 217.865966796875}}, Typeset`update$$ = 0, Typeset`initDone$$, Typeset`skipInitDone$$ = False, $CellContext`f$151685$$ = False, $CellContext`u$151686$$ = 0, $CellContext`v$151687$$ = 0, $CellContext`w$151688$$ = 0, $CellContext`pt1$151689$$ = {0, 0}, $CellContext`pt2$151690$$ = {0, 0}, $CellContext`pt3$151691$$ = {0, 0}}, DynamicBox[Manipulate`ManipulateBoxes[ 1, StandardForm, "Variables" :> {$CellContext`f$$ = False, $CellContext`pt1$$ = {-8.5, -5.86}, $CellContext`pt2$$ = \ {-6.26, 7.4}, $CellContext`pt3$$ = {8, -3.3}, $CellContext`u$$ = 0.59, $CellContext`v$$ = 0.5, $CellContext`w$$ = 0.4}, "ControllerVariables" :> { Hold[$CellContext`f$$, $CellContext`f$151685$$, False], Hold[$CellContext`u$$, $CellContext`u$151686$$, 0], Hold[$CellContext`v$$, $CellContext`v$151687$$, 0], Hold[$CellContext`w$$, $CellContext`w$151688$$, 0], Hold[$CellContext`pt1$$, $CellContext`pt1$151689$$, {0, 0}], Hold[$CellContext`pt2$$, $CellContext`pt2$151690$$, {0, 0}], Hold[$CellContext`pt3$$, $CellContext`pt3$151691$$, {0, 0}]}, "OtherVariables" :> { Typeset`show$$, Typeset`bookmarkList$$, Typeset`bookmarkMode$$, Typeset`animator$$, Typeset`animvar$$, Typeset`name$$, Typeset`specs$$, Typeset`size$$, Typeset`update$$, Typeset`initDone$$, Typeset`skipInitDone$$}, "Body" :> Module[{$CellContext`DegenerateTriangle$, \ $CellContext`NoneCoincide$, $CellContext`anglea$, \ $CellContext`angleb$, $CellContext`anglec$, $CellContext`pt123$, \ $CellContext`pt213$, $CellContext`pt312$, $CellContext`m12$ = Mean[{$CellContext`pt1$$, $CellContext`pt2$$}], \ $CellContext`m13$ = Mean[{$CellContext`pt1$$, $CellContext`pt3$$}], \ $CellContext`r$ = $CellContext`u$$ $CellContext`pt2$$ + ( 1 - $CellContext`u$$) $CellContext`pt1$$, $CellContext`s$ = \ $CellContext`v$$ $CellContext`pt3$$ + ( 1 - $CellContext`v$$) $CellContext`pt2$$, $CellContext`t$ = \ $CellContext`w$$ $CellContext`pt3$$ + ( 1 - $CellContext`w$$) $CellContext`pt1$$, \ $CellContext`AcuteTriangle$}, $CellContext`DegenerateTriangle$ = \ $CellContext`AreaOfTriangle[$CellContext`pt1$$, $CellContext`pt2$$, \ $CellContext`pt3$$] < 10^(-5); $CellContext`NoneCoincide$ = Length[ Union[{$CellContext`pt1$$, $CellContext`pt2$$, \ $CellContext`pt3$$}, SameTest -> (EuclideanDistance[#, #2] < 10^(-5)& )]] === 3; If[ And[$CellContext`NoneCoincide$, Not[$CellContext`DegenerateTriangle$]], \ $CellContext`pt123$ = \ $CellContext`CorrespondingAltitudePoint[$CellContext`pt1$$, \ $CellContext`pt2$$, $CellContext`pt3$$]; $CellContext`pt213$ = \ $CellContext`CorrespondingAltitudePoint[$CellContext`pt2$$, \ $CellContext`pt1$$, $CellContext`pt3$$]; $CellContext`pt312$ = \ $CellContext`CorrespondingAltitudePoint[$CellContext`pt3$$, \ $CellContext`pt1$$, $CellContext`pt2$$]; $CellContext`anglea$ = VectorAngle[$CellContext`pt2$$ - $CellContext`pt1$$, \ $CellContext`pt3$$ - $CellContext`pt1$$]; $CellContext`angleb$ = VectorAngle[$CellContext`pt1$$ - $CellContext`pt2$$, \ $CellContext`pt3$$ - $CellContext`pt2$$]; $CellContext`anglec$ = VectorAngle[$CellContext`pt1$$ - $CellContext`pt3$$, \ $CellContext`pt2$$ - $CellContext`pt3$$]; $CellContext`AcuteTriangle$ = And[$CellContext`anglea$ < Pi/2, $CellContext`angleb$ < Pi/2, $CellContext`anglec$ < Pi/2]]; Grid[{{ Pane[ Style[ Which[ Or[ Not[$CellContext`NoneCoincide$], \ $CellContext`DegenerateTriangle$], Framed["Triangle ABC is degenerate."], Not[$CellContext`AcuteTriangle$], Framed["Triangle ABC is not acute."], True, Grid[{{ Grid[{{"DE", "~~", NumberForm[ EuclideanDistance[$CellContext`pt123$, \ $CellContext`pt213$], {5, 2}], "EF", "~~", NumberForm[ EuclideanDistance[$CellContext`pt213$, \ $CellContext`pt312$], {5, 2}], "DF", "~~", NumberForm[ EuclideanDistance[$CellContext`pt123$, \ $CellContext`pt312$], {5, 2}]}}, Dividers -> {{ True, False, False, True, False, False, True, False, False, True}, All}, Spacings -> {{ 1 -> 1, 2 -> 0.2, 3 -> 0.2, 4 -> 1, 5 -> 0.2, 6 -> 0.2, 7 -> 1, 8 -> 0.2, 9 -> 0.2, 10 -> 1}, Automatic}]}, { Grid[{{"RS", "~~", NumberForm[ EuclideanDistance[$CellContext`r$, \ $CellContext`s$], {5, 2}], "ST", "~~", NumberForm[ EuclideanDistance[$CellContext`s$, \ $CellContext`t$], {5, 2}], "RT", "~~", NumberForm[ EuclideanDistance[$CellContext`r$, \ $CellContext`t$], {5, 2}]}}, Dividers -> {{ True, False, False, True, False, False, True, False, False, True}, All}, Spacings -> {{ 1 -> 1, 2 -> 0.2, 3 -> 0.2, 4 -> 1, 5 -> 0.2, 6 -> 0.2, 7 -> 1, 8 -> 0.2, 9 -> 0.2, 10 -> 1}, Automatic}]}, { Grid[{{ "perimeter( DEF )", "~~", NumberForm[ EuclideanDistance[$CellContext`pt123$, \ $CellContext`pt213$] + EuclideanDistance[$CellContext`pt213$, \ $CellContext`pt312$] + EuclideanDistance[$CellContext`pt123$, \ $CellContext`pt312$], {5, 2}], "perimeter( RST )", "~~", NumberForm[ EuclideanDistance[$CellContext`r$, \ $CellContext`s$] + EuclideanDistance[$CellContext`s$, \ $CellContext`t$] + EuclideanDistance[$CellContext`r$, \ $CellContext`t$], {5, 2}]}}, Dividers -> {{ True, False, False, True, False, False, True}, All}, Spacings -> {{ 1 -> 1, 2 -> 0.2, 3 -> 0.2, 4 -> 1, 5 -> 0.2, 6 -> 0.2, 7 -> 1}, Automatic}]}}]], 14, "Label"], ImageSize -> {430, 100}, Alignment -> {Center, Center}]}, { Graphics[{ Thickness[0.015], RGBColor[0.33, 0.26, 0.78], Line[{$CellContext`pt1$$, $CellContext`pt2$$, \ $CellContext`pt3$$, $CellContext`pt1$$}], PointSize[0.035], If[ And[$CellContext`f$$, $CellContext`NoneCoincide$, \ $CellContext`AcuteTriangle$, Not[$CellContext`DegenerateTriangle$]], Unevaluated[ Sequence[ Thickness[0.01], Line[{$CellContext`pt1$$, $CellContext`pt123$}], Line[{$CellContext`pt2$$, $CellContext`pt213$}], Line[{$CellContext`pt3$$, $CellContext`pt312$}]]], \ {}], RGBColor[1, 0.26, 0], Thickness[0.015], If[ And[$CellContext`NoneCoincide$, \ $CellContext`AcuteTriangle$, Not[$CellContext`DegenerateTriangle$]], Unevaluated[ Sequence[ Point[{$CellContext`pt123$, $CellContext`pt213$, \ $CellContext`pt312$}], Line[{$CellContext`pt312$, $CellContext`pt213$, \ $CellContext`pt123$, $CellContext`pt312$}]]], {}], RGBColor[0.45, 0.7, 0.55], Point[{$CellContext`r$, $CellContext`s$, \ $CellContext`t$}], Line[{$CellContext`r$, $CellContext`s$, \ $CellContext`t$, $CellContext`r$}], Black, Text[ Style["R", 20, "Label"], $CellContext`r$ + {0, 0.9}], Text[ Style["S", 20, "Label"], $CellContext`s$ + {0, 0.9}], Text[ Style["T", 20, "Label"], $CellContext`t$ + {0, 0.9}], Text[ Style[ "A", 20, "Label"], $CellContext`pt1$$ + {0, 0.9}], Text[ Style[ "B", 20, "Label"], $CellContext`pt2$$ + {0, 0.9}], Text[ Style[ "C", 20, "Label"], $CellContext`pt3$$ + {0, 0.9}], If[ And[$CellContext`NoneCoincide$, \ $CellContext`AcuteTriangle$, Not[$CellContext`DegenerateTriangle$]], Unevaluated[ Sequence[ Text[ Style[ "D", 20, "Label"], $CellContext`pt123$ + {0, 0.9}], Text[ Style[ "E", 20, "Label"], $CellContext`pt213$ + {0, 0.9}], Text[ Style[ "F", 20, "Label"], $CellContext`pt312$ + { 0, 0.9}]]], {}]}, ImageSize -> {355, 325}, PlotRange -> {{-9, 9}, {-9, 9}}]}}, ItemSize -> {35, {8, Automatic}}, Alignment -> {Center, Top}]], "Specifications" :> {{{$CellContext`f$$, False, "show altitudes"}, {True, False}, ControlPlacement -> Top}, {{$CellContext`u$$, 0.59, "R"}, 0, 1, 0.01, Appearance -> "Labeled", ImageSize -> Tiny}, {{$CellContext`v$$, 0.5, "S"}, 0, 1, 0.01, Appearance -> "Labeled", ImageSize -> Tiny}, {{$CellContext`w$$, 0.4, "T"}, 0, 1, 0.01, Appearance -> "Labeled", ImageSize -> Tiny}, {{$CellContext`pt1$$, {-8.5, -5.86}}, {-8.5, -8.5}, { 8.5, 7.4}, ControlType -> Locator}, {{$CellContext`pt2$$, {-6.26, 7.4}}, {-8.5, -8.5}, {8.5, 7.4}, ControlType -> Locator}, {{$CellContext`pt3$$, {8, -3.3}}, {-8.5, -8.5}, { 8.5, 7.4}, ControlType -> Locator}}, "Options" :> {ControlPlacement -> Left}, "DefaultOptions" :> {ControllerLinking -> True}], ImageSizeCache->{676., {259., 265.}}, SingleEvaluation->True], Deinitialization:>None, DynamicModuleValues:>{}, Initialization:>(($CellContext`AreaOfTriangle[ Pattern[$CellContext`p, Blank[]], Pattern[$CellContext`q, Blank[]], Pattern[$CellContext`r, Blank[]]] := ( Sqrt[((# (# - EuclideanDistance[$CellContext`p, $CellContext`q])) (# - EuclideanDistance[$CellContext`q, $CellContext`r])) (# - EuclideanDistance[$CellContext`p, $CellContext`r])]& )[(1/ 2) (EuclideanDistance[$CellContext`p, $CellContext`q] + EuclideanDistance[$CellContext`q, $CellContext`r] + EuclideanDistance[$CellContext`p, $CellContext`r])]; \ $CellContext`CorrespondingAltitudePoint[ Pattern[$CellContext`p1, Blank[]], Pattern[$CellContext`p2, Blank[]], Pattern[$CellContext`p3, Blank[]]] := Block[{$CellContext`x, $CellContext`y}, (If[# =!= {}, ReplaceAll[{$CellContext`x, $CellContext`y}, Part[#, 1]], {}]& )[ NSolve[{($CellContext`y - Part[$CellContext`p1, 2]) ( Part[$CellContext`p2, 2] - Part[$CellContext`p3, 2]) == (Part[$CellContext`p3, 1] - Part[$CellContext`p2, 1]) ($CellContext`x - Part[$CellContext`p1, 1]), ($CellContext`y - Part[$CellContext`p2, 2]) (Part[$CellContext`p3, 1] - Part[$CellContext`p2, 1]) == (Part[$CellContext`p3, 2] - Part[$CellContext`p2, 2]) ($CellContext`x - Part[$CellContext`p2, 1])}, {$CellContext`x, $CellContext`y}]]]; \ $CellContext`IntersectionOfLinesThroughMeans[ Pattern[$CellContext`m1, Blank[]], Pattern[$CellContext`p1, Blank[]], Pattern[$CellContext`p2, Blank[]], Pattern[$CellContext`m2, Blank[]], Pattern[$CellContext`p3, Blank[]], Pattern[$CellContext`p4, Blank[]]] := Block[{$CellContext`x, $CellContext`y}, ReplaceAll[{$CellContext`x, $CellContext`y}, Part[ NSolve[{($CellContext`y - Part[$CellContext`m1, 2]) ( Part[$CellContext`p2, 2] - Part[$CellContext`p1, 2]) == (Part[$CellContext`p1, 1] - Part[$CellContext`p2, 1]) ($CellContext`x - Part[$CellContext`m1, 1]), ($CellContext`y - Part[$CellContext`m2, 2]) (Part[$CellContext`p4, 2] - Part[$CellContext`p3, 2]) == (Part[$CellContext`p3, 1] - Part[$CellContext`p4, 1]) ($CellContext`x - Part[$CellContext`m2, 1])}, {$CellContext`x, $CellContext`y}], 1]]]); Typeset`initDone$$ = True), SynchronousInitialization->True, UnsavedVariables:>{Typeset`initDone$$}, UntrackedVariables:>{Typeset`size$$}], "Manipulate", Deployed->True, StripOnInput->False], Manipulate`InterpretManipulate[1]]], "Output", CellGroupingRules->{"GroupTogetherGrouping", 10000.}, CellChangeTimes->{3.75976747225835*^9}, CellID->528710887] }, {2}]]