// Numbas version: exam_results_page_options {"name": "4.2 Graphing trigonometric functions Q2", "extensions": ["geogebra", "jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "4.2 Graphing trigonometric functions Q2", "tags": [], "metadata": {"description": "", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "

{app}

\n

The graph of $f(x)=\\tan(nx)$ is shown above (with the parameter $n$ restricted to $[1,12]$). Manipluate the slider in this graph to vary the value of $n$ and answer the following question.

", "advice": "

In general, the period of the function $f(x)=\\tan(nx)$ is given by the fomula

\n

\\[\\text{Period = }\\left|\\frac{180}{n}\\right|,\\]

\n

noting that the absolute value function, $|\\cdot|$, ensures the period is always a positive number.

\n

In this example, since $n$ is such that $1\\leq n \\leq 12$, $\\frac{180}{n}$ is always positive, so the use of the absolute value function in the period formula is not necessary.

\n

But in a more general example, say $f(x)=\\tan(-3x)$, we would have \\(\\text{Period = }\\left|\\frac{180}{-3}\\right|=\\left|-\\frac{180}{3}\\right|=\\frac{180}{3}=60.\\)

", "rulesets": {}, "extensions": ["geogebra", "jsxgraph"], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"app": {"name": "app", "group": "Ungrouped variables", "definition": "jessiecode(800,500,[-220,5,220,-5],safe(\"\"\"\n\n yaxis = axis( [0,0],[0,1] ) <<\n ticks: <<\n ticksdistance: 0.5,\n insertticks: false\n >>,\n withLabel: true,\n name: '$f(\\\\\\\\theta)$',\n useMathjax: true,\n label: <>\n>>;\n \nxaxis = axis( [0,0],[1,0] ) <<\n ticks: <<\n ticksdistance: 45,\n insertticks: false\n >>,\n withLabel: true,\n name: '$\\\\\\\\theta$',\n useMathjax: true,\n label: <>\n>>;\n\n slider([-200,4.5],[-150,4.5],[1,1,12]) <>;\n \n functiongraph(function(x){ m=n.Value(); return tan(m*x*PI/180);}, -220, 220) <>;\n \"\"\"),\n[\n \"axis\": false\n \n \n ])", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["app"], "variable_groups": [], "functions": {"applet": {"parameters": [], "type": "ggbapplet", "language": "javascript", "definition": "// Create the worksheet. \n// This function returns an object with a container `element` and a `promise` resolving to a GeoGebra applet.\nvar params = {\n material_id: 'e3sxjmpr',\n width: 900,\n height: 500\n};\n//geogebra_applet('eae92mhz') old ggb file\n\nvar result = Numbas.extensions.geogebra.createGeogebraApplet(params);\n\n// Once the applet has loaded, run some commands to manipulate the worksheet.\nresult.promise.then(function(d) {\n var app = d.app;\n question.applet = d;\n app.setGridVisible(true);\n \n function setGGBPoint(name) {\n // moves point in GGB to location of Numbas Vector Variable\n var pt = question.scope.evaluate(name).value\n app.setFixed(name,false,false);\n app.setCoords(name, pt[0], pt[1]);\n app.setFixed(name,true,true);\n }\n\n function setGGBNumber(name) {\n // Sets number in GGB to a Numbas Variable\n var n = question.scope.evaluate(name).value;\n app.setValue(name,n);\n }\n \n app.setAxesVisible(true,true);\n app.enableShiftDragZoom(true);\n app.setCoordSystem(-30,390,-8,8);\n app.evalCommand(\"CenterView((0, 0))\");\n //var x0ggb = question.scope.evaluate(\"x0\").value;\n //var y0ggb = question.scope.evaluate(\"y0\").value;\n //var x1ggb = question.scope.evaluate(\"x1\").value;\n //var y1ggb = question.scope.evaluate(\"y1\").value; \n //app.evalCommand(\"A=Point(\\{\" + x0ggb + \",\" + y0ggb + \"\\})\");\n //app.evalCommand(\"B=Point(\\{\" + x1ggb + \",\" + y1ggb + \"\\})\");\n \n});\n\n// This function returns the result of `createGeogebraApplet` as an object \n// with the JME data type 'ggbapplet', which can be substituted into the question's content.\nreturn new Numbas.jme.types.ggbapplet(result);"}}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "1_n_2", "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": "

What is the relationship between $n$ and the period of the function?

", "minMarks": 0, "maxMarks": 0, "shuffleChoices": true, "displayType": "radiogroup", "displayColumns": "1", "showCellAnswerState": true, "choices": ["Period is $\\frac{180}{n}$", "Period is $\\frac{360}{n}$", "Period is $180\\times n$", "Period is $360\\times n$", "Period is $n$", "Period is $\\frac{n}{180}$", "Period is $\\frac{n}{360}$"], "matrix": ["1", 0, 0, 0, 0, 0, 0], "distractors": ["", "", "", "", "", "", ""]}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "Don Shearman", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/680/"}, {"name": "Jim Pettigrew", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2037/"}, {"name": "Merryn Horrocks", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4052/"}]}]}], "contributors": [{"name": "Don Shearman", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/680/"}, {"name": "Jim Pettigrew", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2037/"}, {"name": "Merryn Horrocks", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4052/"}]}