// Numbas version: exam_results_page_options {"name": "TRIG MASTER GRAPH examples (degrees)", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "TRIG MASTER GRAPH examples (degrees)", "tags": [], "metadata": {"description": "

Given th original formula the student enters the transformed formula

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "

{eqnline(a,b,x2,y2,v,sin0)}

\n

The graph  shows the functions, $y=sin(x)$  and $y=\\var{sin0}$

\n

Calulate the solutions to the equation $sin(x)=\\var{sin0}$  in the range $-360 \\leqslant x \\leqslant 360$

", "advice": "

We know that the graph crosses the $x$-axis at both $(\\var{a},0)$ and $(\\var{b},0)$. Since this is a quadratic, we know our equations has two roots, and by the previous observation, they are at $\\var{a}$ and $\\var{b}$. Hence we can write our equation as $\\simplify{y=(x-{a})(x-{b})}$ which simplifies to $\\simplify{y=x^2-({a}+{b})x+({a}*{b})}$.

\n

\n

To find the coefficients of the turning point of the quadratic, we know the x-coordinate of the turning point will correspond to the solution to $dy/dx=0$. So we get $\\simplify{2x-({a}+{b})}=0$ hence $\\simplify{x=({a}+{b})/2}$. We substitute this value of x back into the equation of the quadratic to find the corresponding y-coordinate.

", "rulesets": {}, "extensions": ["jsxgraph"], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"a": {"name": "a", "group": "Ungrouped variables", "definition": "random(-4..4 except 0)", "description": "", "templateType": "anything", "can_override": false}, "c": {"name": "c", "group": "Ungrouped variables", "definition": "a*b", "description": "", "templateType": "anything", "can_override": false}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "random(-5..5 except [0,a,-a])", "description": "", "templateType": "anything", "can_override": false}, "random": {"name": "random", "group": "Ungrouped variables", "definition": "random(2..9)", "description": "", "templateType": "anything", "can_override": false}, "sin0": {"name": "sin0", "group": "Ungrouped variables", "definition": "random/10", "description": "", "templateType": "anything", "can_override": false}, "v": {"name": "v", "group": "Ungrouped variables", "definition": "random(2..4)", "description": "", "templateType": "anything", "can_override": false}, "x2": {"name": "x2", "group": "Ungrouped variables", "definition": "random(-3..3 except -1..1)", "description": "", "templateType": "anything", "can_override": false}, "y2": {"name": "y2", "group": "Ungrouped variables", "definition": "x2*a+b", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["a", "x2", "b", "y2", "c", "v", "sin0", "random"], "variable_groups": [], "functions": {"eqnline": {"parameters": [["a", "number"], ["b", "number"], ["x2", "number"], ["y2", "number"], ["v", "number"], ["sin0", "number"]], "type": "html", "language": "javascript", "definition": "// This function creates the board and sets it up, then returns an\n// HTML div tag containing the board.\n\n//Put in your values of x here\n\nvar x_min = -380;\nvar x_max = 380;\nvar y_min = -2;\nvar y_max = 2;\n\n// First, make the JSXGraph board.\n// The function provided by the JSXGraph extension wraps the board up in \n// a div tag so that it's easier to embed in the page.\nvar div = Numbas.extensions.jsxgraph.makeBoard('600px','600px',\n//{boundingBox: [-8,10,8,-10],\n {boundingBox: [x_min,y_max,x_max,y_min], \n axis: false,\n showNavigation: true,\n grid: true\n});\n\n\n\n\n// div.board is the object created by JSXGraph, which you use to \n// manipulate elements\nvar board = div.board; \n\n// create the x-axis.\nvar xaxis = board.create('line',[[0,0],[1,0]], {strokeColor: 'black', fixed: true});\n\nvar xticks = board.create('ticks',[xaxis,60],{\n\n drawLabels: true,\n label: {offset: [-4, -10]},\n minorTicks: 0\n});\n\n\n// create the line.\n\n\nboard.create('line',[[x_min,sin0],[x_max,sin0]],{strokeColor:'red'});\n\n// create the y-axis\nvar yaxis = board.create('line',[[0,0],[0,1]], { strokeColor: 'black', fixed: true });\nvar yticks = board.create('ticks',[yaxis,1],{\ndrawLabels: true,\nlabel: {offset: [-20, 0]},\nminorTicks: 0\n});\n\n\n // PUT YOUR FUNCTION HERE\n\n// sin (x) in degrees\nboard.create('functiongraph',[function(x){ return Math.sin(x*(Math.PI/180));},x_min,x_max]);\n//board.create('functiongraph',[function(x){ return Math.sin(x*(Math.PI/180))+v;},-360,360],{ strokeColor: 'red'});\n//board.create('functiongraph',[function(x){ return Math.sin(x*(Math.PI/180))-(v+1);},-360,360],{ strokeColor: 'black'});\n//Change axis range from -360 tp +360 y from -8 to +8 \n\n//board.create('functiongraph',[function(x){ return Math.exp(x);},x_min,x_max]);\n//board.create('functiongraph',[function(x){ return Math.log(x);},x_min,x_max]);\n//board.create('functiongraph',[function(x){ return (x);},x_min,x_max]);\n\n\n//board.create('functiongraph',[function(x){ return (x-a)*(x-b);},-8,8]);\n//board.create('functiongraph',[function(x){ return (x-a)*(x-b)+v;},-8,8],{ strokeColor: 'red'});\n\n//board.create('functiongraph',[function(x){ return x*x;},-8,8]);\n//board.create('functiongraph',[function(x){ return x*x+v;},-8,8],{ strokeColor: 'red'});\n//board.create('functiongraph',[function(x){ return x*x-(v+1);},-8,8],{ strokeColor: 'black'});\n\n\n//board.create('functiongraph',[function(x){ return x*x;},-8,8]);\n//board.create('functiongraph',[function(x){ return (x-v)*(x-v);},-8,8],{ strokeColor: 'red'});\n//board.create('functiongraph',[function(x){ return (x+v+1)*(x+v+1);},-8,8],{ strokeColor: 'black'});\n\n//board.create('functiongraph',[function(x){ return x*x;},-8,8]);\n//board.create('functiongraph',[function(x){ return v*(x)*(x);},-8,8],{ strokeColor: 'red'});\n//board.create('functiongraph',[function(x){ return (1/v)*(x)*(x);},-8,8],{ strokeColor: 'black'});\n\n//board.create('functiongraph',[function(x){ return (x)*(x)+v;},-8,8]);\n//board.create('functiongraph',[function(x){ return -((x)*(x)+v);},-8,8],{ strokeColor: 'red'});\n//board.create('functiongraph',[function(x){ return -(x)*(x);},-8,8],{ strokeColor: 'black'});\n\n\n\n\n\n\nreturn div;"}}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

The smallest positive solution is give the solution to 1 decimal place.

\n

$g(x)=\\;$[[0]]

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "arcsin({sin0})*180/pi", "maxValue": "arcsin({sin0})*180/pi", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "precisionType": "dp", "precision": "1", "precisionPartialCredit": 0, "precisionMessage": "

You have not given your answer to the correct precision.

", "strictPrecision": true, "showPrecisionHint": false, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Give the largest positive solution in the range  correct  to 1 decimal place.

\n

$g(x)=\\;$[[0]]

\n

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "(pi-arcsin({sin0}))*180/pi", "maxValue": "(pi-arcsin({sin0}))*180/pi", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "precisionType": "dp", "precision": "1", "precisionPartialCredit": 0, "precisionMessage": "

You have not given your answer to the correct precision.

", "strictPrecision": true, "showPrecisionHint": false, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Give the smallest solution in the range  correct  to 1 decimal place.

\n

$g(x)=\\;$[[0]]

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "(-pi-arcsin({sin0}))*180/pi", "maxValue": "(-pi-arcsin({sin0}))*180/pi", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "precisionType": "dp", "precision": "1", "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": true, "showPrecisionHint": false, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "steve kilgallon", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/268/"}]}]}], "contributors": [{"name": "steve kilgallon", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/268/"}]}