<?xml version="1.0" encoding="UTF-8"?>
<quiz>
  <question type="stack">
    <name>
      <text>17.1.1.6 Equations of circles</text>
    </name>
    <questiontext format="html">
      <text><![CDATA[Find the centre and radius of each of the following circles:

<ol class="HELM_parts">
    <li><p>\({@poly1=0@}\)</p>
        <p>Centre: \((\)[[input:ans1]] [[validation:ans1]] ,[[input:ans2]] [[validation:ans2]]\()\)</p>
        <p>Radius: [[input:ans3]][[validation:ans3]]</p>
      <p>[[feedback:prt1]]</p>
    </li>

    <li><p>\({@poly2=0@}\)</p>
        <p>Centre: \((\)[[input:ans4]] [[validation:ans4]], [[input:ans5]] [[validation:ans5]]\()\)</p>
        <p>Radius: [[input:ans6]][[validation:ans6]]</p>
      <p>[[feedback:prt2]]</p></li>
</ol>]]></text>
    </questiontext>
    <generalfeedback format="html">
      <text><![CDATA[<ol type="a">
    <li>We observe that \({@at(poly1,y=0)-const1@} = {@(x-a1)^2 -expand((x-a1)^2 - (at(poly1,y=0)-const1) )@}\) and&nbsp;\({@at(poly1,x=0)-const1@} = {@(y-b1)^2 -expand((y-b1)^2 - (at(poly1,x=0)-const1) )@}\). Hence we may rearrange to obtain: \[{@poly1@}
        =&nbsp;{@(x-a1)^2 -expand((x-a1)^2 - (at(poly1,y=0)-const1) )+(y-b1)^2 -expand((y-b1)^2 - (at(poly1,x=0)-const1) )+ const1@}= 0 .\]
        <p>Hence the centre is \(({@c1[1]@},{@c1[2]@})\), and the radius is \(\sqrt{{@r1^2@}} = {@r1@}\).</p>
    </li>
    <li>First we divide through by \({@1/r2^2@}\) to obtain \({@poly2a@}=0\). We then observe that \({@at(poly2a,y=0)-const2@} = {@(x-a2)^2 -expand((x-a2)^2 - (at(poly2a,y=0)-const2) )@}\) and&nbsp;\({@at(poly2a,x=0)-const2@} = {@(y-b2)^2 -expand((y-b2)^2 - (at(poly2a,x=0)-const2) )@}\). Hence we may rearrange to obtain: \[{@poly2a@}
        =&nbsp;{@(x-a2)^2 -expand((x-a2)^2 - (at(poly2a,y=0)-const2) )+(y-b2)^2 -expand((y-b2)^2 - (at(poly2a,x=0)-const2) )+ const2@}= 0 .\]
        <p>Hence the centre is \(({@c2[1]@},{@c2[2]@})\), and the radius is \(\sqrt{{@r2^2@}} = {@r2@}\).</p>
    </li>
</ol>]]></text>
    </generalfeedback>
    <defaultgrade>1</defaultgrade>
    <penalty>0.1</penalty>
    <hidden>0</hidden>
    <idnumber/>
    <stackversion>
      <text>2025073100</text>
    </stackversion>
    <questionvariables>
      <text>ordergreat(x,y);
/*Centres and radii of two circles */
a1:rand_with_step(-5,5,1)
b1:rand_with_step(-5,5,1)
a2:rand_with_step(-5,5,1)
b2:rand_with_step(-5,5,1)
c1:[a1,b1];
r1:1+rand(5);
c2:[a2,b2];
r2:1/sqrt(rand([2,3,5,7]));

/*Reverse engineering the equations*/
poly1:expand((x-c1[1])^2+(y-c1[2])^2-r1^2)
poly2:expand(((x-c2[1])^2+(y-c2[2])^2-r2^2)/r2^2)

/*useful things for the general feedback*/
poly2a:expand((x-c2[1])^2+(y-c2[2])^2-r2^2)
const1:at(poly1,[x=0,y=0])
const2:at(poly2a,[x=0,y=0])</text>
    </questionvariables>
    <specificfeedback format="html">
      <text/>
    </specificfeedback>
    <questionnote format="moodle_auto_format">
      <text>\[{@poly1=0@}, \quad C=({@c1[1]@},{@c1[2]@}), \quad R={@r1@}\]
\[{@poly2=0@}, \quad C=({@c2[1]@},{@c2[2]@}), \quad R = {@r2@}\]</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>c1[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>c1[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>algebraic</type>
      <tans>r1</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>ans4</name>
      <type>algebraic</type>
      <tans>c2[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>ans5</name>
      <type>algebraic</type>
      <tans>c2[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>ans6</name>
      <type>algebraic</type>
      <tans>r2</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>
    <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>c1</tans>
        <testoptions/>
        <quiet>1</quiet>
        <truescoremode>=</truescoremode>
        <truescore>0.5</truescore>
        <truepenalty/>
        <truenextnode>1</truenextnode>
        <trueanswernote>prt1-1-T</trueanswernote>
        <truefeedback format="html">
          <text><![CDATA[<p dir="ltr" style="text-align: left;">You have correctly identified the centre.</p>]]></text>
        </truefeedback>
        <falsescoremode>=</falsescoremode>
        <falsescore>0</falsescore>
        <falsepenalty/>
        <falsenextnode>1</falsenextnode>
        <falseanswernote>prt1-1-F</falseanswernote>
        <falsefeedback format="html">
          <text><![CDATA[<p dir="ltr" style="text-align: left;">You have not identified the centre correctly.<br></p>]]></text>
        </falsefeedback>
      </node>
      <node>
        <name>1</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>ans3</sans>
        <tans>r1</tans>
        <testoptions/>
        <quiet>1</quiet>
        <truescoremode>+</truescoremode>
        <truescore>0.5</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt1-2-T</trueanswernote>
        <truefeedback format="html">
          <text><![CDATA[<p dir="ltr" style="text-align: left;">You have correctly identified the radius.</p>]]></text>
        </truefeedback>
        <falsescoremode>-</falsescoremode>
        <falsescore>0</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt1-2-F</falseanswernote>
        <falsefeedback format="html">
          <text><![CDATA[<p dir="ltr" style="text-align: left;">You have not identified the radius correctly.<br></p>]]></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>[ans4,ans5]</sans>
        <tans>c2</tans>
        <testoptions/>
        <quiet>1</quiet>
        <truescoremode>=</truescoremode>
        <truescore>0.5</truescore>
        <truepenalty/>
        <truenextnode>1</truenextnode>
        <trueanswernote>prt2-1-T</trueanswernote>
        <truefeedback format="html">
          <text><![CDATA[<p dir="ltr" style="text-align: left;">You have correctly identified the centre.<br></p>]]></text>
        </truefeedback>
        <falsescoremode>=</falsescoremode>
        <falsescore>0</falsescore>
        <falsepenalty/>
        <falsenextnode>1</falsenextnode>
        <falseanswernote>prt2-1-F</falseanswernote>
        <falsefeedback format="html">
          <text><![CDATA[<p dir="ltr" style="text-align: left;">You have not identified the centre correctly.<br></p>]]></text>
        </falsefeedback>
      </node>
      <node>
        <name>1</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>ans6</sans>
        <tans>r2</tans>
        <testoptions/>
        <quiet>1</quiet>
        <truescoremode>+</truescoremode>
        <truescore>0.5</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt2-2-T</trueanswernote>
        <truefeedback format="html">
          <text><![CDATA[<p dir="ltr" style="text-align: left;">You have correctly identified the radius.</p>]]></text>
        </truefeedback>
        <falsescoremode>-</falsescoremode>
        <falsescore>0</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt2-2-F</falseanswernote>
        <falsefeedback format="html">
          <text><![CDATA[<p dir="ltr" style="text-align: left;">You have not identified the radius correctly.<br></p>]]></text>
        </falsefeedback>
      </node>
    </prt>
    <deployedseed>286542596</deployedseed>
    <deployedseed>454877912</deployedseed>
    <deployedseed>1351795665</deployedseed>
    <deployedseed>1673366211</deployedseed>
    <deployedseed>563492137</deployedseed>
    <deployedseed>1800814045</deployedseed>
    <deployedseed>866541357</deployedseed>
    <deployedseed>1008520375</deployedseed>
    <deployedseed>796316876</deployedseed>
    <deployedseed>1871869893</deployedseed>
    <deployedseed>1759950372</deployedseed>
    <deployedseed>719904135</deployedseed>
    <deployedseed>1653144834</deployedseed>
    <deployedseed>1447878792</deployedseed>
    <deployedseed>1033327647</deployedseed>
    <deployedseed>1691773482</deployedseed>
    <deployedseed>37575452</deployedseed>
    <deployedseed>2022566785</deployedseed>
    <deployedseed>2070703059</deployedseed>
    <deployedseed>1987819826</deployedseed>
    <qtest>
      <testcase>1</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>c1[1]</value>
      </testinput>
      <testinput>
        <name>ans2</name>
        <value>c1[2]</value>
      </testinput>
      <testinput>
        <name>ans3</name>
        <value>r1</value>
      </testinput>
      <testinput>
        <name>ans4</name>
        <value>c2[1]</value>
      </testinput>
      <testinput>
        <name>ans5</name>
        <value>c2[2]</value>
      </testinput>
      <testinput>
        <name>ans6</name>
        <value>r2</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt1-2-T</expectedanswernote>
      </expected>
      <expected>
        <name>prt2</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt2-2-T</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>2</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>c1[1]</value>
      </testinput>
      <testinput>
        <name>ans2</name>
        <value>c1[2]</value>
      </testinput>
      <testinput>
        <name>ans3</name>
        <value>r1</value>
      </testinput>
      <testinput>
        <name>ans4</name>
        <value>c2[1]</value>
      </testinput>
      <testinput>
        <name>ans5</name>
        <value>c2[2]</value>
      </testinput>
      <testinput>
        <name>ans6</name>
        <value>radcan(r2)</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt1-2-T</expectedanswernote>
      </expected>
      <expected>
        <name>prt2</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt2-2-T</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>3</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>c1[1]</value>
      </testinput>
      <testinput>
        <name>ans2</name>
        <value>c1[2]</value>
      </testinput>
      <testinput>
        <name>ans3</name>
        <value>r1</value>
      </testinput>
      <testinput>
        <name>ans4</name>
        <value>c2[1]</value>
      </testinput>
      <testinput>
        <name>ans5</name>
        <value>c2[2]</value>
      </testinput>
      <testinput>
        <name>ans6</name>
        <value>fullratsimp(r2)</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt1-2-T</expectedanswernote>
      </expected>
      <expected>
        <name>prt2</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt2-2-T</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>4</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>c1[1]</value>
      </testinput>
      <testinput>
        <name>ans2</name>
        <value>c1[2]</value>
      </testinput>
      <testinput>
        <name>ans3</name>
        <value>r1</value>
      </testinput>
      <testinput>
        <name>ans4</name>
        <value>c2[1]</value>
      </testinput>
      <testinput>
        <name>ans5</name>
        <value>c2[2]</value>
      </testinput>
      <testinput>
        <name>ans6</name>
        <value>r2^2/r2</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt1-2-T</expectedanswernote>
      </expected>
      <expected>
        <name>prt2</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt2-2-T</expectedanswernote>
      </expected>
    </qtest>
  </question>
</quiz>
