// Numbas version: finer_feedback_settings {"name": "Simon's copy of Polar form of a complex number", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"tags": [], "name": "Simon's copy of Polar form of a complex number", "extensions": [], "variable_groups": [], "rulesets": {}, "variablesTest": {"condition": "", "maxRuns": 100}, "parts": [{"extendBaseMarkingAlgorithm": true, "sortAnswers": false, "variableReplacements": [], "prompt": "

$r=$ [[0]] (Enter your answer to 3 d.p.)

", "variableReplacementStrategy": "originalfirst", "type": "gapfill", "unitTests": [], "customMarkingAlgorithm": "", "showFeedbackIcon": true, "marks": 0, "scripts": {}, "useCustomName": false, "showCorrectAnswer": true, "customName": "", "gaps": [{"mustBeReduced": false, "maxValue": "absz+tol", "extendBaseMarkingAlgorithm": true, "correctAnswerStyle": "plain", "mustBeReducedPC": 0, "variableReplacements": [], "allowFractions": false, "variableReplacementStrategy": "originalfirst", "type": "numberentry", "unitTests": [], "customMarkingAlgorithm": "", "correctAnswerFraction": false, "showFeedbackIcon": true, "minValue": "absz-tol", "showFractionHint": true, "marks": 1, "scripts": {}, "useCustomName": false, "showCorrectAnswer": true, "customName": "", "notationStyles": ["plain", "en", "si-en"]}]}, {"extendBaseMarkingAlgorithm": true, "sortAnswers": false, "variableReplacements": [], "prompt": "

$\\theta=$ [[0]] (Enter your answer to 3 d.p.)

", "variableReplacementStrategy": "originalfirst", "type": "gapfill", "unitTests": [], "customMarkingAlgorithm": "", "showFeedbackIcon": true, "marks": 0, "scripts": {}, "useCustomName": false, "showCorrectAnswer": true, "customName": "", "gaps": [{"mustBeReduced": false, "maxValue": "argz+tol", "extendBaseMarkingAlgorithm": true, "correctAnswerStyle": "plain", "mustBeReducedPC": 0, "variableReplacements": [], "allowFractions": false, "variableReplacementStrategy": "originalfirst", "type": "numberentry", "unitTests": [], "customMarkingAlgorithm": "", "correctAnswerFraction": false, "showFeedbackIcon": true, "minValue": "argz-tol", "showFractionHint": true, "marks": 1, "scripts": {}, "useCustomName": false, "showCorrectAnswer": true, "customName": "", "notationStyles": ["plain", "en", "si-en"]}]}], "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

Polar form of a complex number.

"}, "ungrouped_variables": ["a", "argz", "b", "absz", "tol", "z"], "preamble": {"js": "", "css": ""}, "statement": "

Write the complex number $z=\\var{z}$ in polar form $z=r\\mathrm{e}^{i\\theta}$, with $r>0$, $-\\pi<\\theta\\leqslant\\pi$, by calculating $r$ and $\\theta$.

", "variables": {"tol": {"name": "tol", "group": "Ungrouped variables", "description": "", "templateType": "anything", "definition": "0.001"}, "absz": {"name": "absz", "group": "Ungrouped variables", "description": "", "templateType": "anything", "definition": "precround(abs(z),3)"}, "argz": {"name": "argz", "group": "Ungrouped variables", "description": "", "templateType": "anything", "definition": "precround(arg(z),3)"}, "a": {"name": "a", "group": "Ungrouped variables", "description": "", "templateType": "anything", "definition": "random(0..5)*sign(random(-1,1))"}, "b": {"name": "b", "group": "Ungrouped variables", "description": "", "templateType": "anything", "definition": "random(0..5 except a)*sign(random(-1,1))"}, "z": {"name": "z", "group": "Ungrouped variables", "description": "", "templateType": "anything", "definition": "a+b*i"}}, "functions": {}, "advice": "

To write a complex number $z=a+bi$ in polar form $z=r\\mathrm{e}^{i\\theta}$, we calculate the modulus $r = \\lvert z \\rvert$ and argument $\\theta = \\arg(z)$.

\n

Hence

\n

\\[r=\\lvert z \\rvert=\\sqrt{a^2+b^2}=\\sqrt{(\\var{a})^2+(\\var{b})^2}=\\var{absz}\\;\\text{to 3d.p.}\\]

\n

and, in general,

\n

\\[\\theta=\\arg(z)=\\arctan\\left(\\frac{b}{a}\\right).\\]

\n

\n

We have to be careful using this formula for 2 reasons:

\n\n

\n\n

\n

\n

\n

In our example $a=\\var{a}$, and $b=\\var{b}$, so $\\arctan\\left(\\frac{b}{a}\\right) = \\var{arctan(b/a)}$

\n

\n

Since $a \\var{switch(a<0,\" < \",\" ≥ \")}$ 0 and $b \\var{switch(b<0,\" < \",\" ≥ \")}$ 0, we require $\\var{switch(a<0 and b<0,\" -π < θ < -π/2 \",a<0,\" π/2 < θ ≤ π \",b<0,\" -π/2 ≤ θ < 0 \",\" 0 ≤ θ ≤ π/2 \")}$ to be in the correct quadrant. Hence:

\n

\n

$\\arg(z)=\\var{switch(a<0 and b<0,arctan(b/a),a<0,arctan(b/a),\"(we already have the correct quadrant) = \")} \\var{switch(a<0 and b<0,\" - π =\",a<0,\" + π =\",\"\")}\\var{argz}$.

", "type": "question", "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}, {"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Simon Thomas", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3148/"}]}]}], "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}, {"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Simon Thomas", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3148/"}]}