// Numbas version: exam_results_page_options {"name": "mock_exam Sin graph transformations vertical shift radians (working)", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"functions": {"eqnline": {"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 = -8;\nvar x_max = 8;\nvar y_min = -vpos -2.5;\nvar y_max = vpos + 2.5;\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.\n//var xaxis = board.create('line',[[0,0],[1,0]], { strokeColor: 'black', fixed: true});\n\nvar xaxis = board.create('axis',[[0,0],[1,0]], {strokeColor: 'black', fixed: true,\n name:'x', \n\t\t\t\n withLabel: true, \n\t\t\tlabel: {position: 'rt', // possible values are 'lft', 'rt', 'top', 'bot'\n\t\t\t\t\t offset: [-15, 20] // (in pixels)\n\t\t\t\t\t }\n\n});\nxaxis.removeAllTicks();\n\n\nvar xticks = board.create('ticks',[xaxis,0.5],{\n //This puts a value on the exaxis very 0.5\u03c0 units\n drawLabels: true,\n //drawLabels: false,\n label: {offset: [-10, -15]},\n //minorTicks: 0\n minorTicks:4, majorTickHeight:20, minorTickHeight:8,\n //If you want to use \u03c0 ou need to comment out minorTicks\n scale: Math.PI, \n\t scaleSymbol: '\u03c0'\n \n \n});\n\n\n\n\n\n\n// create the y-axis\n//var yaxis = board.create('line',[[0,0],[0,1]], { strokeColor: 'black', fixed: true });\n\nvar yaxis = board.create('axis',[[0,0],[0,1]], { strokeColor: 'black', fixed: true,\n name:'sin(x)', \n\t\t\t\n withLabel: true, \n\t\t\tlabel: {position: 'top', // possible values are 'lft', 'rt', 'top', 'bot'\n\t\t\t\t\t offset: [-45, 240] // (in pixels)\n\t\t\t\t\t }\n\n});\n\n\nyaxis.removeAllTicks();\n\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 in radians\nboard.create('functiongraph',[function(x){ return Math.sin(x);},x_min,x_max]);\nboard.create('functiongraph',[function(x){ return Math.sin(x)+v;},x_min,x_max],{ strokeColor: 'red'});\nboard.create('functiongraph',[function(x){ return Math.sin(x)-(v+1);},x_min,x_max],{ strokeColor: 'black'});\n//Change axis range from -360 tp +360 y from -8 to +8 \n\n// sin (x) in degrees\n//board.create('functiongraph',[function(x){ return Math.sin(x);},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;", "type": "html", "language": "javascript", "parameters": [["a", "number"], ["b", "number"], ["x2", "number"], ["y2", "number"], ["v", "number"], ["sin0", "number"], ["vpos", "number"]]}}, "ungrouped_variables": ["a", "x2", "b", "y2", "c", "v", "sin0", "random", "vpos"], "name": "mock_exam Sin graph transformations vertical shift radians (working)", "tags": [], "preamble": {"css": "", "js": ""}, "advice": "", "rulesets": {}, "parts": [{"prompt": "

Write the equation of the line red line.

\n

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

\n

\n

", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "gaps": [{"vsetrangepoints": 5, "expectedvariablenames": [], "checkingaccuracy": 0.001, "vsetrange": [0, 1], "showpreview": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "scripts": {}, "answer": "sin(x)+{v}", "marks": 1, "checkvariablenames": false, "checkingtype": "absdiff", "type": "jme"}], "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "gapfill"}, {"prompt": "

Write the equation of the line black line.

\n

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

\n

\n

", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "gaps": [{"vsetrangepoints": 5, "expectedvariablenames": [], "checkingaccuracy": 0.001, "vsetrange": [0, 1], "showpreview": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "scripts": {}, "answer": "sin(x)-{v}-1", "marks": 1, "checkvariablenames": false, "checkingtype": "absdiff", "type": "jme"}], "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "gapfill"}], "extensions": ["jsxgraph"], "statement": "

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

\n

The Blue graph shows a graph of a quadratic equation, $f(x)=sin(x)$

\n

The Blue graph has been transformed onto the red graph $g(x)$ via a vertical shift, type in the new function definition:

\n

The Blue graph has been transformed onto the black graph $h(x)$ via a vertical shift, type in the new function definition:

", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"a": {"definition": "random(-4..4 except 0)", "templateType": "anything", "group": "Ungrouped variables", "name": "a", "description": ""}, "c": {"definition": "a*b", "templateType": "anything", "group": "Ungrouped variables", "name": "c", "description": ""}, "b": {"definition": "random(-5..5 except [0,a,-a])", "templateType": "anything", "group": "Ungrouped variables", "name": "b", "description": ""}, "random": {"definition": "random(2..9)", "templateType": "anything", "group": "Ungrouped variables", "name": "random", "description": ""}, "sin0": {"definition": "random/10", "templateType": "anything", "group": "Ungrouped variables", "name": "sin0", "description": ""}, "v": {"definition": "random(2..4)", "templateType": "anything", "group": "Ungrouped variables", "name": "v", "description": ""}, "x2": {"definition": "random(-3..3 except -1..1)", "templateType": "anything", "group": "Ungrouped variables", "name": "x2", "description": ""}, "y2": {"definition": "x2*a+b", "templateType": "anything", "group": "Ungrouped variables", "name": "y2", "description": ""}, "vpos": {"definition": "abs(v)", "templateType": "anything", "group": "Ungrouped variables", "name": "vpos", "description": ""}}, "metadata": {"description": "

sin vertically shifted WORKING 1_11_16

", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}], "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/"}]}