// Numbas version: exam_results_page_options {"name": "Polar domains", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"ungrouped_variables": ["q1_r2", "q2_r1", "q2_r2", "q3_r2", "q3_t1", "q3_t2", "q4_r1", "q4_r2", "q4_t1", "q4_t2"], "variable_groups": [], "parts": [{"scripts": {}, "gaps": [{"variableReplacementStrategy": "originalfirst", "variableReplacements": [], "correctAnswer": "matrix([0,q1_r2],[-pi,pi])", "tolerance": "0.01", "type": "matrix", "showCorrectAnswer": true, "marks": 1, "scripts": {}, "allowResize": false, "numRows": "2", "numColumns": "2", "showFeedbackIcon": true, "correctAnswerFractions": false, "allowFractions": true, "markPerCell": false}], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "type": "gapfill", "showFeedbackIcon": true, "variableReplacements": [], "marks": 0, "prompt": "

Describe the area inside the circle ($\\rightarrow$ disk) in polar coordinates.

\n

{polar_domains(0,q1_r2,-pi,pi)}

\n

$\\begin{pmatrix} r_{\\text{lower}} & r_{\\text{upper}} \\\\ \\theta_{\\text{lower}} & \\theta_{\\text{upper}} \\end{pmatrix} = $ [[0]]

"}, {"scripts": {}, "gaps": [{"variableReplacementStrategy": "originalfirst", "variableReplacements": [], "correctAnswer": "matrix([min(q2_r1,q2_r2),max(q2_r1,q2_r2)],[-pi,pi])", "tolerance": "0.01", "type": "matrix", "showCorrectAnswer": true, "marks": 1, "scripts": {}, "allowResize": false, "numRows": "2", "numColumns": "2", "showFeedbackIcon": true, "correctAnswerFractions": false, "allowFractions": true, "markPerCell": false}], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "type": "gapfill", "showFeedbackIcon": true, "variableReplacements": [], "marks": 0, "prompt": "

Describe the area between the two circles ($\\rightarrow$ ring) in polar coordinates.

\n

{polar_domains(q2_r1,q2_r2,-pi,pi)}

\n

$\\begin{pmatrix} r_{\\text{lower}} & r_{\\text{upper}} \\\\ \\theta_{\\text{lower}} & \\theta_{\\text{upper}} \\end{pmatrix} = $ [[0]]

"}, {"scripts": {}, "gaps": [{"variableReplacementStrategy": "originalfirst", "variableReplacements": [], "correctAnswer": "matrix([0,q3_r2],[min(q3_t1,q3_t2),max(q3_t1,q3_t2)])", "tolerance": "0.01", "type": "matrix", "showCorrectAnswer": true, "marks": 1, "scripts": {}, "allowResize": false, "numRows": "2", "numColumns": "2", "showFeedbackIcon": true, "correctAnswerFractions": false, "allowFractions": true, "markPerCell": false}], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "type": "gapfill", "showFeedbackIcon": true, "variableReplacements": [], "marks": 0, "prompt": "

Describe the disk-segment in polar coordinates.

\n

{polar_domains(0,q3_r2,q3_t1,q3_t2)}

\n

$\\begin{pmatrix} r_{\\text{lower}} & r_{\\text{upper}} \\\\ \\theta_{\\text{lower}} & \\theta_{\\text{upper}} \\end{pmatrix} = $ [[0]]

"}, {"scripts": {}, "gaps": [{"variableReplacementStrategy": "originalfirst", "variableReplacements": [], "correctAnswer": "matrix([min(q4_r1,q4_r2),max(q4_r1,q4_r2)],[min(q4_t1,q4_t2),max(q4_t1,q4_t2)])", "tolerance": "0.01", "type": "matrix", "showCorrectAnswer": true, "marks": 1, "scripts": {}, "allowResize": false, "numRows": "2", "numColumns": "2", "showFeedbackIcon": true, "correctAnswerFractions": false, "allowFractions": true, "markPerCell": false}], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "type": "gapfill", "showFeedbackIcon": true, "variableReplacements": [], "marks": 0, "prompt": "

Describe the ring-segment in polar coordinates.

\n

{polar_domains(q4_r1,q4_r2,q4_t1,q4_t2)}

\n

$\\begin{pmatrix} r_{\\text{lower}} & r_{\\text{upper}} \\\\ \\theta_{\\text{lower}} & \\theta_{\\text{upper}} \\end{pmatrix} = $ [[0]]

"}], "tags": [], "rulesets": {}, "functions": {"polar_domains": {"type": "html", "language": "javascript", "parameters": [["r1", "number"], ["r2", "number"], ["t1", "number"], ["t2", "number"]], "definition": "// function that joins curves\nJXG.joinCurves = function(board, parents, attributes) {\n\n var cu1 = parents[0],\n cu2 = parents[1],\n cu3 = parents[2],\n cu4 = parents[3],\n attr = JXG.copyAttributes(attributes, board.options, 'curve'),\n c = board.create('curve', [[0], [0]], attr),\n toAppendX = cu2.dataX,\n toAppendY = cu2.dataY;\n // this is the inner arc --> reverse order of coordinate data\n toAppendX = toAppendX.slice(0,-1).concat(cu3.dataX.reverse());\n toAppendY = toAppendY.slice(0,-1).concat(cu3.dataY.reverse());\n // add the last piece (bottom line segment) to the data to be appended\n toAppendX = toAppendX.slice(0,-1).concat(cu4.dataX);\n toAppendY = toAppendY.slice(0,-1).concat(cu4.dataY);\n\n c.updateDataArray = function() {\n this.dataX = cu1.dataX.slice(0,-1).concat(toAppendX);\n this.dataY = cu1.dataY.slice(0,-1).concat(toAppendY);\n //console.log(this.dataX);\n if (this.dataX.length<4) {\n this.bezierDegree = 1;\n } else {\n this.bezierDegree = cu1.bezierDegree;\n }\n };\n c.prepareUpdate().update().updateRenderer();\n return c;\n};\n\n// create board\nvar div = Numbas.extensions.jsxgraph.makeBoard('300px','300px',\n {boundingBox: [-10,10,10,-10], axis: true, showNavigation: true, grid: true});\nvar board = div.board;\n\n// swap input arguments if necessary\nvar temp = 0;\nif (r1>r2) {\n temp = r2;\n r2 = r1\n r1 = temp;\n};\nif (t1>t2) {\n temp = t2;\n t2 = t1\n t1 = temp;\n};\n\n// origin of the xy-plane\nvar p0 = board.create('point',[0,0],{visible:false})\n\n// corner points of the domain of integration\nvar p1 = board.create('point', [r2*Math.cos(t1),r2*Math.sin(t1)],{visible:false});\nvar p2 = board.create('point', [r2*Math.cos(t2),r2*Math.sin(t2)],{visible:false});\nvar p3 = board.create('point', [r1*Math.cos(t2),r1*Math.sin(t2)],{visible:false});\nvar p4 = board.create('point', [r1*Math.cos(t1),r1*Math.sin(t1)],{visible:false});\n\n// create segments of the boundary of the domain\n// outer arc\nvar ao = board.create('arc', [p0, p1, p2],{visible:false});\n// top line segment\nvar lt = board.create('curve',[\n [p2.X(), p2.X()*2/3 + p3.X()*1/3, p2.X()*1/3 + p3.X()*2/3, p3.X()],\n [p2.Y(), p2.Y()*2/3 + p3.Y()*1/3, p2.Y()*1/3 + p3.Y()*2/3, p3.Y()]],\n {visible:false, bezierDegree:3});\n// inner arc\nvar ai = board.create('arc', [p0, p4, p3],{visible:false});\n// bottom line segment\nvar lb = board.create('curve',[\n [p4.X(), p4.X()*2/3 + p1.X()*1/3, p4.X()*1/3 + p1.X()*2/3, p1.X()],\n [p4.Y(), p4.Y()*2/3 + p1.Y()*1/3, p4.Y()*1/3 + p1.Y()*2/3, p1.Y()]],\n {visible:false, bezierDegree:3});\n\n// join curves to creat boundary of the domain and fill\nvar jc = JXG.joinCurves(board, [ao,lt,ai,lb],\n { strokeColor:'#B22222', strokeWidth:5, fillColor:'#B22222', fillOpacity:0.2 });\n\nreturn div"}}, "variablesTest": {"condition": "q3_t1 <> q3_t2 and q4_t1 <> q4_t2", "maxRuns": 100}, "variables": {"q2_r2": {"group": "Ungrouped variables", "templateType": "anything", "description": "", "definition": "random(1..9 except q2_r1)", "name": "q2_r2"}, "q1_r2": {"group": "Ungrouped variables", "templateType": "anything", "description": "", "definition": "random(2..9)", "name": "q1_r2"}, "q3_r2": {"group": "Ungrouped variables", "templateType": "anything", "description": "", "definition": "random(1..9)", "name": "q3_r2"}, "q4_t2": {"group": "Ungrouped variables", "templateType": "anything", "description": "", "definition": "random(-5/6,-3/4,-2/3,-1/2,-1/3,-1/4,-1/6,0,1/6,1/4,1/3,1/2,2/3,3/4,5/6)*pi", "name": "q4_t2"}, "q2_r1": {"group": "Ungrouped variables", "templateType": "anything", "description": "", "definition": "random(1..9)", "name": "q2_r1"}, "q4_r1": {"group": "Ungrouped variables", "templateType": "anything", "description": "", "definition": "random(1..9)", "name": "q4_r1"}, "q4_r2": {"group": "Ungrouped variables", "templateType": "anything", "description": "", "definition": "random(1..9 except q4_r1)", "name": "q4_r2"}, "q4_t1": {"group": "Ungrouped variables", "templateType": "anything", "description": "", "definition": "random(-5/6,-3/4,-2/3,-1/2,-1/3,-1/4,-1/6,0,1/6,1/4,1/3,1/2,2/3,3/4,5/6)*pi", "name": "q4_t1"}, "q3_t1": {"group": "Ungrouped variables", "templateType": "anything", "description": "", "definition": "random(-5/6,-3/4,-2/3,-1/2,-1/3,-1/4,-1/6,0,1/6,1/4,1/3,1/2,2/3,3/4,5/6)*pi", "name": "q3_t1"}, "q3_t2": {"group": "Ungrouped variables", "templateType": "anything", "description": "", "definition": "random(-5/6,-3/4,-2/3,-1/2,-1/3,-1/4,-1/6,0,1/6,1/4,1/3,1/2,2/3,3/4,5/6)*pi", "name": "q3_t2"}}, "statement": "

In this last exercise, you are given four domains in the $xy$-plane. Your task is to describe them in polar coordinates, by specifying the range for the radius $r$ and for the phase $\\theta$.

\n

All the radii are integers less than 10. The possibilities for the phases are: $0,\\frac{\\pi}{6},\\frac{\\pi}{4},\\frac{\\pi}{3},\\frac{\\pi}{2}$, and the corresponding shifts into the other quadrants of the $xy$-plane. Enter phases rounded to two decimals in the range $[-\\pi,\\pi]$ (it is not possible to enter $\\frac{5\\pi}{6}$ -- you would have to evaluate that).

\n

For example, the unit disk ($\\rightarrow$ area inside the circle of radius $1$ centered at $(0,0)$) should be entered as

\n

$\\begin{pmatrix} r_{\\text{lower}} & r_{\\text{upper}} \\\\ \\theta_{\\text{lower}} & \\theta_{\\text{upper}} \\end{pmatrix} = \\begin{pmatrix} 0 & 1 \\\\ -3.14 & 3.14 \\end{pmatrix}$.

", "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": ""}, "preamble": {"css": "", "js": ""}, "extensions": ["jsxgraph"], "advice": "", "name": "Polar domains", "type": "question", "contributors": [{"name": "Pascal Philipp", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1569/"}]}]}], "contributors": [{"name": "Pascal Philipp", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1569/"}]}