// Numbas version: finer_feedback_settings {"name": "mock_exam Sin graph transformations vertical streched radians (WORKING)", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "mock_exam Sin graph transformations vertical streched radians (WORKING)", "tags": [], "metadata": {"description": "

sin vertically shifted Working 1_11_16

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

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

\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 stretch, type in the new function definition:

\n

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

", "advice": "", "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}, "stretch": {"name": "stretch", "group": "Ungrouped variables", "definition": "random(2..10 except [3,4,6,7,8,9])", "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}, "vpos": {"name": "vpos", "group": "Ungrouped variables", "definition": "abs(v)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["a", "x2", "b", "y2", "c", "v", "sin0", "random", "vpos", "stretch"], "variable_groups": [], "functions": {"eqnline": {"parameters": [["a", "number"], ["b", "number"], ["x2", "number"], ["y2", "number"], ["v", "number"], ["sin0", "number"], ["vpos", "number"], ["stretch", "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 = -8;\nvar x_max = 8;\nvar y_min = -vpos -1.5;\nvar y_max = vpos + 1.5;\n\n\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:3, 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 vertical strech\nboard.create('functiongraph',[function(x){ return Math.sin(x);},x_min,x_max]);\nboard.create('functiongraph',[function(x){ return v*(Math.sin(x));},x_min,x_max],{ strokeColor: 'red'});\nboard.create('functiongraph',[function(x){ return (1/(2))*(Math.sin(x));},x_min,x_max],{ strokeColor: 'black'});\n//board.create('functiongraph',[function(x){ return (1/(v+1))*(Math.sin(x));},x_min,x_max],{ strokeColor: 'black'})\n\n//sin in radians vertical shift\n//board.create('functiongraph',[function(x){ return Math.sin(x);},x_min,x_max]);\n//board.create('functiongraph',[function(x){ return Math.sin(x)+v;},x_min,x_max],{ strokeColor: 'red'});\n//board.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//sin in radians horizontal shift\n//board.create('functiongraph',[function(x){ return Math.sin(x);},x_min,x_max],{ strokeColor: 'red'});\n//board.create('functiongraph',[function(x){ return Math.sin(x-(v*(Math.PI/4)));},x_min,x_max],{ strokeColor: 'blue'});\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": "

Wrie the equation of the line red line in the form of $Asin(Bx+C)+D$

\n

Where $A,B,C,D$ are constants of any value (including 1 and 0).

\n

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

\n

\n

", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{v}*sin(x)", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": [{"name": "x", "value": ""}]}], "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": "

Write the equation of the black line in the form of $Asin(Bx+C)+D$

\n

Where $A,B,C,D$ are constants of any value (including 1 and 0).

\n

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

\n

\n

", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "0.5*sin(x)", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": [{"name": "x", "value": ""}]}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question", "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/"}]}