# Quadratic Surface Identification from a Graph # Jason Monschke and Austin Probe 2009 # # This maplet is intended to graphically display different quadratic surfaces with altered parameters and have students identify them. To that end it provides a basic function display window to show the appearance, equation and syntax of 9 basic quadratic surfaces. It also contains a stereo viewing element that can be utilized with 3D glasses, and a configuration window for the colors in this option. # # ################################## # # Header For All Maplets restart: with(Maplets[Elements]):with(Maplets[Tools]): StartEngine(); randomize(): lightorange:="#FFB300": lightcyan:="#DDFFFF": lightblue:="#CFCFFF": lightgreen:="#CCFFCC": darkgreen:="#00C000": ColorBkgd:=wheat: ColorDefaultMenu:=lightcyan: ColorHelpMenu:=lightorange: ColorFileMenu:=pink: ColorFooter:=lightcyan: ColorNewButton:=magenta: # or Make, Save, Enter Problem ColorReturnButton:=magenta: ColorCloseButton:=pink: # or Quit, Clear, Reset, Cancel ColorHintButton:=lightorange: # or Syntax ColorPrevButton:=turquoise: # or Update ColorEnterButton:=turquoise: ColorSimplifyButton:=lightorange: ColorCheckButton:=green: ColorShowButton:=lightorange: ColorPlotButton:=gold: ColorPlotButtonFrgd:=black: ColorPlotFrame:=gold: ColorTableBkgd:=lightgreen: ColorCalculatorBkgd:=gold: ColorBlackBox:=black: ColorBlackBoxFrgd:=yellow: ColorMessage:=white: ColorMessageFrgd:=black: ColorInput:=turquoise: ColorInputFrgd:=black: ColorCorrect:=green: ColorCorrectFrgd:=black: ColorIncorrect:=red: ColorIncorrectFrgd:=white: ColorWarning:=yellow: ColorWarningFrgd:=black: ColorShow:=lightorange: ColorShowFrgd:=black: ColorHint:=lightorange: ColorHintFrgd:=black: # or Info, Syntax ColorDisable:=wheat: ColorDisableFrgd:=black: FontFooter:=Font("helvetica",10): FontSymbol:=Font("symbol",12): FontBig:=Font("times",20): LIBLogo:=cat(libname,"/M4C/M4C.png"): Logo:="M4C.png": #LIBLogo:=cat(libname,"/M4C/WebALT_logo.png"): #Logo:="WebALT_logo.png": # ################################## # # Template Translation Table For All Maplets TEXTLprogrammers:= "Programmers: D.B. Meade & P.B. Yasskin": TEXTLcopyright:= "© Copyright: Maplets for Calculus 2006-10": #"© Copyright: WebALT 2006-07": TEXTLversion:= "M4C v1.3 July 2010": TEXTBQuit:= "Quit": TEXTBClose:= "Close": TEXTBCheck:= "Check": TEXTBShow:= "Show": TEXTBShowAll:= "Show All Steps": TEXTBCheckAns:= "Check Answer": TEXTBShowAns:= "Show Answer": TEXTBInstructions:= "Instructions": TEXTBHint:= "Hint": TEXTBHints:= "Hints": TEXTBSyntax:= "Syntax": TEXTBHintSyntax:= "Hints and Syntax": TEXTBPrev:= "Preview": TEXTBUpdate:= "Update": TEXTBDerivation:= "Derivation": TEXTBNewProblem:= "New Problem": TEXTBNewFunction:= "New Function": TEXTBNewGraph:= "New Graph": TEXTBNewEquation:= "New Equation": TEXTBNewLimit:= "New Limit": TEXTBNewDerivative:= "New Derivative": TEXTBNewIntegral:= "New Integral": TEXTBNewSequence:= "New Sequence": TEXTBNewSeries:= "New Series": TEXTBNewDiffEq:= "New Differential Equation": TEXTBNewCurve:= "New Curve": TEXTBEnterProblem:= "Enter Problem": TEXTBEnterFunction:= "Enter Function": TEXTBEnterGraph:= "Enter Graph": TEXTBEnterEquation:= "Enter Equation": TEXTBEnterLimit:= "Enter Limit": TEXTBEnterDerivative:= "Enter Derivative": TEXTBEnterIntegral:= "Enter Integral": TEXTBEnterSequence:= "Enter Sequence": TEXTBEnterSeries:= "Enter Series": TEXTBEnterDiffEq:= "Enter Differential Equation": TEXTBMake:= "Modify or Make Your Own Problem": TEXTBSaveClose:= "Save Problem and Close": TEXTBAskQuestion:= "Ask Question": TEXTBNextQuestion:= "Next Question": TEXTBHowtoAnswer:= "How to Answer": TEXTBEnter:= "Enter": TEXTBOK:= "OK": TEXTBAccept:= "Accept": TEXTBReturn:= "Return": TEXTBClear:= "Clear": TEXTBClearSelections:= "Clear Selections": TEXTBClearAll:= "Clear All Steps": TEXTBReset:= "Reset": TEXTBRestart:= "Restart": TEXTBCancel:= "Cancel": TEXTBPlot:= "Plot": TEXTBPlotIt:= "Plot It": TEXTBAnimate:= "Animate": TEXTBPlay:= "Play": TEXTBPause:= "Pause": TEXTBForward:= "Forward": TEXTBReverse:= "Reverse": TEXTBStep:= "Step": TEXTBUpdatePlot:= "Update Plot": TEXTBZoomIn:= "Zoom In": TEXTBZoomOut:= "Zoom Out": TEXTBPlotSetup:= "Plot Setup": TEXTBRefresh:= "Refresh": TEXTBCalculate:= "Calculate": TEXTBSimplify:= "Simplify": TEXTBFactor:= "Factor": TEXTBExpand:= "Expand": TEXTBNormalize:= "Normalize": TEXTBCombine:= "Combine": TEXTBRationalize:= "Rationalize": TEXTBSort:= "Sort": TEXTBDecimal:= "Decimal": TEXTBExact:= "Exact": TEXTCorrect:= " correct ": TEXTIncorrect:= "incorrect": TEXTAlmost:= " almost ": TEXTWarning:= " warning ": TEXTShown:= " shown ": TEXTSlower:= "Slower": TEXTFaster:= "Faster": TEXTEnterFormula:= " Enter Formula:": TEXTEvaluate:= " Evaluate:": TEXTApproximate:= " Approximate:": TEXTand:= " and ": TEXTor:= " or ": TEXTThus:= " Thus ": TEXTSo:= " So ": TEXTType:= " Type ": TEXTfor:= " for ": TEXTat:= " at ": TEXTorcheck:= " or check: ": TEXTvertical:= "vertical": TEXThorizontal:= "horizontal": TEXTleft:= "left": TEXTright:= "right": TEXTless:= "less": TEXTgreater:= "greater": TEXTCBDNE:= "does not exist": TEXTCBNone:= "None": TEXTCB11scaling:= "1-1 scaling": TEXTdefault:= " default ": TEXTCBDoNotShow:= "Do not show this window again.": TEXTRBNumeric:= "Numeric": TEXTRBSymbolic:= "Symbolic": TEXTRBTrue:= "True": TEXTRBFalse:= "False": TEXTRBT:= "T": TEXTRBF:= "F": TEXTRBOn:= "On": TEXTRBOff:= "Off": TEXTRed:= "Red": TEXTGreen:= "Green": TEXTBlue:= "Blue": TEXTCyan:= "Cyan": TEXTMagenta:= "Magenta": TEXTYellow:= "Yellow": TEXTRedR:= "R": TEXTGreenG:= "G": TEXTBlueB:= "B": TEXTRBPlot1:= "Plot # 1": TEXTRBPlot2:= "Plot # 2": TEXTRBPlot3:= "Plot # 3": TEXTRBPlot4:= "Plot # 4": TEXTRBPlot5:= "Plot # 5": TEXTRBPlot6:= "Plot # 6": TEXTRBconverge:= "converge": TEXTRBdiverge:= "diverge": TEXTRBconverges:= "converges": TEXTRBdiverges:= "diverges": TEXTRBdiverges2:= "diverges ": TEXTRBconvergent:= "Convergent": TEXTRBdivergent:= "Divergent": TEXTtitlePROBLEM:= "Modify or Make Your Own Problem": TEXTtitlePREVIEW:= "Preview": TEXTtitleHINT:= "Hint": TEXTtitleSYNTAX:= "Syntax": TEXTtitlePlotSetup:= "Plot Setup": TEXTCapGoal:= "Goal:": TEXTCapProbStat:= "Problem Statement:": TEXTCapSyntaxTutorial:= "Syntax Tutorial:": TEXTCapEnter:= "Enter:": TEXTCapSpecify:= "Specify:": TEXTCapTrueFalse:= "True or False?": TEXTCapCalculator:= "Calculator": TEXTCapPlot:= "Plot": TEXTCapLegend:= "Legend": TEXTCapEvaluate:= "Evaluate:": TEXTCapDataTable:= "Data Table": TEXTCapVis:= "Visualization": TEXTCapAnim:= "Animation": TEXTCapPreviewer:= "Previewer": TEXTCapHorRng:= "Horizontal Range:": TEXTxmin:= "xmin =": TEXTxmax:= "xmax =": TEXTCapVertRng:= "Vertical Range:": TEXTymin:= "ymin =": TEXTymax:= "ymax =": TEXTPlotWait:= #Use ColorHint " Please be patient while the plot is generated.": TEXTAnimWait:= " Please be patient while the animation is generated.": TEXTRotatePlot:= " You may rotate the plot with your mouse.": TEXTreplyNoCheck:= " You must enter an expression to be checked.": TEXTreplyNoCheckBoth:= " You must answer both questions before checking.": TEXTreplyNoChecks:= " You must answer all %a questions before checking.": TEXTreplyNoPrev:= " You must enter an expression to be previewed.": TEXTreplyNoSimplify:= " You must enter an expression to be simplified.": TEXTreplyNoFactor:= " You must enter an expression to be factored.": TEXTreplyNoExpand:= " You must enter an expression to be expanded.": TEXTreplyNoNormalize:= " You must enter an expression to be normalized.": TEXTreplyNoModify:= " You must enter an expression to be modified.": TEXTreplyNoPlot:= " Please select a plot.": TEXTreplyNoSelection:= " Please select an answer.": TEXTreplyNoSaveProblem:= " You must fill in all the boxes before saving the problem.": TEXTreplyNoSaveSettings:= " You must fill in all the boxes before saving the settings.": TEXTreplyNoSlider:= " Set the slider to a number between %a and %a": TEXTreplySideEqWrong:= " The %a side of your equation is wrong.": TEXTreplyBothSideEqWrong:= " Both sides of your equation are wrong.": TEXTreplySideIneqWrong:= " The %a side of your inequality is wrong.": TEXTreplyBothSideIneqWrong:= " Both sides of your inequality are wrong.": TEXTreplyNoConst:= " You forgot to add a constant of integration.": TEXTreplyManyConst:= " Your answer should have only one constant of integration.": TEXTreplyMinusErr:= " You have a minus sign error.": DNEset:= {"", undefined, Undefined, UNDEFINED, divergent, Divergent, DIVERGENT, diverges, Diverges, DIVERGES, dne, DNE, doesnotexist, DoesNotExist}: TEXTM_File:= "File": TEXTM_Fns:= "Functions": TEXTCBMI_polygen:= "Polynomials (Generalized)": TEXTCBMI_exp:= "Exponentials": TEXTCBMI_log:= "Logarithms": TEXTCBMI_trig:= "Trigonometric": TEXTCBMI_invtrig:= "Inverse Trigonometric": TEXTCBMI_hyper:= "Hyperbolic": TEXTCBMI_invhyper:= "Inverse Hyperbolic": TEXTCBMI_simpsubst:= "Allow Simple Substitutions": TEXTM_Rules:= "Rules": TEXTCBMI_prod:= "Product Rule": TEXTCBMI_quot:= "Quotient Rule": TEXTCBMI_power:= "Power Rule": TEXTCBMI_chain:= "Chain Rule": TEXTM_Methods:= "Methods": TEXTCBMI_subst:= "Substitution": TEXTCBMI_parts:= "Integration by Parts": TEXTCBMI_trigpow:= "Trigonometric Powers": TEXTCBMI_trigsubst:= "Trigonometric Substitution": TEXTCBMI_trigident:= "Trigonometric Identity": TEXTCBMI_parfrac:= "Partial Fractions": TEXTCBMI_impfrac:= "Improper Fraction": TEXTRBproper:= "only proper integrals": TEXTRBimproper:= "allow improper integrals": TEXTM_RulesProb:= "Rules per Problem": TEXTreply_manyrules:= " Problems which involve too many rules tend to become rather messy.": TEXTM_MaxTerms:= "Max # Terms": TEXTreply_manyterms:= " Problems with large numbers of terms tend to become rather messy.": TEXTM_TermsPoly:= "Terms in Polynomial": TEXTM_PowerProp:= "Power Properties": TEXTCBMI_neg:= "Allow Negatives": TEXTCBMI_frac:= "Allow Fractions": TEXTreply_largepower:= " Problems with large degree polynomials tend to become rather messy.": TEXTM_Help:= "Help": TEXTmenu_start:= "Getting Started": TEXTmenu_custom:= "Customized Problems": TEXTmenu_manip:= "Manipulating Functions": TEXTmenu_about:= "About this maplet": great:=[ " Bullseye.", " Right on the mark.", " Great.", " That's absolutely right.", " Awesome. You're unstoppable.", " Correct.", " WOW, nailed that one.", " You got it!", " YES! Right on.", " Way to go.", " Don't stop now.", " I knew you could do it!", " Perfect. You're unstoppable.", " Radical Dude.", " Power house.", " Sweet! Keep on Rockin'.", " You rock!", " You got those mad skills.", " Awesome!", " Wowzers! That was great!", " Awesome man!", " Good job! You really know what you are doing.", " You're awesome kid.", " Tearing it up.", " Right on the money.", " High Five!!!!!", " Cool Beans.", " What a nerd!", " You're so money.", " You're a genius.", " You hit the nail on the head.", " Excellent!", " If I had a cookie, I'd give it to you.", " You're a winner.", " That's a winner.", " Whoop! Way to go.", " That's the way, ah ha ah ha, I like it.", " Oh yeah!", " You're the bomb!", " That was fantastic!", " Oh Snap!", NULL ]: nextgeneric:=[ " Keep it up.", " Keep going.", NULL ]: nextprob:=[ " On to the next problem.", " Try another problem.", " You're ready for another problem.", NULL ]: nextquest:=[ " On to the next question.", " Try another question.", " You're ready for another question.", NULL ]: nextpart:=[ " On to the next part.", " Try another part.", " You're ready for another part.", NULL ]: nextstep:=[ " On to the next step.", " Try another step.", " You're ready for another step.", NULL ]: nexteq:=[ " On to the next equation.", " Try another equation.", " Solve another equation.", " You're ready for another equation.", NULL ]: nextfn:=[ " On to the next function.", " Try another function.", " You're ready for another function.", NULL ]: nextlim:=[ " On to the next limit.", " Try another limit.", " Compute another limit.", " You're ready for another limit.", " Find another limit.", NULL ]: nextderiv:=[ " On to the next derivative.", " Try another derivative.", " Compute another derivative.", " You're ready for another derivative.", " Differentiate another function.", NULL ]: nextinteg:=[ " On to the next integral.", " Try another integral.", " Compute another integral.", " You're ready for another integral.", " Integrate another function.", NULL ]: nextdiffeq:=[ " On to the next differential equation.", " Try another differential equation.", " You're ready for another differential equation.", " Analyze another differential equation.", NULL ]: nextseq:=[ " On to the next sequence.", " Try another sequence.", " Find the limit of another sequence.", " You're ready for another sequence.", NULL ]: nextser:=[ " On to the next series.", " Try another series.", " Sum another series.", " You're ready for another series.", NULL ]: almost:=[ " Close.", " Oh so close.", " Close call. ", " Near miss.", " Not quite good enough for government work.", " Ooooh...close.", " Yikes! Really close. You'll get it next time.", " Close, but no cigar.", " Slightly off.", " Off by a hair.", " Almost there.", " Almost got it.", NULL ]: sorry:=[ " Sorry, that's not right.", " Nope, but don't give up.", " Not quite, it's a little off.", " Bummer, thought you would get it this time.", " If you need help, please ask a human.", " I don't know where you went wrong.", " Sorry, killer problem.", " No, but don't blow it off.", " D'oh!", " That's whack.", " Thought you would get it this time.", " Nice try, but your answer is wrong.", " Ask your neighbor for help.", " Brutal kid.", " That won't fly.", " So close and yet so far.", " So, that was just practice.", " A swing and a miss.", " Better luck next time.", " Oops.", " Tilt. Play again.", " I know you can do better.", " Sorry Charlie.", " Tisk, tisk. It's a tough one.", " It takes a lot of wrongs to make a right.", " Even Einstein didn't get everything right.", " Today's not your lucky day.", " Don't quit your day job.", " You're colder than a polar bear's toenail.", op(almost), NULL ]: trygeneric:=[ " Fix your answer and check it again.", " Give it another try.", " Try again.", " Please try again.", NULL ]: tryhint:=[ " Try the hints and answer again.", " Read the hints and try again.", " Study the hints and answer again.", NULL ]: tryhelp:=[ " Try the Help menu and answer again.", " Look at the Help menu and try again.", NULL ]: showgeneric:=[ " OK That's just practice. But try doing it yourself.", " That's fine for practice. Try doing it yourself.", " Think about it and enter an answer yourself.", " Next time, compute an answer yourself.", " So that was practice. Try doing it yourself.", NULL ]: showhint:=[ " Next time, try the hints.", " Read the hints and enter an answer yourself.", NULL ]: showhelp:=[ " Next time, read the Help menu.", " Read the Help and enter an answer yourself.", NULL ]: # ################################## # Procs for all maplets. GetVersion:=proc() local S, S1, S3, S4; options `Copyright 2009-10, Philip B. Yasskin and Douglas B. Meade, Maplets for Calculus`; uses StringTools; S:=interface(version); S:=map( Trim, Split( S, "," ) ); S1:=Split(S[1], " " ); S3:=Split(S[3], " " ); S4:=Split(S[-1], " " ); sprintf("%s (%s)", S[2],S3[-1]); end proc: # ################################## # # Customize For Each Maplets with(plots):with(plottools): #with(RandomTools): #alias(e=exp(1)): nextlocal1:=[ " Now enter the equation.", " Next, the equation.", " Now type the equation.", " Next, type the equation.", NULL ]: nextlocal2:=[ " On to the next plot.", " Try another plot.", " Analyze another plot.", " You're ready for another plot.", " On to the next graph.", " Try another graph.", " Analyze another graph.", " You're ready for another graph.", NULL ]: trylocal1:=[ " Look at the sample plots and try again.", " Study the sample plots and try again.", " Look at the Basic 9 Quadratic Surfaces to find the names.", " Study the Basic 9 Quadratic Surfaces to learn their names.", NULL ]: trylocal2:=[ " Look at the sample plots and try again.", " Type the basic function. Then shift and rescale it.", " Replacing x by x-p moves the center to x=p. Try again.", " Replacing y by y-q moves the center to y=q. Try again.", " Replacing z by z-r moves the center to z=r. Try again.", " Look at the Basic 9 Quadratic Surfaces to find the basic equation. Then shift and rescale it.", " Study the Basic 9 Quadratic Surfaces to learn the equations.", NULL ]: showlocal1:=[ " Look at the sample plots and try it yourself.", " Study the sample plots and try it yourself.", " Try doing it yourself. Look at the Basic 9 Quadratic Surfaces to find the names.", " Try doing it yourself. Study the Basic 9 Quadratic Surfaces to learn their names.", NULL ]: showlocal2:=[ " Look at the sample plots and try it yourself.", " Study the sample plots and try it yourself.", " Try doing it yourself. Look at the Basic 9 Quadratic Surfaces to find the basic equation. Then shift and rescale it.", " Try doing it yourself. Study the Basic 9 Quadratic Surfaces to learn the equations.", NULL ]: nexts1:=[ #Keep what is appropriate. This is for all but the last check. op(nextgeneric), #op(nextprob), #op(nextquest), op(nextpart), op(nextstep), op(nextlocal1), op(nextlocal1), NULL ]: nexts2:=[ #Keep what is appropriate. This is for the last check. op(nextgeneric), op(nextprob), op(nextquest), op(nexteq), #op(nextfn), #op(nextlim), #op(nextderiv), #op(nextinteg), #op(nextdiffeq), #op(nextseq), #op(nextser), op(nextlocal2), NULL ]: trys1:=[ #Keep what is appropriate. op(trygeneric), #op(tryhint), #op(tryhelp), op(trylocal1), op(trylocal1), NULL ]: trys2:=[ #Keep what is appropriate. op(trygeneric), #op(tryhint), #op(tryhelp), op(trylocal2), op(trylocal2), NULL ]: shows1:=[ #Keep what is appropriate. op(showgeneric), #op(showhint), #op(showhelp), op(showlocal1), op(showlocal1), NULL ]: shows2:=[ #Keep what is appropriate. op(showgeneric), #op(showhint), #op(showhelp), op(showlocal2), op(showlocal2), NULL ]: randgreat:=rand(1..nops(great)): randnext1:=rand(1..nops(nexts1)): randnext2:=rand(1..nops(nexts2)): randalmost:=rand(1..nops(almost)): randsorry:=rand(1..nops(sorry)): randtry1:=rand(1..nops(trys1)): randtry2:=rand(1..nops(trys2)): randshow1:=rand(1..nops(shows1)): randshow2:=rand(1..nops(shows2)): # ################################### # # English Translation Table For Quadratic Surface TEXTLasstprogrammer:= "Assistant Programmers: Jason Monschke and Austin Probe": TEXTtitleMAIN:= "Quadratic Surface Identification": TEXTtitleStereoConfig:= "Stereo Configuration": TEXTNewQuadSurf:= "Show a Quadratic Surface": TEXTBasicQuadSurf:= "Basic 9 Quadratic Surfaces": TEXTCapConfigPlot:= "Configure Plot Generation": TEXTRestrAxis:= "Restrict the axis to the": TEXTaxis:= "axis.": TEXTRestrCent:= "Restrict the center to (0,0,0).": TEXTRestrScales:= "Restrict scale factors and radii to 1.": TEXTBStereoConfig:= "Stereo Configuration": TEXTAnswerclass:= "Classify the type of quadratic surface:": TEXTAnswereq:= "Enter the equation:": TEXTtitleBASIC:= "Basic 9 Quadratic Surfaces": TEXTBasicGoal:= "Goal: Look at each plot and learn its basic shape:": TEXTBEll:= "Ellipsoid": TEXTBHyp1:= "Hyperboloid of 1 Sheet": TEXTBHyp2:= "Hyperboloid of 2 Sheets": TEXTBCone:= "Cone": TEXTBEllPara:= "Elliptic Paraboloid": TEXTBHypPara:= "Hyperbolic Paraboloid": TEXTBEllCyl:= "Elliptic Cylinder": TEXTBHypCyl:= "Hyperbolic Cylinder": TEXTBParaCyl:= "Parabolic Cylinder": TEXTSelAxis:= "Select axis:": TEXTstereo:= "Stereo": TEXTSelColor:= "Select a color for each eye from the drop-down box or adjust the sliders.": TEXTlefteye:= "Left Eye": TEXTrighteye:= "Right Eye": TEXTreply0:= " First study the Basic 9 Quadratic Surfaces to learn their names and equations. Then click on Show a Quadratic Surface to see one of the surfaces with altered parameters.": TEXTreply1:= " This is the graph of one of the basic 9 quadratic surfaces with altered parameters. All parameters are small integers. Enter its type and equation above.": TEXTreply2mono:= " The new plot shows the ORIGINAL quadratic surface in BLUE and YOUR ANSWER in RED.\n Modify your answer and Check your answer again.": TEXTreply2stereo:= " The new plot shows the ORIGINAL quadratic surface and YOUR ANSWER. Modify your answer and Check your answer again.": TEXTreplyNotPoly:= " Your response must be expressed as a polynomial equation involving x, y, and z.": TEXTreplyNotQuad:= " Your answer is not a quadratic polynomial in x, y, and z.": TEXTfmtBadCoef:= " There is an error in at least %a of the coefficients in your response.": # ################################## func:=[ #ellipsoid (x-x_shift)^2/x_radius^2+(y-y_shift)^2/y_radius^2+(z-z_shift)^2/z_radius^2=1, #hyperboloid of 1 sheet -(x-x_shift)^2/x_radius^2+(y-y_shift)^2/y_radius^2+(z-z_shift)^2/z_radius^2=1, (x-x_shift)^2/x_radius^2-(y-y_shift)^2/y_radius^2+(z-z_shift)^2/z_radius^2=1, (x-x_shift)^2/x_radius^2+(y-y_shift)^2/y_radius^2-(z-z_shift)^2/z_radius^2=1, #hyperboloid of 2 sheets (x-x_shift)^2/x_radius^2-(y-y_shift)^2/y_radius^2-(z-z_shift)^2/z_radius^2=1, -(x-x_shift)^2/x_radius^2+(y-y_shift)^2/y_radius^2-(z-z_shift)^2/z_radius^2=1, -(x-x_shift)^2/x_radius^2-(y-y_shift)^2/y_radius^2+(z-z_shift)^2/z_radius^2=1, #cone (x-x_shift)^2/x_radius^2-(y-y_shift)^2/y_radius^2-(z-z_shift)^2/z_radius^2=0, -(x-x_shift)^2/x_radius^2+(y-y_shift)^2/y_radius^2-(z-z_shift)^2/z_radius^2=0, -(x-x_shift)^2/x_radius^2-(y-y_shift)^2/y_radius^2+(z-z_shift)^2/z_radius^2=0, #elliptic paraboloid x=x_shift+(y-y_shift)^2/y_radius^2+(z-z_shift)^2/z_radius^2, x=x_shift-(y-y_shift)^2/y_radius^2-(z-z_shift)^2/z_radius^2, y=y_shift+(x-x_shift)^2/x_radius^2+(z-z_shift)^2/z_radius^2, y=y_shift-(x-x_shift)^2/x_radius^2-(z-z_shift)^2/z_radius^2, z=z_shift+(x-x_shift)^2/x_radius^2+(y-y_shift)^2/y_radius^2, z=z_shift-(x-x_shift)^2/x_radius^2-(y-y_shift)^2/y_radius^2, #hyperbolic paraboloid x=x_shift+(y-y_shift)^2/y_radius^2-(z-z_shift)^2/z_radius^2, x=x_shift-(y-y_shift)^2/y_radius^2+(z-z_shift)^2/z_radius^2, y=y_shift+(x-x_shift)^2/x_radius^2-(z-z_shift)^2/z_radius^2, y=y_shift-(x-x_shift)^2/x_radius^2+(z-z_shift)^2/z_radius^2, z=z_shift+(x-x_shift)^2/x_radius^2-(y-y_shift)^2/y_radius^2, z=z_shift-(x-x_shift)^2/x_radius^2+(y-y_shift)^2/y_radius^2, #elliptic cylinder (y-y_shift)^2/y_radius^2+(z-z_shift)^2/z_radius^2=1, (x-x_shift)^2/x_radius^2+(z-z_shift)^2/z_radius^2=1, (x-x_shift)^2/x_radius^2+(y-y_shift)^2/y_radius^2=1, #hyperbolic cylinder (y-y_shift)^2/y_radius^2-(z-z_shift)^2/z_radius^2=1, -(y-y_shift)^2/y_radius^2+(z-z_shift)^2/z_radius^2=1, (x-x_shift)^2/x_radius^2-(z-z_shift)^2/z_radius^2=1, -(x-x_shift)^2/x_radius^2+(z-z_shift)^2/z_radius^2=1, (x-x_shift)^2/x_radius^2-(y-y_shift)^2/y_radius^2=1, -(x-x_shift)^2/x_radius^2+(y-y_shift)^2/y_radius^2=1, #parabolic cylinder y=y_shift+(z-z_shift)^2/z_radius^2, y=y_shift-(z-z_shift)^2/z_radius^2, z=z_shift+(y-y_shift)^2/y_radius^2, z=z_shift-(y-y_shift)^2/y_radius^2, x=x_shift+(z-z_shift)^2/z_radius^2, x=x_shift-(z-z_shift)^2/z_radius^2, z=z_shift+(x-x_shift)^2/x_radius^2, z=z_shift-(x-x_shift)^2/x_radius^2, x=x_shift+(y-y_shift)^2/y_radius^2, x=x_shift-(y-y_shift)^2/y_radius^2, y=y_shift+(x-x_shift)^2/x_radius^2, y=y_shift-(x-x_shift)^2/x_radius^2 ]: basicfunc[1,1]:=eval(func[1], [x_shift=0, y_shift=0, z_shift=0, x_radius=4, y_radius=3, z_radius=2]): basicfunc[1,2]:=eval(func[1], [x_shift=0, y_shift=0, z_shift=0, x_radius=3, y_radius=4, z_radius=2]): basicfunc[1,3]:=eval(func[1], [x_shift=0, y_shift=0, z_shift=0, x_radius=3, y_radius=2, z_radius=4]): basicfunc[2,1]:=eval(func[2], [x_shift=0, y_shift=0, z_shift=0, x_radius=1, y_radius=1, z_radius=1]): basicfunc[2,2]:=eval(func[3], [x_shift=0, y_shift=0, z_shift=0, x_radius=1, y_radius=1, z_radius=1]): basicfunc[2,3]:=eval(func[4], [x_shift=0, y_shift=0, z_shift=0, x_radius=1, y_radius=1, z_radius=1]): basicfunc[3,1]:=eval(func[5], [x_shift=0, y_shift=0, z_shift=0, x_radius=1, y_radius=1, z_radius=1]): basicfunc[3,2]:=eval(func[6], [x_shift=0, y_shift=0, z_shift=0, x_radius=1, y_radius=1, z_radius=1]): basicfunc[3,3]:=eval(func[7], [x_shift=0, y_shift=0, z_shift=0, x_radius=1, y_radius=1, z_radius=1]): basicfunc[4,1]:=eval(func[8], [x_shift=0, y_shift=0, z_shift=0, x_radius=1, y_radius=1, z_radius=1]): basicfunc[4,2]:=eval(func[9], [x_shift=0, y_shift=0, z_shift=0, x_radius=1, y_radius=1, z_radius=1]): basicfunc[4,3]:=eval(func[10], [x_shift=0, y_shift=0, z_shift=0, x_radius=1, y_radius=1, z_radius=1]): basicfunc[5,1]:=eval(func[11], [x_shift=0, y_shift=0, z_shift=0, x_radius=1, y_radius=4, z_radius=3]): basicfunc[5,2]:=eval(func[13], [x_shift=0, y_shift=0, z_shift=0, x_radius=4, y_radius=1, z_radius=3]): basicfunc[5,3]:=eval(func[15], [x_shift=0, y_shift=0, z_shift=0, x_radius=4, y_radius=3, z_radius=1]): basicfunc[6,1]:=eval(func[17], [x_shift=0, y_shift=0, z_shift=0, x_radius=1, y_radius=1, z_radius=1]): basicfunc[6,2]:=eval(func[19], [x_shift=0, y_shift=0, z_shift=0, x_radius=1, y_radius=1, z_radius=1]): basicfunc[6,3]:=eval(func[21], [x_shift=0, y_shift=0, z_shift=0, x_radius=1, y_radius=1, z_radius=1]): basicfunc[7,1]:=eval(func[23], [x_shift=0, y_shift=0, z_shift=0, x_radius=1, y_radius=4, z_radius=3]): basicfunc[7,2]:=eval(func[24], [x_shift=0, y_shift=0, z_shift=0, x_radius=4, y_radius=1, z_radius=3]): basicfunc[7,3]:=eval(func[25], [x_shift=0, y_shift=0, z_shift=0, x_radius=4, y_radius=3, z_radius=1]): basicfunc[8,1]:=eval(func[26], [x_shift=0, y_shift=0, z_shift=0, x_radius=1, y_radius=1, z_radius=1]): basicfunc[8,2]:=eval(func[28], [x_shift=0, y_shift=0, z_shift=0, x_radius=1, y_radius=1, z_radius=1]): basicfunc[8,3]:=eval(func[30], [x_shift=0, y_shift=0, z_shift=0, x_radius=1, y_radius=1, z_radius=1]): basicfunc[9,1]:=eval(func[32], [x_shift=0, y_shift=0, z_shift=0, x_radius=1, y_radius=1, z_radius=1]): basicfunc[9,2]:=eval(func[38], [x_shift=0, y_shift=0, z_shift=0, x_radius=1, y_radius=1, z_radius=1]): basicfunc[9,3]:=eval(func[40], [x_shift=0, y_shift=0, z_shift=0, x_radius=1, y_radius=1, z_radius=1]): randshift:=rand(-3..3): randradius:=rand(1..3): RR:=0: GR:=1: BR:=1: RL:=1: GL:=0: BL:=0: plot0:=plot3d(-6, x=-5..5,y=-5..5,view=-5..5, color=white, style=surface, scaling=constrained, tickmarks=[[$-5..5],[$-5..5],[$-5..5]], grid=[2,2], axes=normal, orientation=[30,75]): StereoOpts:=x=(-rng+x_shift)..(rng+x_shift), y=(-rng+y_shift)..(rng+y_shift), z=(-rng+z_shift)..(rng+z_shift), style=wireframe, scaling=constrained, gridstyle=rectangular, grid=[15,15,15], axes=normal, orientation=[30,75]: MonoOpts:=x=(-rng+x_shift)..(rng+x_shift), y=(-rng+y_shift)..(rng+y_shift), z=(-rng+z_shift)..(rng+z_shift), style=surfacewireframe, transparency=.5, glossiness=1, light=[30,60,1,1,1], scaling=constrained, gridstyle=rectangular, grid=[15,15,15], axes=normal, orientation=[30,75]: BasicStereoOpts:=x=-5..5, y=-5..5, z=-5..5, style=wireframe, scaling=constrained, gridstyle=rectangular, grid=[15,15,15], axes=normal, orientation=[30,75]: BasicMonoOpts:=x=-5..5, y=-5..5, z=-5..5, style=surfacewireframe, transparency=.1, glossiness=1, light=[30,60,1,1,1], scaling=constrained, gridstyle=rectangular, grid=[15,15,15], axes=normal, orientation=[30,75]: New_QuadSurf:=proc() global x, y, z, x_shift, y_shift, z_shift, x_radius, y_radius, z_radius, funcnum, quadeq, rng, eqcorrect; options `Copyright 2002-09, Philip B. Yasskin and Douglas B. Meade, Maplets for Calculus`; if Get(CBcenter) then x_shift,y_shift,z_shift:=0,0,0: else x_shift:=randshift(): y_shift:=randshift(): z_shift:=randshift(): end if; if Get(CBscales) then x_radius,y_radius,z_radius:=1,1,1: else x_radius:=randradius(): y_radius:=randradius(): z_radius:=randradius(): end if; if Get(CBaxis) and Get(DDBaxis)="x" then funcnum:=RandomTools[Generate](choose([ 1,1,1,1,2,2,2,2,5,5,5,5, 8,8,8,8,11,11,12,12,17,17,18,18, 23,23,23,23,26,26,27,27,32,33,34,35])); elif Get(CBaxis) and Get(DDBaxis)="y" then funcnum:=RandomTools[Generate](choose([ 1,1,1,1,3,3,3,3,6,6,6,6, 9,9,9,9,13,13,14,14,19,19,20,20, 24,24,24,24,28,28,29,29,36,37,38,39])); elif Get(CBaxis) and Get(DDBaxis)="z" then funcnum:=RandomTools[Generate](choose([ 1,1,1,1,4,4,4,4,7,7,7,7, 10,10,10,10,15,15,16,16,21,21,22,22, 25,25,25,25,30,30,31,31,40,41,42,43])); else funcnum:=RandomTools[Generate](choose([ 1,1,1,1,1,1,1,1,1,1,1,1, 2,2,2,2,3,3,3,3,4,4,4,4, 5,5,5,5,6,6,6,6,7,7,7,7, 8,8,8,8,9,9,9,9,10,10,10,10, 11,11,12,12,13,13,14,14,15,15,16,16, 17,17,18,18,19,19,20,20,21,21,22,22, 23,23,23,23,24,24,24,24,25,25,25,25, 26,26,27,27,28,28,29,29,30,30,31,31, 32,33,34,35,36,37,38,39,40,41,42,43])); end if; quadeq:=func[funcnum]; rng:=`if`(funcnum in [1,11,12,13,14,15,16,23,24,25], 5, 7); eqcorrect:=FAIL; MainPlot(); Set(reply=TEXTreply1, reply(background)=ColorMessage, reply(foreground)=ColorMessageFrgd): Set(DDBclass=" "): Set(BclassCk(enabled)=true, BclassCk(background)=ColorCheckButton); Set(MRclass="", MRclass(background)=ColorMessage): Set(BclassSh(enabled)=true, BclassSh(background)=ColorShowButton); Set(TFeq=""): Set(BeqCk(enabled)=true, BeqCk(background)=ColorCheckButton); Set(MReq="", MReq(background)=ColorMessage): Set(BeqSh(enabled)=true, BeqSh(background)=ColorShowButton); end proc: MainPlot:=proc() global quadeq, usereq, rng, x_shift, y_shift, z_shift, p1, p1G, eqcorrect; local pleft, pright, p2; options `Copyright 2002-09, Philip B. Yasskin and Douglas B. Meade, Maplets for Calculus`; if Get(RBStereo) then pleft:=implicitplot3d(quadeq, StereoOpts, color=COLOR(RGB,RL,GL,BL)); pright:=implicitplot3d(quadeq, StereoOpts, color=COLOR(RGB,RR,GR,BR)); p1:=display([rotate(pright,0,0,Pi/72),pleft]): p1G:=p1; else p1:=implicitplot3d(quadeq, MonoOpts, color=blue); p1G:=implicitplot3d(quadeq, MonoOpts, color=green); end if; if eqcorrect=FAIL then Set(PL1=display(p1)): elif eqcorrect then Set(PL1=display(p1G)): else if Get(RBStereo) then pleft:=implicitplot3d(usereq, StereoOpts, color=COLOR(RGB,RL,GL,BL)); pright:=implicitplot3d(usereq, StereoOpts, color=COLOR(RGB,RR,GR,BR)); p2:=display([rotate(pright,0,0,Pi/72),pleft]): else p2:=implicitplot3d(usereq, MonoOpts, color=red); end if; Set(PL1=display(p1,p2)): end if; end proc: CBAxisOnOff:=proc() options `Copyright 2006-09, Philip B. Yasskin and Douglas B. Meade, Maplets for Calculus`; if not Get(CBaxis) then Set(DDBaxis=" "); elif Get(DDBaxis)=" " then Set(DDBaxis="z"); end if; end proc: DDBAxisOnOff:=proc() options `Copyright 2006-09, Philip B. Yasskin and Douglas B. Meade, Maplets for Calculus`; if Get(DDBaxis)=" " then Set(CBaxis=false); else Set(CBaxis=true); end if; end proc: Check_class:=proc() global funcnum; local userclass; options `Copyright 2002-09, Philip B. Yasskin and Douglas B. Meade, Maplets for Calculus`; if Get(DDBclass)=" " then Set(MRclass=TEXTWarning, MRclass(background)=ColorWarning, MRclass(foreground)=ColorWarningFrgd); Set(reply=TEXTreplyNoSelection, reply(background)=ColorWarning, reply(foreground)=ColorWarningFrgd); return; end if; userclass:=Get(DDBclass): if funcnum=1 and userclass=TEXTBEll or funcnum in {2,3,4} and userclass=TEXTBHyp1 or funcnum in {5,6,7} and userclass=TEXTBHyp2 or funcnum in {8,9,10} and userclass=TEXTBCone or funcnum in {11,12,13,14,15,16} and userclass=TEXTBEllPara or funcnum in {17,18,19,20,21,22} and userclass=TEXTBHypPara or funcnum in {23,24,25} and userclass=TEXTBEllCyl or funcnum in {26,27,28,29,30,31} and userclass=TEXTBHypCyl or funcnum in {32,33,34,35,36,37,38,39,40,41,42,43} and userclass=TEXTBParaCyl then Set(MRclass=TEXTCorrect, MRclass(background)=ColorCorrect, MRclass(foreground)=ColorCorrectFrgd); Set(reply=cat(great[randgreat()], nexts1[randnext1()]), reply(background)=ColorCorrect, reply(foreground)=ColorCorrectFrgd): else Set(MRclass=TEXTIncorrect, MRclass(background)=ColorIncorrect, MRclass(foreground)=ColorIncorrectFrgd); Set(reply=cat(sorry[randsorry()], trys1[randtry1()]), reply(background)=ColorIncorrect, reply(foreground)=ColorIncorrectFrgd): end if; end proc: Show_class:=proc() global funcnum; options `Copyright 2002-09, Philip B. Yasskin and Douglas B. Meade, Maplets for Calculus`; if funcnum=1 then Set(DDBclass=TEXTBEll): elif funcnum in {2,3,4} then Set(DDBclass=TEXTBHyp1): elif funcnum in {5,6,7} then Set(DDBclass=TEXTBHyp2): elif funcnum in {8,9,10} then Set(DDBclass=TEXTBCone): elif funcnum in {11,12,13,14,15,16} then Set(DDBclass=TEXTBEllPara): elif funcnum in {17,18,19,20,21,22} then Set(DDBclass=TEXTBHypPara): elif funcnum in {23,24,25} then Set(DDBclass=TEXTBEllCyl): elif funcnum in {26,27,28,29,30,31} then Set(DDBclass=TEXTBHypCyl): elif funcnum in {32,33,34,35,36,37,38,39,40,41,42,43} then Set(DDBclass=TEXTBParaCyl): end if; Set(MRclass=TEXTShown, MRclass(background)=ColorShow, MRclass(foreground)=ColorShowFrgd); Set(reply=shows1[randshow1()], reply(background)=ColorShow, reply(foreground)=ColorShowFrgd): end proc: Check_eq:=proc() global quadeq, usereq, eqcorrect, rng, x_shift, y_shift, z_shift, p1, p1G; local GetCoeffs, MyDivide, quadfunc, userfunc, reason, ratios, pleft, pright, p2; options `Copyright 2002-09, Philip B. Yasskin and Douglas B. Meade, Maplets for Calculus`; GetCoeffs:=eq -> [ tcoeff(eq,[x,y,z]), map2( coeff, collect(expand(eq),[x,y,z]), [x,y,z,x^2,y^2,z^2] )[] ]; #MyDivide:=(a,b) -> `if`( b<>0, a/b, `if`(a<>0,false,NULL) ); MyDivide:=(a,b) -> `if`( b<>0, identify(fnormal(evalf[6](a/b),4)), `if`(a<>0,false,NULL) ); #MyDivide:=(a,b) -> `if`( b<>0, evalf(a/b)*1.0000000000, `if`(a<>0,false,NULL) ); if Get(TFeq)="" then Set(MReq=TEXTWarning, MReq(background)=ColorWarning, MReq(foreground)=ColorWarningFrgd); Set(reply=TEXTreplyNoCheck, reply(background)=ColorWarning, reply(foreground)=ColorWarningFrgd); return; end if; usereq:=Get(TFeq::equation, corrections=true, update=true): quadfunc:=lhs(quadeq)-rhs(quadeq); userfunc:=lhs(usereq)-rhs(usereq); if not userfunc::polynom(anything,[x,y,z]) then eqcorrect:=false; reason:=TEXTreplyNotPoly; elif degree(userfunc,{x,y,z})<>2 then eqcorrect:=false; reason:=TEXTreplyNotQuad; else try ratios := zip( MyDivide, GetCoeffs(userfunc), GetCoeffs(quadfunc) ); if nops( {ratios[]} ) = 1 then eqcorrect:=true; else eqcorrect:=false; reason:=sprintf(TEXTfmtBadCoef, max(nops({ratios[]})-1,1)); end if; catch: eqcorrect:=false; reason:=TEXTreplyNotPoly; end try; end if; if eqcorrect then Set(MReq=TEXTCorrect, MReq(background)=ColorCorrect, MReq(foreground)=ColorCorrectFrgd); Set(reply=cat(great[randgreat()], nexts2[randnext2()]), reply(background)=ColorCorrect, reply(foreground)=ColorCorrectFrgd): Set(PL1=display(p1G)): else Set(MReq=TEXTIncorrect, MReq(background)=ColorIncorrect, MReq(foreground)=ColorIncorrectFrgd); if Get(RBStereo) then Set(reply=cat(sorry[randsorry()], reason, TEXTreply2stereo, trys2[randtry2()]), reply(background)=ColorIncorrect, reply(foreground)=ColorIncorrectFrgd): pleft:=implicitplot3d(usereq, StereoOpts, color=COLOR(RGB,RL,GL,BL)); pright:=implicitplot3d(usereq, StereoOpts, color=COLOR(RGB,RR,GR,BR)); p2:=display([rotate(pright,0,0,Pi/72),pleft]): else Set(reply=cat(sorry[randsorry()], reason, TEXTreply2mono, trys2[randtry2()]), reply(background)=ColorIncorrect, reply(foreground)=ColorIncorrectFrgd): p2:=implicitplot3d(usereq, MonoOpts, color=red); end if; Set(PL1=display(p1,p2)): end if; end proc: Show_eq:=proc() global quadeq; options `Copyright 2002-09, Philip B. Yasskin and Douglas B. Meade, Maplets for Calculus`; Set(TFeq=quadeq): Set(MReq=TEXTShown, MReq(background)=ColorShow, MReq(foreground)=ColorShowFrgd); Set(reply=shows2[randshow2()], reply(background)=ColorShow, reply(foreground)=ColorShowFrgd): end proc: BasicPlot:=proc(n) global BasicSurfType, RR,GR,BR,RL,GL,BL; local Axisxyz, Axis123, EQ, pleft, pright, pmono: options `Copyright 2006-09, Philip B. Yasskin and Douglas B. Meade, Maplets for Calculus`; if n<>0 then BasicSurfType:=n: end if; Axisxyz:=Get(DDBBasicAxis): if Axisxyz="x" then Axis123:=1; elif Axisxyz="y" then Axis123:=2; else Axis123:=3; end if; EQ:=basicfunc[BasicSurfType,Axis123]: if Get(RBStereo) then pleft:=implicitplot3d(EQ, BasicStereoOpts, color=COLOR(RGB,RL,GL,BL)); pright:=implicitplot3d(EQ, BasicStereoOpts, color=COLOR(RGB,RR,GR,BR)); Set(PL2=display([rotate(pright,0,0,Pi/72),pleft])): else pmono:=implicitplot3d(EQ, BasicMonoOpts, color=blue); Set(PL2=display(pmono)): end if: Set(TFSyntax=EQ): Set(MMLSyntax(value)=MathML[Export](EQ)): end proc: ColorComplement[TEXTRed]:=TEXTCyan: ColorComplement[TEXTGreen]:=TEXTMagenta: ColorComplement[TEXTBlue]:=TEXTYellow: ColorComplement[TEXTCyan]:=TEXTRed: ColorComplement[TEXTMagenta]:=TEXTGreen: ColorComplement[TEXTYellow]:=TEXTBlue: leftdropdown:=proc() global RL,GL,BL,RR,GR,BR; local LColor; options `Copyright 2009, Philip B. Yasskin and Douglas B. Meade, Maplets for Calculus`; LColor:=Get(DDBL); Set(DDBR=ColorComplement[LColor]); if LColor in {TEXTRed,TEXTYellow,TEXTMagenta} then Set(SL1=100); RL:=1; Set(SR1=0); RR:=0; else Set(SL1=0); RL:=0; Set(SR1=100); RR:=1; end if; if LColor in {TEXTGreen,TEXTCyan,TEXTYellow} then Set(SL2=100); GL:=1; Set(SR2=0); GR:=0; else Set(SL2=0); GL:=0; Set(SR2=100); GR:=1; end if; if LColor in {TEXTBlue,TEXTMagenta,TEXTCyan} then Set(SL3=100); BL:=1; Set(SR3=0); BR:=0; else Set(SL3=0); BL:=0; Set(SR3=100); BR:=1; end if; Set(Lcol=plot3d(0,x=-10..10,y=-10..10 ,style=patchnogrid, color=[RL,GL,BL])); Set(Rcol=plot3d(0,x=-10..10,y=-10..10 ,style=patchnogrid, color=[RR,GR,BR])); end proc: leftcolor:=proc() global RL,GL,BL,RR,GR,BR; local Rmatch; options `Copyright 2009, Philip B. Yasskin and Douglas B. Meade, Maplets for Calculus`; RL:=Get(SL1)/100.0; GL:=Get(SL2)/100.0; BL:=Get(SL3)/100.0; Set(Lcol=plot3d(0,x=-10..10,y=-10..10 ,style=patchnogrid, color=[RL,GL,BL])); Rmatch:=false; if [RL,GL,BL]=[1.000000000,0.000000000,0.000000000] then Set(DDBL=TEXTRed); Rmatch:=true; elif [RL,GL,BL]=[0.000000000,1.000000000,0.000000000] then Set(DDBL=TEXTGreen); Rmatch:=true; elif [RL,GL,BL]=[0.000000000,0.000000000,1.000000000] then Set(DDBL=TEXTBlue); Rmatch:=true; elif [RL,GL,BL]=[0.000000000,1.000000000,1.000000000] then Set(DDBL=TEXTCyan); Rmatch:=true; elif [RL,GL,BL]=[1.000000000,0.000000000,1.000000000] then Set(DDBL=TEXTMagenta); Rmatch:=true; elif [RL,GL,BL]=[1.000000000,1.000000000,0.000000000] then Set(DDBL=TEXTYellow); Rmatch:=true; else Set(DDBL=" "); end if; if Rmatch then RR,GR,BR:=1-RL,1-GL,1-BL; Set(Rcol=plot3d(0,x=-10..10,y=-10..10 ,style=patchnogrid, color=[RR,GR,BR])); Set(DDBR=ColorComplement[Get(DDBL)]); Set(SR1=round(100*RR)); Set(SR2=round(100*GR)); Set(SR3=round(100*BR)); end if; end proc: rightdropdown:=proc() global RR,GR,BR; local RColor; options `Copyright 2009, Philip B. Yasskin and Douglas B. Meade, Maplets for Calculus`; RColor:=Get(DDBR); if RColor in {TEXTRed,TEXTYellow,TEXTMagenta} then Set(SR1=100); RR:=1; else Set(SR1=0); RR:=0; end if; if RColor in {TEXTGreen,TEXTCyan,TEXTYellow} then Set(SR2=100); GR:=1; else Set(SR2=0); GR:=0; end if; if RColor in {TEXTBlue,TEXTMagenta,TEXTCyan} then Set(SR3=100); BR:=1; else Set(SR3=0); BR:=0; end if; Set(Rcol=plot3d(0,x=-10..10,y=-10..10 ,style=patchnogrid, color=[RR,GR,BR])); end proc: rightcolor:=proc() global RR,GR,BR; options `Copyright 2009, Philip B. Yasskin and Douglas B. Meade, Maplets for Calculus`; RR:=Get(SR1)/100.0; GR:=Get(SR2)/100.0; BR:=Get(SR3)/100.0; Set(Rcol=plot3d(0,x=-10..10,y=-10..10 ,style=patchnogrid, color=[RR,GR,BR])); if [RR,GR,BR]=[1.000000000,0.000000000,0.000000000] then Set(DDBR=TEXTRed); elif [RR,GR,BR]=[0.000000000,1.000000000,0.000000000] then Set(DDBR=TEXTGreen); elif [RR,GR,BR]=[0.000000000,0.000000000,1.000000000] then Set(DDBR=TEXTBlue); elif [RR,GR,BR]=[0.000000000,1.000000000,1.000000000] then Set(DDBR=TEXTCyan); elif [RR,GR,BR]=[1.000000000,0.000000000,1.000000000] then Set(DDBR=TEXTMagenta); elif [RR,GR,BR]=[1.000000000,1.000000000,0.000000000] then Set(DDBR=TEXTYellow); else Set(DDBR=" "); end if; end proc: UpdatePlots:=proc() global BasicSurfType; options `Copyright 2009, Philip B. Yasskin and Douglas B. Meade, Maplets for Calculus`; if funcnum<>'funcnum' then MainPlot() end if; if BasicSurfType<>'BasicSurfType' then BasicPlot(BasicSurfType) end if; end proc: QuadSurf:=Maplet(onstartup=RunWindow(MAIN), Window[MAIN]( title=TEXTtitleMAIN, defaultbutton=BeqCk, [ halign=none, background=ColorBkgd, inset=0, spacing=0, [ halign=none, background=ColorBkgd, inset=0, spacing=0, [ halign=none, background=ColorBkgd, inset=0, Button(TEXTNewQuadSurf, width=180, Evaluate(function="New_QuadSurf"), background=ColorNewButton), Button(TEXTBasicQuadSurf, width=180, RunWindow(BASIC), background=ColorHintButton), BoxColumn( halign=none, valign=none, background=ColorBkgd, border=true, caption=TEXTCapConfigPlot, [ halign=none, background=ColorBkgd, inset=0, CheckBox[CBaxis](false, background=ColorBkgd, Evaluate(function="CBAxisOnOff")), TEXTRestrAxis, DropDownBox[DDBaxis](" ", ["x","y","z"," "], width=40, Evaluate(function="DDBAxisOnOff")), TEXTaxis, HorizontalGlue() ], [ halign=none, background=ColorBkgd, inset=0, CheckBox[CBcenter](false, background=ColorBkgd), TEXTRestrCent, HorizontalGlue() ], [ halign=none, background=ColorBkgd, inset=0, CheckBox[CBscales](false, background=ColorBkgd), Label(TEXTRestrScales, halign=left), HorizontalGlue() ], Button(TEXTBStereoConfig, RunWindow(Config), background=ColorHintButton) ), BoxColumn( halign=none, valign=none, background=ColorBkgd, border=true, caption=TEXTAnswerclass, [ halign=none, background=ColorBkgd, inset=0, DropDownBox[DDBclass](" ", [ " ", TEXTBEll, TEXTBHyp1, TEXTBHyp2, TEXTBCone, TEXTBEllPara, TEXTBHypPara, TEXTBEllCyl, TEXTBHypCyl, TEXTBParaCyl ], width=175, background=ColorInput) ], [ halign=none, background=ColorBkgd, inset=0, HorizontalGlue(), Button[BclassCk](TEXTBCheck, Evaluate(function="Check_class"), enabled=false, background=ColorDisable), TextField[MRclass](width=6, editable=false, background=ColorMessage), Button[BclassSh](TEXTBShow, Evaluate(function="Show_class"), enabled=false, background=ColorDisable), HorizontalGlue() ] ) ], [ halign=none, valign=none, background=ColorBkgd, inset=2, spacing=0, [ halign=none, background=ColorBkgd, HorizontalGlue(), Button(TEXTBQuit, Shutdown(), background=ColorCloseButton) ], BoxColumn( halign=none, background=ColorBkgd, inset=0, spacing=0, border=true, caption=TEXTCapPlot, [ halign=none, background=ColorPlotFrame, inset=0, spacing=0, border=true, Plotter[PL1](plot0, width=300, height=300) ], TEXTRotatePlot ) ] ], [ halign=none, background=ColorBkgd, border=true, caption=TEXTAnswereq, TextField[TFeq](width=40, background=ColorInput), HorizontalGlue(), Button[BeqCk](TEXTBCheck, Evaluate(function="Check_eq"), enabled=false, background=ColorDisable), TextField[MReq](width=6, editable=false, background=ColorMessage), Button[BeqSh](TEXTBShow, Evaluate(function="Show_eq"), enabled=false, background=ColorDisable) ], BoxRow( halign=none, background=ColorBkgd, TextBox[reply](TEXTreply0, width=60, height=3, editable=false, background=ColorMessage), Label(Image(Logo)), Label(Image(LIBLogo)) ), BoxColumn( halign=none, background=ColorFooter, inset=0, spacing=0, [ background=ColorFooter, inset=0, spacing=0, Label(TEXTLprogrammers, font=FontFooter), HorizontalGlue(), Label(TEXTLcopyright, font=FontFooter), HorizontalGlue(), Label(TEXTLversion, font=FontFooter) ], [ background=ColorFooter, inset=0, spacing=0, Label(TEXTLasstprogrammer, font=FontFooter), HorizontalGlue(), Label(GetVersion(), font=FontFooter) ] ) ]), Window[BASIC]( title=TEXTtitleBASIC, [ halign=none, background=ColorBkgd, inset=0, spacing=0, [ halign=none, background=ColorBkgd, TEXTBasicGoal, HorizontalGlue(), Button(TEXTBStereoConfig, RunWindow(Config), background=ColorHintButton), Button(TEXTBClose, CloseWindow(BASIC), background=ColorCloseButton) ], [ halign=none, background=ColorBkgd, inset=0, [ halign=none, valign=none, background=ColorBkgd, border=true, caption=TEXTtitleBASIC, Button(TEXTBEll, width=150, Evaluate(function="BasicPlot(1)"), background=ColorPlotButton, foreground=ColorPlotButtonFrgd), Button(TEXTBHyp1, width=150, Evaluate(function="BasicPlot(2)"), background=ColorPlotButton, foreground=ColorPlotButtonFrgd), Button(TEXTBHyp2, width=150, Evaluate(function="BasicPlot(3)"), background=ColorPlotButton, foreground=ColorPlotButtonFrgd), Button(TEXTBCone, width=150, Evaluate(function="BasicPlot(4)"), background=ColorPlotButton, foreground=ColorPlotButtonFrgd), Button(TEXTBEllPara, width=150, Evaluate(function="BasicPlot(5)"), background=ColorPlotButton, foreground=ColorPlotButtonFrgd), Button(TEXTBHypPara, width=150, Evaluate(function="BasicPlot(6)"), background=ColorPlotButton, foreground=ColorPlotButtonFrgd), Button(TEXTBEllCyl, width=150, Evaluate(function="BasicPlot(7)"), background=ColorPlotButton, foreground=ColorPlotButtonFrgd), Button(TEXTBHypCyl, width=150, Evaluate(function="BasicPlot(8)"), background=ColorPlotButton, foreground=ColorPlotButtonFrgd), Button(TEXTBParaCyl, width=150, Evaluate(function="BasicPlot(9)"), background=ColorPlotButton, foreground=ColorPlotButtonFrgd), [ halign=none, background=ColorBkgd, TEXTSelAxis, DropDownBox[DDBBasicAxis]("z", ["x","y", "z"], width=50, Evaluate(function="BasicPlot(0)")) ] ], [ halign=none, background=ColorBkgd, inset=0, spacing=0, border=true, caption=TEXTCapPlot, [ halign=none, background=ColorPlotFrame, inset=0, spacing=0, border=true, Plotter[PL2](plot0, width=300, height=300) ], TEXTRotatePlot ] ], [ halign=none, background=ColorBkgd, border=true, caption=TEXTCapSyntaxTutorial, HorizontalGlue(), TEXTType, TextField[TFSyntax](editable=false, width=25, background=ColorMessage), TEXTfor, MathMLViewer[MMLSyntax](width=200, height=55), HorizontalGlue(), Label(Image(Logo)), Label(Image(LIBLogo)) ], BoxColumn( halign=none, background=ColorFooter, inset=0, spacing=0, [ background=ColorFooter, inset=0, spacing=0, Label(TEXTLprogrammers, font=FontFooter), HorizontalGlue(), Label(TEXTLcopyright, font=FontFooter), HorizontalGlue(), Label(TEXTLversion, font=FontFooter) ], [ background=ColorFooter, inset=0, spacing=0, Label(TEXTLasstprogrammer, font=FontFooter), HorizontalGlue(), Label(GetVersion(), font=FontFooter) ] ) ]), Window[Config](title=TEXTtitleStereoConfig, [ halign=none, background=ColorBkgd, inset=0, spacing=0, [ halign=none, background=ColorBkgd, TEXTstereo, RadioButton[RBStereo](TEXTRBOn, false, background=ColorBkgd, group=BGStereo), RadioButton(TEXTRBOff, true, background=ColorBkgd, group=BGStereo), HorizontalGlue(), Button(TEXTBClose, onclick=AExitConfig, background=ColorCloseButton) ], [ background=ColorBkgd, TEXTSelColor ], [ halign=none, background=ColorBkgd, inset=0, spacing=0, [ halign=none, background=ColorBkgd, inset=0, spacing=0, border=true, caption=TEXTlefteye, [ halign=none, background=ColorPlotFrame, Plotter[Lcol](plot3d(0, x=-10..10, y=-10..10 , style=patchnogrid, color=red), width=200, height=200) ], [ halign=none, background=ColorBkgd, DropDownBox[DDBL](TEXTRed, [ TEXTRed, TEXTGreen, TEXTBlue, TEXTCyan, TEXTMagenta, TEXTYellow, " "], Evaluate(function="leftdropdown")) ], [ halign=none, background=ColorBkgd, TEXTRedR, Slider[SL1](0..100, 100, showticks, majorticks=20, minorticks=10, snapticks=false, background=ColorBkgd, filled=true, Evaluate(function="leftcolor")) ], [ halign=none, background=ColorBkgd, TEXTGreenG, Slider[SL2](0..100, 0, showticks, majorticks=20, minorticks=10, snapticks=false, background=ColorBkgd, filled=true, Evaluate(function="leftcolor")) ], [ halign=none, background=ColorBkgd, TEXTBlueB, Slider[SL3](0..100, 0, showticks, majorticks=20, minorticks=10, snapticks=false, background=ColorBkgd, filled=true, Evaluate(function="leftcolor")) ] ], [ halign=none, background=ColorBkgd, inset=0, spacing=0, border=true, caption=TEXTrighteye, [ halign=none, background=ColorPlotFrame, Plotter[Rcol](plot3d(0, x=-10..10, y=-10..10 , style=patchnogrid, color=cyan), width=200, height=200) ], [ halign=none, background=ColorBkgd, DropDownBox[DDBR](TEXTCyan, [ TEXTCyan, TEXTMagenta, TEXTYellow, TEXTRed, TEXTGreen, TEXTBlue, " "], Evaluate(function="rightdropdown")) ], [ halign=none, background=ColorBkgd, TEXTRedR, Slider[SR1](0..100, 0, showticks, majorticks=20, minorticks=10, snapticks=false, background=ColorBkgd, filled=true, Evaluate(function="rightcolor")) ], [ halign=none, background=ColorBkgd, TEXTGreenG, Slider[SR2](0..100, 100, showticks, majorticks=20, minorticks=10, snapticks=false, background=ColorBkgd, filled=true, Evaluate(function="rightcolor")) ], [ halign=none, background=ColorBkgd, TEXTBlueB, Slider[SR3](0..100, 100, showticks, majorticks=20, minorticks=10, snapticks=false, background=ColorBkgd, filled=true, Evaluate(function="rightcolor")) ] ] ] ]), ButtonGroup[BGStereo](), Action[AExitConfig](Evaluate(function="UpdatePlots"),CloseWindow(Config)) ): Maplets[Display](QuadSurf);