<?xml version="1.0" encoding="UTF-8"?>
<quiz>
  <question type="stack">
    <name>
      <text>2.6.3.8 State eq of circle - advanced</text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<p class="HELM_exercise">Exercise</p>
<p>State the equation of the unique circle which touches the \(x-\)axis at the point \( ({@x1@}, {@y1@})\) and which passes through the point \( ({@x2@}, {@y2@}) .\)</p>
<p>[[input:ans1]] [[validation:ans1]]&nbsp;[[feedback:prt1]]</p>]]></text>
    </questiontext>
    <generalfeedback format="html">
      <text><![CDATA[<p>We are given a circle which touches the \(x-\)axis at the point \( ({@x1@}, {@y1@})\) and passes through the point \( ({@x2@}, {@y2@}) .\)</p>
<p>Since we are told the circle touches the \(x-\)axis \( ({@x1@}, {@y1@})\) the centre of the circle must be at the point \( ({@xc@}, y_c) \) where \( y_c= R.\)</p>
<p>We also know that the radius of the circle is the distance between the centre \( ({@xc@}, y_c)\) and the point \( ({@x2@}, {@y2@}).\)</p>
<p>\[ \begin{align} d = R &amp; = \sqrt{({@xc@}-({@x2@}))^2 + (y_c-({@y2@}))^2} \Rightarrow \\
y_c &amp; = \sqrt{ {@(xc-x2)^2@} + (y_c-{@y2@})^2} \Rightarrow \\
y_c^2 &amp; = {@(xc-x2)^2@} + (y_c-{@y2@})^2 \Rightarrow \\ 
y_c^2 &amp; = {@(xc-x2)^2@} + y_c^2- {@2*y2@}y_c+{@y2^2@} \\ 
{@2*y2@}y_c &amp; = {@(xc-x2)^2+y2^2@} \\
y_c&nbsp; &amp;= {@yc@} \end{align}\]</p>
<p>Hence the centre of the circle is \( C ({@xc@}, {@yc@}) \) and the equation of the circle is: \[ {@ta1@}\]</p>]]></text>
    </generalfeedback>
    <defaultgrade>1</defaultgrade>
    <penalty>0.1</penalty>
    <hidden>0</hidden>
    <idnumber/>
    <stackversion>
      <text>2021120900</text>
    </stackversion>
    <questionvariables>
      <text>ordergreat(x,y);
/* I define the P2 using some trigonomentry abd rotate the point that lies on x-axis by 210=pi+pi/6 and choose the x-values of the centre, xc, to be a multiple of sqrt(3) so that the numbers are nice. */

rr: rand([2,4,6,8])
xc: rand([1,2,4,5])*sqrt(3);                              /* center */                  
yc: rr;
x1: xc;                                            /* point lying on x axis*/
y1: 0;
x2: xc+rr*cos(7*%pi/6);               /*point on the circle, I define it that way so it has nice coordinates*/  
y2: yc+rr*sin(7*%pi/6);                     

ta1: (x-xc)^2+(y-yc)^2=rr^2;

r_conf: (x2-xc)^2+(y2-yc)^2;
w1: (x-xc+1)^2+(y-yc+1)^2=rr^2;</text>
    </questionvariables>
    <specificfeedback format="html">
      <text/>
    </specificfeedback>
    <questionnote format="moodle_auto_format">
      <text>\[C ({@xc@}, {@yc@}), \, P ({@x2@}, {@y2@}), \, r = {@rr@} \text{ and } {@ta1@}\]
\[ {@r_conf@} ={@rr^2@} \]</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>20</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>ev(ans1, x=x2, y=y2)</sans>
        <tans>ev(ta1, x=x2, y=y2)</tans>
        <testoptions/>
        <quiet>1</quiet>
        <truescoremode>=</truescoremode>
        <truescore>0.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><![CDATA[<p dir="ltr" style="text-align: left;">The point \( ({@x2@}, {@y2@}) \) should verify the equation of the circle. In your case \({@expand(ev(ans1, x=x2, y=y2))@}.\) The left hand side of the equation isn't equal to the right hand side, so you must have done something wrong.<br></p>]]></text>
        </falsefeedback>
      </node>
      <node>
        <name>1</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-2-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>-</falsescoremode>
        <falsescore>0.0000000</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt1-2-F</falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
    </prt>
    <deployedseed>730046732</deployedseed>
    <deployedseed>1827908462</deployedseed>
    <deployedseed>2011324345</deployedseed>
    <deployedseed>1644060527</deployedseed>
    <deployedseed>1674136539</deployedseed>
    <deployedseed>1097615443</deployedseed>
    <deployedseed>2098624230</deployedseed>
    <deployedseed>261976727</deployedseed>
    <deployedseed>1462409010</deployedseed>
    <deployedseed>1103147309</deployedseed>
    <deployedseed>382986185</deployedseed>
    <deployedseed>1562306476</deployedseed>
    <qtest>
      <testcase>1</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>ta1</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt1-2-T</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>2</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>w1</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty>0.1000000</expectedpenalty>
        <expectedanswernote>prt1-1-F</expectedanswernote>
      </expected>
    </qtest>
  </question>
</quiz>
