<?xml version="1.0" encoding="UTF-8"?>
<quiz>
  <question type="stack">
    <name>
      <text>17.1.1.14 Exercises 1</text>
    </name>
    <questiontext format="moodle_auto_format">
      <text><![CDATA[<p class="HELM_exercise">Exercise</p>
<p>The equation {@g@} represents an ellipse. Find its centre, the semi-major and semi-minor axes, and the coordinate positions of the foci.</p>

<p>The centre is \((\) [[input:ans1]] [[validation:ans1]],[[input:ans2]] [[validation:ans2]]\()\) [[feedback:prt1]]</p>

<p>The semi-major axis is the [[input:ans3]] [[validation:ans3]] and the semi-minor axis is [[input:ans4]][[validation:ans4]] [[feedback:prt2]]</p>

<p>The foci are at coordinate position \((\) [[input:ans5]] [[validation:ans5]], [[input:ans6]] [[validation:ans6]]\()\) and  \((\) [[input:ans7]] [[validation:ans7]], [[input:ans8]] [[validation:ans8]]\()\)</p>
[[feedback:prt3]]]]></text>
    </questiontext>
    <generalfeedback format="moodle_auto_format">
      <text><![CDATA[<p>By completing the square we may rewrite {@g=0@} in standard form as:</p>
\[{@f+1=1@}\]

<p>Hence, the centre is at \(({@c[1]@},{@c[2]@})\), \(a={@a@}\), and \(b = {@b@}\). Since {@if is(a>b)= true then "\\(a \gt b\\)" else "\\(a\\lt b\\)"@}, the major-axis is {@if is(a>b)= true then "\\(x\\) axis" else "\\(y\\) axis"@} and the minor-axis is {@if is(a>b)= true then "\\(y\\) axis" else "\\(x\\) axis"@}.</p>

Finally, for the foci, we calculate the eccentricity as \(e = {@ec@}\). Then we note that the foci will be {@if is(a>b)= true then "\\(\\pm ae\\)" else "\\(\\pm be\\)"@} from the centre of the ellipse \(({@c[1]@},{@c[2]@})\). Hence the foci are at \(({@foci[1][1]@},{@foci[1][2]@})\) and \(({@foci[2][1]@},{@foci[2][2]@})\).]]></text>
    </generalfeedback>
    <defaultgrade>1</defaultgrade>
    <penalty>0.1</penalty>
    <hidden>0</hidden>
    <idnumber/>
    <stackversion>
      <text>2025073100</text>
    </stackversion>
    <questionvariables>
      <text><![CDATA[ordergreat(x,y);
a:2;
b:3;
if a=b then b:b+1;
/*c:[rand_with_step(-5,5,1),rand_with_step(-5,5,1)]*/
c:[2,-3];
f:(x-c[1])^2/a^2+(y-c[2])^2/b^2-1;
g:expand(a^2*b^2*f);
standard:(x-c[1])^2/a^2+(y-c[2])^2/b^2 = (1+b^2*(c[1])^2+a^2*(c[2])^2)/(a^2*b^2)


ta_centre:c;
if a>b then ta_maj:[["x axis",true],["y axis",false]] else ta_maj:[["x axis",false],["y axis",true]];
if a>b then ta_min:[["x axis",false],["y axis",true]] else ta_min:[["x axis",true],["y axis",false]];

if b<a then ec:sqrt(1-b^2/a^2) else ec:sqrt(1-a^2/b^2);
if b<a then ta_foci:{[c[1]+a*ec,c[2]],[c[1]-a*ec,c[2]]} else ta_foci:{[c[1],c[2]+b*ec],[c[1],c[2]-b*ec]};
foci:listify(ta_foci);]]></text>
    </questionvariables>
    <specificfeedback format="html">
      <text/>
    </specificfeedback>
    <questionnote format="moodle_auto_format">
      <text>The ellipse {@g = 0@} is equivalent to {@f=0@}. It has centre {@ta_centre@}, and foci {@ta_foci@}.</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>onum</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>ta_centre[1]</tans>
      <boxsize>3</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>algebraic</type>
      <tans>ta_centre[2]</tans>
      <boxsize>3</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>ans3</name>
      <type>dropdown</type>
      <tans>ta_maj</tans>
      <boxsize>15</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>ans4</name>
      <type>dropdown</type>
      <tans>ta_min</tans>
      <boxsize>15</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>ans5</name>
      <type>algebraic</type>
      <tans>foci[1][1]</tans>
      <boxsize>5</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>ans6</name>
      <type>algebraic</type>
      <tans>foci[1][2]</tans>
      <boxsize>7</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>ans7</name>
      <type>algebraic</type>
      <tans>foci[2][1]</tans>
      <boxsize>5</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>ans8</name>
      <type>algebraic</type>
      <tans>foci[2][2]</tans>
      <boxsize>7</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>
    <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,ans2]</sans>
        <tans>ta_centre</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>=</truescoremode>
        <truescore>1</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt1-1-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>=</falsescoremode>
        <falsescore>0</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>AlgEquiv</answertest>
        <sans>[[ans3],[ans4]]</sans>
        <tans>[mcq_correct(ta_maj),mcq_correct(ta_min)]</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>=</truescoremode>
        <truescore>1</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt2-1-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>=</falsescoremode>
        <falsescore>0</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt2-1-F</falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
    </prt>
    <prt>
      <name>prt3</name>
      <value>1.0000000</value>
      <autosimplify>1</autosimplify>
      <feedbackstyle>1</feedbackstyle>
      <feedbackvariables>
        <text>sans:{[ans5,ans6],[ans7,ans8]};</text>
      </feedbackvariables>
      <node>
        <name>0</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>sans</sans>
        <tans>ta_foci</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>=</truescoremode>
        <truescore>1</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt3-1-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>=</falsescoremode>
        <falsescore>0</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt3-1-F</falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
    </prt>
    <deployedseed>1937102665</deployedseed>
    <qtest>
      <testcase>1</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>ta_centre[1]</value>
      </testinput>
      <testinput>
        <name>ans2</name>
        <value>ta_centre[2]</value>
      </testinput>
      <testinput>
        <name>ans3</name>
        <value>first(mcq_correct(ta_maj))</value>
      </testinput>
      <testinput>
        <name>ans4</name>
        <value>first(mcq_correct(ta_min))</value>
      </testinput>
      <testinput>
        <name>ans5</name>
        <value>foci[1][1]</value>
      </testinput>
      <testinput>
        <name>ans6</name>
        <value>foci[1][2]</value>
      </testinput>
      <testinput>
        <name>ans7</name>
        <value>foci[2][1]</value>
      </testinput>
      <testinput>
        <name>ans8</name>
        <value>foci[2][2]</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>
      <expected>
        <name>prt3</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt3-1-T</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>2</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>ta_centre[1]</value>
      </testinput>
      <testinput>
        <name>ans2</name>
        <value>ta_centre[2]</value>
      </testinput>
      <testinput>
        <name>ans3</name>
        <value>first(mcq_correct(ta_maj))</value>
      </testinput>
      <testinput>
        <name>ans4</name>
        <value>first(mcq_correct(ta_min))</value>
      </testinput>
      <testinput>
        <name>ans5</name>
        <value>foci[2][1]</value>
      </testinput>
      <testinput>
        <name>ans6</name>
        <value>foci[2][2]</value>
      </testinput>
      <testinput>
        <name>ans7</name>
        <value>foci[1][1]</value>
      </testinput>
      <testinput>
        <name>ans8</name>
        <value>foci[1][2]</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>
      <expected>
        <name>prt3</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt3-1-T</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>3</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>ta_centre[1]</value>
      </testinput>
      <testinput>
        <name>ans2</name>
        <value>ta_centre[2]</value>
      </testinput>
      <testinput>
        <name>ans3</name>
        <value>first(mcq_correct(ta_maj))</value>
      </testinput>
      <testinput>
        <name>ans4</name>
        <value>first(mcq_correct(ta_min))</value>
      </testinput>
      <testinput>
        <name>ans5</name>
        <value>foci[1][1]</value>
      </testinput>
      <testinput>
        <name>ans6</name>
        <value>foci[1][2]</value>
      </testinput>
      <testinput>
        <name>ans7</name>
        <value>foci[1][1]</value>
      </testinput>
      <testinput>
        <name>ans8</name>
        <value>foci[1][2]</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>
      <expected>
        <name>prt3</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt3-1-F</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>4</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>ta_centre[1]+1</value>
      </testinput>
      <testinput>
        <name>ans2</name>
        <value>ta_centre[2]+1</value>
      </testinput>
      <testinput>
        <name>ans3</name>
        <value>first(mcq_incorrect(ta_maj))</value>
      </testinput>
      <testinput>
        <name>ans4</name>
        <value>first(mcq_incorrect(ta_min))</value>
      </testinput>
      <testinput>
        <name>ans5</name>
        <value>foci[1][1]+1</value>
      </testinput>
      <testinput>
        <name>ans6</name>
        <value>foci[1][2]+1</value>
      </testinput>
      <testinput>
        <name>ans7</name>
        <value>foci[2][1]+1</value>
      </testinput>
      <testinput>
        <name>ans8</name>
        <value>foci[2][2]+1</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-1-F</expectedanswernote>
      </expected>
      <expected>
        <name>prt3</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt3-1-F</expectedanswernote>
      </expected>
    </qtest>
  </question>
</quiz>
