Module[{fx, fy, fxx, fxy, fyy, crits, det, min, minString, minPoints, minPoints3D, max, maxString, maxPoints, maxPoints3D, saddle, saddleString, saddlePoints, saddlePoints3D, centerOptions, compliment, comp, play, stop, instruments}, (* DEFINES DESIRED FUNCTION AND ITS PARTIAL DERIVATIVES *) fx[x_, y_] = D[f[x, y], x]; fy[x_, y_] = D[f[x, y], y]; fxx[x_, y_] = D[fx[x, y], x]; fxy[x_, y_] = D[fx[x, y], y]; fyy[x_, y_] = D[fy[x, y], y]; (* ENUMERATES ALL REAL CRITICAL POINTS *) crits = Module[{raw, formatted, i, j}, raw = Quiet[NSolve[{fx[x, y] == 0, fy[x, y] == 0}, {x, y}]]; For[i = 1; j = 0, i <= Length[raw], i++, If[raw[[i, 1, 2]] \[Element] Reals && raw[[i, 2, 2]] \[Element] Reals, j++; formatted[j] = {raw[[i, 1, 2]], raw[[i, 2, 2]]}]]; Union[Array[formatted, j]]]; det[a_, b_] = Det[( { {fxx[x, y], fxy[x, y]}, {fxy[x, y], fyy[x, y]} } )] /. {x -> a, y -> b}; (* SEEKS OUT ALL MINIMA *) min := Module[{a, b, i, j, temp}, For[i = 1; j = 0, i <= Length[crits], i++, a = crits[[i, 1]]; b = crits[[i, 2]]; If[det[a, b] > 0 && fxx[a, b] > 0, j++; temp[j] = crits[[i]]]]; Array[temp, j]]; minString := Module[{a, b, i, temp}, For[i = 1; temp = "", i <= Length[min], i++, a = min[[i, 1]]; b = min[[i, 2]]; temp = temp <> ToString[{a, b, f[a, b]}] <> "\n"]; If[temp == "", "None\n", temp]]; minPoints[con_] := Module[{i, temp}, For[i = 1, i <= Length[min], i++, temp[i] = Graphics[{Blue, PointSize -> 0.03, Point[min[[i]]]}]]; If[con, Array[temp, Length[min]], {}]]; minPoints3D[con_] := Module[{a, b, i, temp}, For[i = 1, i <= Length[min], i++, a = min[[i, 1]]; b = min[[i, 2]]; temp[i] = Graphics3D[{Blue, PointSize -> 0.03, Point[{a, b, f[a, b]}]}]]; If[con, Array[temp, Length[min]], {}]]; (* SEEKS OUT ALL MAXIMA *) max := Module[{a, b, i, j, temp}, For[i = 1; j = 0, i <= Length[crits], i++, a = crits[[i, 1]]; b = crits[[i, 2]]; If[det[a, b] > 0 && fxx[a, b] < 0, j++; temp[j] = crits[[i]]]]; Array[temp, j]]; maxString := Module[{a, b, i, temp}, For[i = 1; temp = "", i <= Length[max], i++, a = max[[i, 1]]; b = max[[i, 2]]; temp = temp <> ToString[{a, b, f[a, b]}] <> "\n"]; If[temp == "", "None\n", temp]]; maxPoints[con_] := Module[{i, temp}, For[i = 1, i <= Length[max], i++, temp[i] = Graphics[{Red, PointSize -> 0.03, Point[max[[i]]]}]]; If[con, Array[temp, Length[max]], {}]]; maxPoints3D[con_] := Module[{a, b, i, temp}, For[i = 1, i <= Length[max], i++, a = max[[i, 1]]; b = max[[i, 2]]; temp[i] = Graphics3D[{Red, PointSize -> 0.03, Point[{a, b, f[a, b]}]}]]; If[con, Array[temp, Length[max]], {}]]; (* SEEKS OUT ALL SADDLE POINTS *) saddle := Module[{a, b, i, j, temp}, For[i = 1; j = 0, i <= Length[crits], i++, a = crits[[i, 1]]; b = crits[[i, 2]]; If[det[a, b] < 0 , j++; temp[j] = crits[[i]]]]; Array[temp, j]]; saddleString := Module[{a, b, i, temp}, For[i = 1; temp = "", i <= Length[saddle], i++, a = saddle[[i, 1]]; b = saddle[[i, 2]]; temp = temp <> ToString[{a, b, f[a, b]}] <> "\n"]; If[temp == "", "None\n", temp]]; saddlePoints[con_] := Module[{i, temp}, For[i = 1, i <= Length[saddle], i++, temp[i] = Graphics[{Green, PointSize -> 0.03, Point[saddle[[i]]]}]]; If[con, Array[temp, Length[saddle]], {}]]; saddlePoints3D[con_] := Module[{a, b, i, temp}, For[i = 1, i <= Length[saddle], i++, a = saddle[[i, 1]]; b = saddle[[i, 2]]; temp[i] = Graphics3D[{Green, PointSize -> 0.03, Point[{a, b, f[a, b]}]}]]; If[con, Array[temp, Length[saddle]], {}]]; (* ENUMERATES OPTIONS AVAILABLE FOR CENTERING *) centerOptions := Module[{options, i, a, b}, options[1] = "Origin"; options[2] = "Custom"; For[i = 1, i <= Length[min], i++, a = min[[i, 1]]; b = min[[i, 2]]; options[i + 2] = {a, b, f[a, b]}]; For[i = 1, i <= Length[max], i++, a = max[[i, 1]]; b = max[[i, 2]]; options[i + 2 + Length[min]] = {a, b, f[a, b]}]; For[i = 1, i <= Length[saddle], i++, a = saddle[[i, 1]]; b = saddle[[i, 2]]; options[i + 2 + Length[min] + Length[max]] = {a, b, f[a, b]}]; Array[options, 2 + Length[min] + Length[max] + Length[saddle]]]; compliment = {"cool", "smart", "handsome", "brilliant", "creative", "ambitious", "bright", "awesome"}; comp = "I think you're very " <> compliment[[RandomInteger[{1, 8}]]] <> "! :)"; (* COMPOSES THE MUSIC *) play[instrument_, metronome_] := Module[{unit, intro, part1, part2, chorusA, chorusB1, firstEnd, chorusB2, secondEnd}, unit = (60/metronome)*4; intro = Sound[{ SoundNote[{"g2", "d5", "b5"}, (1/8) unit, instrument], SoundNote["d3", (1/8) unit, instrument], SoundNote["a3", (1/8) unit, instrument], SoundNote["b3", (3/8) unit, instrument], SoundNote[{"d5", "b5"}, (3/16) unit, instrument], SoundNote[{"c5", "a5"}, (1/16) unit, instrument], SoundNote[{"e2", "c5", "a5"}, (1/8) unit, instrument], SoundNote["b2", (1/16) unit, instrument], SoundNote[{"b", "g5"}, (1/16) unit, instrument], SoundNote[{"f#3", "b", "g5"}, (1/8) unit, instrument], SoundNote["g3", (3/8) unit, instrument], SoundNote[{"b", "g5"}, (3/16) unit, instrument], SoundNote[{"a", "f#5"}, (1/16) unit, instrument], SoundNote[{"c3", "a", "f#5"}, (1/8) unit, instrument], SoundNote["g3", (1/16) unit, instrument], SoundNote[{"g", "e5"}, (1/16) unit, instrument], SoundNote[{"d", "g", "e5"}, (1/8) unit, instrument], SoundNote["e", (3/8) unit, instrument], SoundNote[{"g", "e5"}, (3/16) unit, instrument], SoundNote[{"g", "d5"}, (1/16) unit, instrument], SoundNote[{"d3", "g", "d5"}, (1/8) unit, instrument], SoundNote["a3", (1/8) unit, instrument], SoundNote["d", (1/8) unit, instrument] }]; part1 = Sound[{ SoundNote["g", (1/8) unit, instrument], SoundNote["f#", (1/8) unit, instrument], SoundNote["d", (1/8) unit, instrument], SoundNote["g", (1/8) unit, instrument], SoundNote["f#", (1/8) unit, instrument], SoundNote[{"g3", "b3", "g"}, (1/8) unit, instrument], SoundNote["d", (1/8) unit, instrument], SoundNote["d", (1/4) unit, instrument], SoundNote[None, (1/8) unit, instrument], SoundNote["d", (1/8) unit, instrument], SoundNote[{"f#3", "a3", "d", "g"}, (1/8) unit, instrument], SoundNote["f#", (1/8) unit, instrument], SoundNote[{"e3", "g3", "b3", "g"}, (1/8) unit, instrument], SoundNote["d", (1/8) unit, instrument], SoundNote["d", (1/4) unit, instrument], SoundNote[None, (1/8) unit, instrument], SoundNote["d", (1/8) unit, instrument], SoundNote[{"d3", "g3", "b3", "g"}, (1/8) unit, instrument], SoundNote["f#", (1/8) unit, instrument], SoundNote[{"c3", "g3", "b3", "e", "g"}, (3/8) unit, instrument], SoundNote["g", (1/8) unit, instrument], SoundNote[{"c2", "g"}, (1/8) unit, instrument], SoundNote[{"c3", "e"}, (1/8) unit, instrument], SoundNote[{"g3", "e"}, (1/8) unit, instrument], SoundNote["d", (1/8) unit, instrument], SoundNote[{"d3", "g3", "a3"}, (1/4) unit, instrument], SoundNote[{"d3", "g3", "a3"}, (1/4) unit, instrument], SoundNote[{"d3", "f#3", "a3"}, (1/8) unit, instrument], SoundNote["d", (1/8) unit, instrument], SoundNote["g", (1/8) unit, instrument], SoundNote["f#", (1/8) unit, instrument], SoundNote[{"g2", "g"}, (1/8) unit, instrument], SoundNote[{"d3", "d"}, (1/8) unit, instrument], SoundNote[{"g3", "d"}, (1/8) unit, instrument], SoundNote["b3", (1/4) unit, instrument], SoundNote["d", (1/8) unit, instrument], SoundNote["b", (3/16) unit, instrument], SoundNote["a", (1/16) unit, instrument], SoundNote[{"e2", "d", "a"}, (1/8) unit, instrument], SoundNote[{"b2", "g"}, (1/8) unit, instrument], SoundNote[{"e3", "g"}, (1/8) unit, instrument], SoundNote["g3", (1/8) unit, instrument], SoundNote["b3", (1/8) unit, instrument], SoundNote["d", (1/8) unit, instrument], SoundNote["g", (1/8) unit, instrument], SoundNote["f#", (1/8) unit, instrument], SoundNote[{"c3", "g"}, (1/8) unit, instrument], SoundNote[{"g3", "e"}, (1/8) unit, instrument], SoundNote["c", (1/8) unit, instrument], SoundNote["e", (1/8) unit, instrument], SoundNote["e", (1/8) unit, instrument], SoundNote["g", (1/8) unit, instrument], SoundNote["e5", (1/8) unit, instrument], SoundNote[{"d3", "d5"}, (1/8) unit, instrument], SoundNote["a3", (1/8) unit, instrument], SoundNote["d", (1/8) unit, instrument], SoundNote["g", (1/8) unit, instrument], SoundNote["f#", (1/8) unit, instrument], SoundNote["a", (1/8) unit, instrument], SoundNote["a", (1/8) unit, instrument], SoundNote["c5", (1/8) unit, instrument] }]; part2 = Sound[{ SoundNote[{"b2", "d", "f#", "c5"}, (1/8) unit, instrument], SoundNote[{"f#3", "b"}, (1/8) unit, instrument], SoundNote[{"b3", "b"}, (1/8) unit, instrument], SoundNote["d", (1/8) unit, instrument], SoundNote["f#", (1/8) unit, instrument], SoundNote["b", (1/8) unit, instrument], SoundNote[{"d3", "b"}, (1/8) unit, instrument], SoundNote[{"d3", "f#"}, (1/8) unit, instrument], SoundNote[{"e3", "a"}, (1/8) unit, instrument], SoundNote[{"g3", "g"}, (1/8) unit, instrument], SoundNote[{"b3", "g"}, (1/16) unit, instrument], SoundNote["f#", (1/16) unit, instrument], SoundNote["g3", (1/16) unit, instrument], SoundNote["g", (1/16) unit, instrument], SoundNote[{"e", "g"}, (1/8) unit, instrument], SoundNote["g", (1/8) unit, instrument], SoundNote["f#", (1/8) unit, instrument], SoundNote["g", (1/8) unit, instrument], SoundNote[{"c3", "c5"}, (1/8) unit, instrument], SoundNote["e3", (1/8) unit, instrument], SoundNote["g3", (1/8) unit, instrument], SoundNote[{"c", "e"}, (1/8) unit, instrument], SoundNote["d5", (1/8) unit, instrument], SoundNote["c5", (1/8) unit, instrument], SoundNote["b", (1/8) unit, instrument], SoundNote[{"d3", "a"}, (1/8) unit, instrument], SoundNote["a3", (1/8) unit, instrument], SoundNote["d", (1/8) unit, instrument], SoundNote["g", (1/8) unit, instrument], SoundNote["f#", (1/8) unit, instrument], SoundNote["a", (1/8) unit, instrument], SoundNote["a", (1/8) unit, instrument], SoundNote["c5", (1/8) unit, instrument], SoundNote[{"b2", "d", "f#", "c5"}, (1/8) unit, instrument], SoundNote[{"f#3", "b"}, (1/8) unit, instrument], SoundNote[{"b3", "b"}, (1/8) unit, instrument], SoundNote["d", (1/8) unit, instrument], SoundNote["f#", (1/8) unit, instrument], SoundNote["b", (1/8) unit, instrument], SoundNote["b", (1/8) unit, instrument], SoundNote["f#5", (1/8) unit, instrument], SoundNote[{"e3", "f#5"}, (1/8) unit, instrument], SoundNote[{"g3", "e5"}, (1/8) unit, instrument], SoundNote[{"b3", "f#5"}, (1/8) unit, instrument], SoundNote[{"d", "g5"}, (1/4) unit, instrument], SoundNote["g5", (1/8) unit, instrument], SoundNote["a", (1/8) unit, instrument], SoundNote["g", (1/8) unit, instrument], SoundNote[{"c3", "e5"}, (1/8) unit, instrument], SoundNote["g3", (1/8) unit, instrument], SoundNote["c", (1/8) unit, instrument], SoundNote[{"e", "e5"}, (1/8) unit, instrument], SoundNote[{"g", "e5"}, (1/8) unit, instrument], SoundNote["d5", (1/8) unit, instrument], SoundNote["d5", (1/8) unit, instrument], SoundNote[{"d3", "a3", "g", "a", "d5"}, (1/4) unit, instrument], SoundNote[{"g", "a", "d5"}, (1/8) unit, instrument], SoundNote[{"d3", "a3"}, (1/8) unit, instrument] }]; chorusA = Sound[{ SoundNote[{"d3", "a3", "f#", "a", "d5"}, (1/8) unit, instrument], SoundNote["d", (1/8) unit, instrument], SoundNote["d5", (1/8) unit, instrument], SoundNote["c5", (1/8) unit, instrument], SoundNote[{"g3", "b"}, (1/8) unit, instrument], SoundNote["b3", (1/8) unit, instrument], SoundNote[{"d", "b"}, (1/8) unit, instrument], SoundNote[{"b3", "c5"}, (1/16) unit, instrument], SoundNote["b", (1/16) unit, instrument], SoundNote[{"f#3", "b"}, (1/8) unit, instrument], SoundNote["b3", (1/8) unit, instrument], SoundNote[{"d", "b"}, (1/8) unit, instrument], SoundNote[{"b3", "c5"}, (1/8) unit, instrument], SoundNote[{"e3", "b"}, (1/8) unit, instrument], SoundNote[{"g3", "c5"}, (1/16) unit, instrument], SoundNote["b", (1/16) unit, instrument], SoundNote[{"b3", "b"}, (1/8) unit, instrument], SoundNote[{"g3", "a"}, (1/8) unit, instrument], SoundNote[{"d3", "g"}, (1/8) unit, instrument], SoundNote[{"g3", "g"}, (1/8) unit, instrument], SoundNote[{"b3", "b"}, (1/8) unit, instrument], SoundNote[{"g3", "d5"}, (1/8) unit, instrument], SoundNote[{"c3", "e5"}, (1/8) unit, instrument], SoundNote["g3", (1/8) unit, instrument], SoundNote[{"e", "e5"}, (1/8) unit, instrument], SoundNote[{"g3", "e5"}, (1/16) unit, instrument], SoundNote["d5", (1/16) unit, instrument], SoundNote[{"d3", "d5"}, (1/8) unit, instrument], SoundNote[{"a3", "a"}, (1/8) unit, instrument], SoundNote[{"d", "a"}, (1/8) unit, instrument], SoundNote[{"a3", "c5"}, (1/16) unit, instrument], SoundNote["b", (1/16) unit, instrument], SoundNote[{"g2", "b"}, (1/8) unit, instrument], SoundNote["d3", (1/8) unit, instrument], SoundNote["g3", (1/8) unit, instrument], SoundNote["b3", (1/8) unit, instrument], SoundNote["d", (1/8) unit, instrument] }]; chorusB1 = Sound[{ SoundNote[{"b3", "g"}, (1/8) unit, instrument], SoundNote[{"g3", "b"}, (1/8) unit, instrument], SoundNote[{"d3", "d5"}, (1/8) unit, instrument], SoundNote[{"c3", "e5"}, (1/8) unit, instrument], SoundNote["g3", (1/8) unit, instrument], SoundNote[{"e", "e5"}, (1/8) unit, instrument], SoundNote["e5", (1/16) unit, instrument], SoundNote["d5", (1/16) unit, instrument], SoundNote[{"d3", "d5"}, (1/8) unit, instrument], SoundNote[{"a3", "a"}, (1/8) unit, instrument], SoundNote[{"d", "a"}, (1/8) unit, instrument], SoundNote["c5", (1/8) unit, instrument], SoundNote[{"g3", "d", "b"}, (1/8) unit, instrument], SoundNote["c5", (1/8) unit, instrument], SoundNote[{"f#3", "d", "b"}, (1/8) unit, instrument], SoundNote["a", (1/16) unit, instrument], SoundNote[{"e3", "b3", "g"}, (5/16) unit, instrument], SoundNote[{"d3", "b3", "a"}, (1/8) unit, instrument], SoundNote["b", (1/8) unit, instrument], SoundNote[{"c3", "e"}, (1/8) unit, instrument], SoundNote["g3", (1/8) unit, instrument], SoundNote[{"c", "e"}, (1/8) unit, instrument], SoundNote["g", (1/8) unit, instrument], SoundNote[{"d3", "a3", "d", "g"}, (1/8) unit, instrument], SoundNote["f#", (1/8) unit, instrument], SoundNote[{"d3", "a3", "d", "f#"}, (1/8) unit, instrument], SoundNote["g", (1/8) unit, instrument] }]; chorusB2 = Sound[{ SoundNote[{"b3", "g"}, (1/8) unit, instrument], SoundNote[{"g3", "b"}, (1/8) unit, instrument], SoundNote[{"d3", "d5"}, (1/8) unit, instrument], SoundNote[{"c3", "e5"}, (1/8) unit, instrument], SoundNote["g3", (1/8) unit, instrument], SoundNote[{"e", "e5"}, (1/8) unit, instrument], SoundNote["e5", (1/16) unit, instrument], SoundNote["f#5", (1/16) unit, instrument], SoundNote[{"d3", "f#5"}, (1/8) unit, instrument], SoundNote[{"a3", "e5"}, (1/8) unit, instrument], SoundNote[{"d", "d5"}, (1/8) unit, instrument], SoundNote["c5", (1/8) unit, instrument], SoundNote[{"g3", "d", "b"}, (1/8) unit, instrument], SoundNote["c5", (1/8) unit, instrument], SoundNote[{"f#3", "d", "b"}, (1/8) unit, instrument], SoundNote["a", (1/16) unit, instrument], SoundNote[{"e3", "b3", "g"}, (5/16) unit, instrument], SoundNote[{"d3", "b3", "a"}, (1/8) unit, instrument], SoundNote["b", (1/8) unit, instrument], SoundNote[{"c3", "e"}, (1/8) unit, instrument], SoundNote["g3", (1/8) unit, instrument], SoundNote[{"c", "e"}, (1/8) unit, instrument], SoundNote["g", (1/8) unit, instrument], SoundNote[{"d3", "a3", "d", "g"}, (1/8) unit, instrument], SoundNote["f#", (1/8) unit, instrument], SoundNote[{"d3", "a3", "d", "f#"}, (1/8) unit, instrument], SoundNote["g", (1/8) unit, instrument] }]; firstEnd = Sound[{ SoundNote[{"c3", "e", "g"}, (1/8) unit, instrument], SoundNote["g3", (1/8) unit, instrument], SoundNote["c", (1/8) unit, instrument], SoundNote[{"b2", "g3", "d", "g"}, (3/8) unit, instrument], SoundNote[{"a2", "g3", "c", "g"}, (1/4) unit, instrument], SoundNote[{"g2", "b3", "g"}, (1/8) unit, instrument], SoundNote["d3", (1/8) unit, instrument], SoundNote["g3", (1/8) unit, instrument], SoundNote["d3", (1/8) unit, instrument], SoundNote[{"g2", "g3", "b3", "g"}, (1/8) unit, instrument], SoundNote[{"g2", "g3", "b3", "g"}, (1/8) unit, instrument], SoundNote[{"a2", "g3", "c", "g"}, (1/8) unit, instrument], SoundNote[{"b2", "g3", "d", "g"}, (1/8) unit, instrument], SoundNote[{"c3", "e", "g"}, (1/8) unit, instrument], SoundNote["g3", (1/8) unit, instrument], SoundNote["c", (1/8) unit, instrument], SoundNote[{"b2", "g3", "d", "g"}, (3/8) unit, instrument], SoundNote[{"a2", "g3", "c", "g"}, (1/4) unit, instrument], SoundNote[{"d2", "g3", "a3", "d"}, (1/4) unit, instrument], SoundNote[{"g3", "a3", "d"}, (1/8) unit, instrument], SoundNote["d2", (1/8) unit, instrument], SoundNote[{"d2", "f#3", "a3", "d"}, (1/8) unit, instrument], SoundNote["a", (1/8) unit, instrument], SoundNote["a", (1/8) unit, instrument], SoundNote["c5", (1/8) unit, instrument] }]; secondEnd = Sound[{ SoundNote[{"g2", "b3", "d", "g"}, (1/8) unit, instrument], SoundNote["d3", (1/8) unit, instrument], SoundNote["g3", (1/8) unit, instrument], SoundNote["d3", (1/8) unit, instrument], SoundNote["a3", (1/8) unit, instrument], SoundNote["d3", (1/8) unit, instrument], SoundNote["g3", (1/8) unit, instrument], SoundNote["d3", (1/8) unit, instrument], SoundNote[{"e2", "b3", "d", "g"}, (1/8) unit, instrument], SoundNote["b2", (1/8) unit, instrument], SoundNote["e3", (1/8) unit, instrument], SoundNote["f#3", (1/8) unit, instrument], SoundNote[{"g3", "b3", "d", "g"}, (1/8) unit, instrument], SoundNote["f#3", (1/8) unit, instrument], SoundNote[{"e3", "a"}, (1/8) unit, instrument], SoundNote[{"b2", "b"}, (1/8) unit, instrument], SoundNote[{"d2", "g3", "c", "e"}, (1/8) unit, instrument], SoundNote["g2", (1/8) unit, instrument], SoundNote[{"c3", "e"}, (1/8) unit, instrument], SoundNote["g", (1/8) unit, instrument], SoundNote[{"d2", "a2", "d3", "a3", "d", "g"}, (1/8) unit, instrument], SoundNote["f#", (1/8) unit, instrument], SoundNote[{"d2", "a2", "d3", "a3", "d", "f#"}, (1/8) unit, instrument], SoundNote["g", (1/8) unit, instrument], SoundNote[{"d2", "g2", "b3", "d", "g"}, unit, instrument] }]; EmitSound[{intro, part1, part2, chorusA, chorusB1, firstEnd, part2, chorusA, chorusB2, secondEnd}]]; stop = Sound[SoundNote["g", 0.001, "Piano"]]; instruments = {"Piano", "Choir", "MusicBox", "Ocarina", "Guitar", "Polysynth", "Strings", "Agogo", "Xylophone"}; (* CONSTRUCTS USER INTERFACE FOR MATHEMTICAL MANIPULATION *) Manipulate[ Module[{color, threeDim, contour}, If[ToString[center] == "Origin", cx = 0; cy = 0, If[ToString[center] != "Custom", cx = center[[1]]; cy = center[[2]], cx = cx; cy = cy]]; color = If[scheme == "Evening Sunset", "BlueGreenYellow", If [scheme == "Rad Rainbow", "Rainbow", If[scheme == "Lovey Dovey", "ValentineTones", If[scheme == "Misty Night", "LakeColors", If[scheme == "Rustic Sunburst", "RustTones", If[scheme == "Under the Sea", "DeepSeaColors", If[overlay == "Chess Master", "BlueGreenYellow", Automatic]]]]]]]; threeDim = Plot3D[f[x, y], {x, cx - s, cx + s}, {y, cy - s, cy + s}, PlotRange -> {f[cx, cy] - sz, f[cx, cy] + sz}, MeshShading -> If[overlay == "Chess Master", {{Black, White}, {White, Black}}, None], ImageSize -> 450, ColorFunction -> color]; contour = ContourPlot[f[x, y], {x, cx - s, cx + s}, {y, cy - s, cy + s}, ImageSize -> 450, ColorFunction -> color]; TableForm[{{Style[StandardForm["Plot3D"], 15, Bold, TextAlignment -> Center]}, {Show[threeDim, minPoints3D[mins], maxPoints3D[maxs], saddlePoints3D[sads]]}, {Style[StandardForm["\n\nContourPlot"], 15, Bold, TextAlignment -> Center]}, {Show[contour, minPoints[mins], maxPoints[maxs], saddlePoints[sads]]}}] ], Style["Zoom Settings", 12, Bold], {{center, "Origin", "center"}, centerOptions, ControlType -> PopupMenu}, {{cx, 0, "center x"}, -10}, {{cy, 0, "center y"}, 10}, {{s, 10, "scale x and y"}, 0.1, 100, Appearance -> "Labeled"}, {{sz, 10, "scale z"}, 0.1, 100, Appearance -> "Labeled"}, Delimiter, Style["Color Settings", 12, Bold], {{scheme, "Default", "color function"}, {"Default", "Evening Sunset", "Rad Rainbow", "Lovey Dovey", "Misty Night", "Rustic Sunburst", "Under the Sea"}, ControlType -> PopupMenu}, {{overlay, "None", "color overlay"}, {"None", "Chess Master"}}, Delimiter, Style["Display Settings", 12, Bold], {{mins, True, "local minima"}, {True, False}}, {{maxs, True, "local maxima"}, {True, False}}, {{sads, True, "saddle points"}, {True, False}}, Button["reset default settings", Beep[]; center = "Origin"; cx = 0; cy = 0; s = 10; sz = 10; scheme = "Default"; overlay = "None"; mins = True; maxs = True; sads = True], Delimiter, Style["Points of Interest", 12, Bold], Style["Local Minima", 10, Underlined, Blue], Style[minString, 10, Plain], Style["Local Maxima", 10, Underlined, Red], Style[maxString, 10, Plain], Style["Saddle Points", 10, Underlined, Darker[Green]], Style[saddleString, 10, Plain], Delimiter, Style["Random Stuff", 12, Bold], Style["Random Compliment", 10, Underlined], Style[Dynamic[comp], 10, Plain], Button["i feel worthless.", Beep[]; comp = "I think you're very " <> compliment[[RandomInteger[{1, 8}]]] <> "! :)"], Style["\nNice Soothing Asian Music", 10, Underlined], {{instrument, "Xylophone", "instrument"}, instruments, ControlType -> PopupMenu}, {{metronome, 100, "metronome"}, 50, 150, 10, Appearance -> "Labeled"}, Button["play", play[instrument, metronome]], Button["stop", EmitSound[stop]], Button["cool suggestion, please!", Beep[]; MessageDialog[ "For a funky (verging on annoying) musical experience, try \ playing MusicBox at 150!", WindowTitle -> "Suggestion"];], Style["Note: Concurrent Mathematica operations might distort the \ music.\nTo change sound options, stop and restart the music.", 9, Italic], Delimiter, Style["Credits", 12, Bold], Style["Who made this?", 10, Underlined], Style["Daniel J. Kim (Class of 2013)\n", 10, Plain], Style["Who made this possible?", 10, Underlined], Style["Oliver Knill: Course Head\nEthan Street & Jeffrey Kalmus: \ Section Leaders (and Moral Support!)\n", 10, Plain], Style["What is this song?", 10, Underlined], Style["Not Asian? That's okay! This is 'Tong Hua' by Guang Liang. \ For\ncomparison, here's a link to the official music video:", 10, Plain], Style[Hyperlink["Click here!", "http://www.youtube.com/watch?v=T3Na7ZNoAcE"], 10, Plain], ControlPlacement -> Left, FrameLabel -> {{"", ""}, {"", Style["The Extremist: The Extremely Entertaining Extrema \ Explorer!", 24, Bold]}} ]]