// Numbas version: exam_results_page_options {"name": "4.2 Graphing trigonometric functions Q1", "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 Q1", "tags": [], "metadata": {"description": "

Given a graph of the form either a.cos(bx) or a.sin(bx), identify the amplitude and period.

", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "

{app}

", "advice": "

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

\n

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

\n

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

\n

The same period formula also holds for $f(x)=a\\cos(nx)$.

\n

In this example, since $n$ is such that $1\\leq n \\leq 12$, $\\frac{360}{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)=\\sin(-3x)$, we would have \\(\\text{Period = }\\left|\\frac{360}{-3}\\right|=\\left|-\\frac{360}{3}\\right|=\\frac{360}{3}=120.\\)

\n

The amplitude of $f(x)=a\\sin(nx)$ is given by the fomula

\n

\\[\\text{Amplitude = }\\left|a\\right|,\\]

\n

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

\n

The same amplitude formula also holds for $f(x)=a\\cos(nx)$.

\n", "rulesets": {}, "extensions": ["geogebra", "jsxgraph"], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"a": {"name": "a", "group": "Ungrouped variables", "definition": "random([1,2,3,4])", "description": "", "templateType": "anything", "can_override": false}, "anglelist": {"name": "anglelist", "group": "Ungrouped variables", "definition": "['$\\\\theta$',3]", "description": "", "templateType": "anything", "can_override": false}, "angle": {"name": "angle", "group": "Ungrouped variables", "definition": "anglelist[0]", "description": "", "templateType": "anything", "can_override": false}, "ratio_selector": {"name": "ratio_selector", "group": "Ungrouped variables", "definition": "random([0,1])", "description": "", "templateType": "anything", "can_override": false}, "n": {"name": "n", "group": "Ungrouped variables", "definition": "random([1,2,3,4,5])", "description": "", "templateType": "anything", "can_override": false}, "ansperiod": {"name": "ansperiod", "group": "Ungrouped variables", "definition": "if(ratio_selector=0 or ratio_selector=1,360/n,if(ratio_selector=2,180/n,-1))", "description": "", "templateType": "anything", "can_override": false}, "ansamp": {"name": "ansamp", "group": "Ungrouped variables", "definition": "abs(a)", "description": "", "templateType": "anything", "can_override": false}, "app": {"name": "app", "group": "Ungrouped variables", "definition": "jessiecode(800,500,[-450,{a}+0.5,450,-{a}-0.5],\"\"\"\nyaxis = 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: 90,\n insertticks: false\n >>,\n withLabel: true,\n name: '$\\\\\\\\theta$',\n useMathjax: true,\n label: <>\n>>;\n\nfunctiongraph('{function}', -450, 450) <>;\n \"\"\",\n[\n \"axis\": false\n])", "description": "", "templateType": "anything", "can_override": false}, "function": {"name": "function", "group": "Ungrouped variables", "definition": "let(fn,['sin','cos','tan'][ratio_selector],\n '{a}*{fn}({n}*x*PI/180)'\n)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["a", "n", "ratio_selector", "anglelist", "angle", "ansperiod", "ansamp", "app", "function"], "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: 'dc2k2pqp',\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.showAlgebraInput(true);\n app.enableShiftDragZoom(true);\n app.setCoordSystem(-340,340,-5,5); // , , , \n //app.refreshViews();\n //app.evalCommand(\"ZoomIn[-1,-1,1,1]\"); // , , , \n //app.evalCommand(\"SetAxesRatio(1,1/20)\");\n app.evalCommand(\"CenterView((0, 0))\");\n app.evalCommand(\"ShowAxes(true)\");\n app.evalCommand(\"ShowGrid(true)\");\n var aggb = question.scope.evaluate(\"a\").value;\n var rsggb = question.scope.evaluate(\"ratio_selector\").value;\n var nggb = question.scope.evaluate(\"n\").value;\n \n var ratio=\"\";\n if (rsggb==0) {\n ratio=\"sin\";\n } else if (rsggb==1) {\n ratio=\"cos\"; \n } else if (rsggb==2) {\n ratio=\"tan\";\n }\n \n //app.evalCommand(\"f=Curve(t,\" + aggb + \"*\" + ratio + \"(t deg), t, -360, 360)\");\n //app.evalCommand(\"ShowLabel(f,false)\");\n //app.evalCommand(\"SetColor(f,0,0,1)\");\n \n app.evalCommand(\"f=Function(\" + aggb + \"*\" + ratio + \"(\" + nggb + \"*x deg), x, -360, 360)\");\n app.evalCommand(\"ShowLabel(f,false)\");\n app.evalCommand(\"SetColor(f,0,0,1)\");\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": "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": "

The graph above is of a function whose definition is either $f(x)=a\\sin(nx)$ or $f(x)=a\\cos(nx)$. What are the period and amplitude of this function?

\n

Period is [[0]]$^{\\circ}$

\n

Amplitude is [[1]] units

", "gaps": [{"type": "numberentry", "useCustomName": true, "customName": "Period", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "{ansperiod}", "maxValue": "{ansperiod}", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "Amplitude", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "{ansamp}", "maxValue": "{ansamp}", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "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/"}]}