// Numbas version: exam_results_page_options {"name": "Algebra: trig graphs, sin, basic", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Algebra: trig graphs, sin, basic", "tags": [], "metadata": {"description": "", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "

This is a calculator question.

\n

----------------------------------

See Lecture 7.3 and 7.5 for background and examples.

", "rulesets": {}, "extensions": ["jsxgraph"], "variables": {"x0": {"name": "x0", "group": "part a", "definition": "0.1*random(1..9)+0.01*random(1..9)", "description": "", "templateType": "anything"}, "f0": {"name": "f0", "group": "part a", "definition": "precround(sin(x0),2)", "description": "", "templateType": "anything"}, "f1": {"name": "f1", "group": "part a", "definition": "f0", "description": "", "templateType": "anything"}, "x1": {"name": "x1", "group": "part a", "definition": "precround(pi-x0,2)", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": [], "variable_groups": [{"name": "part a", "variables": ["x0", "f0", "x1", "f1"]}], "functions": {"plot": {"parameters": [["a", "number"], ["b", "number"], ["c", "number"], ["x0", "number"], ["y0", "number"], ["x1", "number"], ["y1", "number"], ["n", "number"]], "type": "html", "language": "javascript", "definition": "// Max and min x and y values for the axis.\nvar x_min = -3.2;\nvar x_max = 6.3;\nvar y_min = -1.2;\nvar y_max = 1.2;\n\n\n// First, make the JSXGraph board.\nvar div = Numbas.extensions.jsxgraph.makeBoard(\n '500px',\n '600px',\n {\n boundingBox: [x_min,y_max,x_max,y_min],\n axis: false,\n showNavigation: false,\n grid: false,\n axis:false,\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 and y-axis\nvar xaxis = board.create('axis',[[0,0],[1,0]], { strokeColor: 'black', fixed: true});\n//var xticks = board.create('ticks',[xaxis,1],{\n// drawLabels: true,\n// label: {offset: [-8, -10]},\n// minorTicks: 0\n//});\n\n// create the y-axis\nvar yaxis = board.create('axis',[[0,0],[0,1]], { strokeColor: 'black', fixed: true });\n//var yticks = board.create('ticks',[yaxis,1],{\n// drawLabels: true,\n// label: {offset: [-8, 0]},\n// minorTicks: 0\n//});\n\n\n//Define function depending on value of n.\nswitch(n) {\n case 1:\n var f = function(x) {return a*Math.sin(b*x)+c; }\n break;\n \n case 2:\n var f = function(x) {return a*Math.cos(b*x)+c; }\n break;\n \n case 3:\n var f = function(x) {return Math.sin(x+3.141*1.0);}\n break;\n \n case 4:\n var f = function(x) {return Math.sin(x+3.141*1.5);}\n break;\n}\n\n\n// Plot the function.\n board.create('functiongraph', [f,x_min,x_max]);\n\n// Plot coordinates.\n board.create('ellipse',[[x0+0.04,y0],[x0-0.04,y0],[x0,y0+0.02]],{color:'red'});\n board.create('text',[x0+0.1,y0,'A']);\n board.create('ellipse',[[x1+0.04,y1],[x1-0.04,y1],[x1,y1+0.02]],{color:'red'});\n board.create('text',[x1+0.1,y1,'B']);\n// board.create('ellipse',[[x2,y2+0.045],[x2,y2-0.045],[x2,y2+0.05]],{color:'red'});\n// board.create('text',[x2,y2+0.2,'C']);\n\nreturn div;"}}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": "

This is the graph of the function $f(t) = \\sin(t)$, in radians.

\n

{plot(1,1,0,x0, f0, x1, f1, 1)}

\n

\n

The coordinates of $A$ are $(\\var{x0},\\var{f0})$.

\n

The $y$-coordinate of $B$ is the same as the $y$-coordinate of $A$. Determine the coordinates of $B$. Give your answer to 2 d.p.

\n

\n

Coordinates of B: [[0]]

", "gaps": [{"type": "matrix", "useCustomName": false, "customName": "", "marks": "2", "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "correctAnswer": "matrix([x1,f1])", "correctAnswerFractions": false, "numRows": 1, "numColumns": "2", "allowResize": false, "tolerance": 0, "markPerCell": false, "allowFractions": false}], "sortAnswers": false}], "contributors": [{"name": "Lovkush Agarwal", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1358/"}]}]}], "contributors": [{"name": "Lovkush Agarwal", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1358/"}]}