<?xml version="1.0" encoding="UTF-8"?>
<quiz>
  <question type="stack">
    <name>
      <text>10.2.3.11 Find mod and Arg (NOT IN QUIZ)</text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<p class="HELM_exercise">Exercise</p>
<ol class="HELM_parts">
<p>Find the modulus and argument of \( z =\displaystyle \dfrac{({@z1@})^{@n1@} \cdot ({@z2@})^{@n2@}}{({@z3@})^{@n3@}} \)</p>

<li><p> \( |z| = \) [[input:ans1]] (Give an exact answer) [[validation:ans1]]&nbsp;[[feedback:prt1]]&nbsp;</p></li>

<li><p> \( \text{arg}(z) = \)&nbsp;[[input:ans2]] (Give your answer to 3 d.p.)&nbsp;[[validation:ans2]]&nbsp;[[feedback:prt2]]</p></li></ol>]]></text>
    </questiontext>
    <generalfeedback format="html">
      <text><![CDATA[<ol class="HELM_parts">
    <p>\( z_1 = {@z1@} \) so \( |z_1| = {@r1@} \) and&nbsp;&nbsp;\( \text{arg}(z_1) = {@theta1@}\)&nbsp;</p>
    <p>\( z_2 = {@z2@} \) so \( |z_2| = {@r2@} \) and&nbsp;&nbsp;\( \text{arg}(z_2) = {@theta2@}\)&nbsp;<br></p>
    <p></p>
    <p>\( z_3 = {@z3@} \) so \( |z_3| = {@r3@} \) and&nbsp;&nbsp;\( \text{arg}(z_3) = {@theta3@}\)&nbsp;</p>
    <p></p>
    <li>
        <p> \( |z| = \dfrac{|z_1|^{@n1@} |z_2|^{@n2@}}{|z_3|^{@n3@}} =&nbsp;&nbsp;\dfrac{({@r1@}^{@n1@}) \cdot ({@r2@}^{@n2@})}{{@r3@}^{@n3@}}&nbsp; = \displaystyle {@ta1@} \)<br></p>
    </li>
    <li>
        <p>\( \text{arg}(z) = {@n1@}\text{arg}(z_1)&nbsp;+ {@n2@}\text{arg}(z_2) -&nbsp;{@n3@}\text{arg}(z_3) = {@ta2@} \)</p>
    </li>
    <p>Have in mind that \( -\pi &lt; \text{arg}(z) \leq \pi \) so you may need to add or subtract a \( \pi\) from your \( \text{arg} \) results.</p>
</ol>]]></text>
    </generalfeedback>
    <defaultgrade>1</defaultgrade>
    <penalty>0.1</penalty>
    <hidden>0</hidden>
    <idnumber/>
    <stackversion>
      <text>2020120600</text>
    </stackversion>
    <questionvariables>
      <text>a1: rand(5)+1
b1: rand([-4,-3,-2,-1]);
a2: rand(4)+1
b2: rand([2,4]);
a3: rand_with_prohib(-3,3,[0]) ;
b3: rand([1,3,5]);
n1: 2;
n2: 3;
n3: 4;
z1: a1+(b1)*%i;
z2: a2+(b2)*%i;
z3: a3+(b3)*%i;

r1: sqrt((a1)^2+(b1)^2);    /*mod z1*/
r2: sqrt((a2)^2+(b2)^2);    /*mod z2*/
r3: sqrt((a3)^2+(b3)^2);    /*mod z3*/
r: ((r1)^(n1)*(r2)^(n2))/((r3)^(n3));              /*mod z */

theta1: decimalplaces(float(atan2(b1, a1)),4);
theta2: decimalplaces(float(atan2(b2, a2)),4);
theta3: decimalplaces(float(atan2(b3, a3)),4);

z: ((z1)^(n1)*(z2)^(n2))/((z3)^(n3));     /* find z */
z: rectform(z)
a: realpart(z)
b: imagpart(z)
theta: decimalplaces(float(atan2(b,a)),3);    /* Arg of z */

ta1: r;
ta2: dispdp(theta,3);</text>
    </questionvariables>
    <specificfeedback format="html">
      <text/>
    </specificfeedback>
    <questionnote format="moodle_auto_format">
      <text>\( z_1 = {@z1@}\), \( z_2 = {@z2@}\), \( z_3 = {@z3@}\) so \( z = {@z@} \), \( |z| = {@ta1@}\) and  \( \text{arg}(z) = {@ta2@}\)</text>
    </questionnote>
    <questiondescription format="moodle_auto_format">
      <text/>
    </questiondescription>
    <questionsimplify>1</questionsimplify>
    <assumepositive>0</assumepositive>
    <assumereal>0</assumereal>
    <prtcorrect format="html">
      <text><![CDATA[<span style="font-size: 1.5em; color:green;"><i class="fa fa-check"></i></span> Correct answer, well done.]]></text>
    </prtcorrect>
    <prtpartiallycorrect format="html">
      <text><![CDATA[<span style="font-size: 1.5em; color:orange;"><i class="fa fa-adjust"></i></span> Your answer is partially correct.]]></text>
    </prtpartiallycorrect>
    <prtincorrect format="html">
      <text><![CDATA[<span style="font-size: 1.5em; color:red;"><i class="fa fa-times"></i></span> Incorrect answer.]]></text>
    </prtincorrect>
    <decimals>.</decimals>
    <scientificnotation>*10</scientificnotation>
    <multiplicationsign>none</multiplicationsign>
    <sqrtsign>1</sqrtsign>
    <complexno>i</complexno>
    <inversetrig>cos-1</inversetrig>
    <logicsymbol>lang</logicsymbol>
    <matrixparens>[</matrixparens>
    <isbroken>0</isbroken>
    <variantsselectionseed/>
    <input>
      <name>ans1</name>
      <type>algebraic</type>
      <tans>ta1</tans>
      <boxsize>10</boxsize>
      <strictsyntax>1</strictsyntax>
      <insertstars>0</insertstars>
      <syntaxhint/>
      <syntaxattribute>0</syntaxattribute>
      <forbidwords/>
      <allowwords/>
      <forbidfloat>1</forbidfloat>
      <requirelowestterms>0</requirelowestterms>
      <checkanswertype>0</checkanswertype>
      <mustverify>1</mustverify>
      <showvalidation>3</showvalidation>
      <options/>
    </input>
    <input>
      <name>ans2</name>
      <type>units</type>
      <tans>ta2</tans>
      <boxsize>5</boxsize>
      <strictsyntax>1</strictsyntax>
      <insertstars>0</insertstars>
      <syntaxhint/>
      <syntaxattribute>0</syntaxattribute>
      <forbidwords/>
      <allowwords/>
      <forbidfloat>0</forbidfloat>
      <requirelowestterms>0</requirelowestterms>
      <checkanswertype>0</checkanswertype>
      <mustverify>1</mustverify>
      <showvalidation>3</showvalidation>
      <options/>
    </input>
    <prt>
      <name>prt1</name>
      <value>1.0000000</value>
      <autosimplify>1</autosimplify>
      <feedbackstyle>1</feedbackstyle>
      <feedbackvariables>
        <text/>
      </feedbackvariables>
      <node>
        <name>0</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>ans1</sans>
        <tans>ta1</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>=</truescoremode>
        <truescore>1.0000000</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt1-1-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>=</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt1-1-F</falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
    </prt>
    <prt>
      <name>prt2</name>
      <value>1.0000000</value>
      <autosimplify>1</autosimplify>
      <feedbackstyle>1</feedbackstyle>
      <feedbackvariables>
        <text/>
      </feedbackvariables>
      <node>
        <name>0</name>
        <description/>
        <answertest>NumDecPlaces</answertest>
        <sans>ans2</sans>
        <tans>theta</tans>
        <testoptions>3</testoptions>
        <quiet>0</quiet>
        <truescoremode>=</truescoremode>
        <truescore>1.0000000</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt2-1-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>=</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>1</falsenextnode>
        <falseanswernote>prt2-1-F</falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
      <node>
        <name>1</name>
        <description/>
        <answertest>NumAbsolute</answertest>
        <sans>ans2</sans>
        <tans>theta</tans>
        <testoptions>0.005</testoptions>
        <quiet>0</quiet>
        <truescoremode>+</truescoremode>
        <truescore>0.0000000</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt2-2-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>-</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt2-2-F</falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
    </prt>
    <deployedseed>1680453421</deployedseed>
    <deployedseed>400167287</deployedseed>
    <deployedseed>967730321</deployedseed>
    <deployedseed>1660737913</deployedseed>
    <deployedseed>1859359354</deployedseed>
    <deployedseed>1687515586</deployedseed>
    <deployedseed>529876466</deployedseed>
    <deployedseed>1291823422</deployedseed>
    <deployedseed>1490399789</deployedseed>
    <deployedseed>325134495</deployedseed>
    <qtest>
      <testcase>1</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>ta1</value>
      </testinput>
      <testinput>
        <name>ans2</name>
        <value>ta2</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt1-1-T</expectedanswernote>
      </expected>
      <expected>
        <name>prt2</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt2-1-T</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>2</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>ev(2*ta1,simp)</value>
      </testinput>
      <testinput>
        <name>ans2</name>
        <value>ev(theta+0.01,simp)</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt1-1-F</expectedanswernote>
      </expected>
      <expected>
        <name>prt2</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt2-2-F</expectedanswernote>
      </expected>
    </qtest>
  </question>
</quiz>
