// Numbas version: exam_results_page_options {"name": "Visualisation of limit definition of derivative", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Visualisation of limit definition of derivative", "tags": [], "metadata": {"description": "

JSXGraph code based on original by Christian Lawson-Perfect

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

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

\n

\n

The graph above shows a line cutting the curve at $x=4$ and $x=4+h$.

\n

", "advice": "", "rulesets": {}, "extensions": ["jsxgraph"], "variables": {"a": {"name": "a", "group": "Ungrouped variables", "definition": "random(-4..4 except 0)", "description": "", "templateType": "anything"}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "random(-6..6 except [0,a])", "description": "", "templateType": "anything"}, "y2": {"name": "y2", "group": "Ungrouped variables", "definition": "x2*a+b", "description": "", "templateType": "anything"}, "x2": {"name": "x2", "group": "Ungrouped variables", "definition": "random(-3..3 except -1..1)", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["x2", "b", "a", "y2"], "variable_groups": [], "functions": {"eqnline": {"parameters": [["a", "number"], ["b", "number"], ["x2", "number"], ["y2", "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// The line is described by the equation \n// y = a*x + b\n\n// This function takes as its parameters the coefficients a and b,\n// and the coordinates (x2,y2) of a point on the line.\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('400px','400px',\n{boundingBox: [-1,8.5,8.5,-1],\n axis: false,\n showNavigation: false,\n grid: true\n});\n \n// div.board is the object created by JSXGraph, which you use to \n// manipulate elements\nvar board = div.board; \n\n\n// create the x-axis.\nvar xaxis = board.create('line',[[0,0],[1,0]], { strokeColor: 'black', fixed: true});\nvar xticks = board.create('ticks',[xaxis,2],{\n drawLabels: true,\n label: {offset: [-4, -10]},\n minorTicks: 0\n});\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,2],{\ndrawLabels: true,\nlabel: {offset: [-20, 0]},\nminorTicks: 0\n});\n\n// create the static curve\nvar curve1 = board.create('functiongraph',function(x){return x**3/100;},{fixed:true, strokeWidth: 1});\n\n// create the static tangent\nvar line1 = board.create('line',[[4,4**3/100],[5,4**3/100+3*4**2/100]],\n {fixed:true, strokeWidth: 1,strokeColor:'#aaaaaa'});\n\n// mark the two given points - one on the y-axis, and one at (x2,y2)\n//var p1 = board.create('point',[0,b],{fixed:true, size:3, name: 'P_1', face: 'cross'});\n\n\nvar h = board.create('slider',[[2,7],[6,7],[-4,2,4]],{name:'h'}); \n\n\n\nvar curve2 = board.create('functiongraph',\n function(x){return (x-4)*((4+h.Value())**3/100-4**3/100)/h.Value()+4**3/100;},\n {fixed:true, strokeWidth: 1});\n\nboard.update();\n\n\n\nreturn div;"}}, "preamble": {"js": "", "css": "div.question-nav.question-bottom-nav.navbar.navbar-default{display:none}"}, "parts": [{"type": "information", "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": "

Use the slider to show that, as $h$ tends to $0$ the line becomes the tangent to the curve at $x=4$

"}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Paul King", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2404/"}]}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Paul King", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2404/"}]}