<?xml version="1.0" encoding="UTF-8"?>
<quiz>
  <question type="stack">
    <name>
      <text>17.3.3.4 Parametric Curves Exercise</text>
    </name>
    <questiontext format="moodle_auto_format">
      <text><![CDATA[<p class="HELM_exercise">Exercise</p>
<p>In the following, eliminate the parameter to give the Cartesian equation in \(x\) and \(y\), writing your answer in a form that gives you information about the shape of the curve. You will also explore graphing the curves.</p>

<ol class="HELM_parts">
<li><p> \(x=t,\ \ y={@aa@}-t,\ \ \ \ 0\le t\le 1\) </p>
<p>Cartesian Equation: [[input:ans1]] [[validation:ans1]] [[feedback:prt1]] </p>
<p> Move the slider on the graph below to see how the graph changes, and then try to put the slider in the correct position to display the correct curve. Notice the range of \(t\). </p>
<p>[Note: This part of the question is not marked and is just for exploration]</p></li>
[[jsxgraph]]
       var board = JXG.JSXGraph.initBoard(divid, { // STACK: when moving to STACK change 'jxgboard' for divid
            boundingbox: [-1, 5, 4, -1],
            keepaspectratio: true,
            showCopyright: false,
            axis: true,
            showNavigation: true
        });
		
		// Curve with sliders
		var a = board.create('slider', [[2,4],[4,4],[0,0,5]], {name: '', snapWidth: 0.5});
		
		var f1 = board.create('functiongraph', [function(x){ return a.Value() - x;}, 0, 1]);

[[/jsxgraph]]

<li><p> \(x={@bb@}-t,\ \ y=t+{@cc@},\ \ \ \ 0\le t\le\infty\) </p>
<p>Cartesian Equation: [[input:ans2]] [[validation:ans2]] [[feedback:prt2]] </p>
<p> Move the sliders on the graph below to see how the graph changes, and then try to put the sliders in the correct position to display the correct curve. Note the range of \(t\). </p>
<p>[Note: This part of the question is not marked and is just for exploration]</p></li>
[[jsxgraph]]
       var board = JXG.JSXGraph.initBoard(divid, { // STACK: when moving to STACK change 'jxgboard' for divid
            boundingbox: [-2, 6, 5, -2],
            keepaspectratio: true,
            showCopyright: false,
            axis: true,
            showNavigation: true
        });
		
		// Curve with sliders
                var b = board.create('slider', [[2,5],[5,5],[0,0,7]], {name: '', snapWidth: 0.5});
		
		var f2 = board.create('functiongraph', [function(x){ return b.Value() - x;}, -20, {#bb#}]);

[[/jsxgraph]]

<li><p>  \(x=\dfrac{{@dd@}}{t},\ \ y=t-{@ee@},\ \ \ \ 0&lt;t&lt;3\) </p>
<p>Cartesian Equation: [[input:ans3]] [[validation:ans3]] [[feedback:prt3]] </p>
<p> You should now sketch the curve on paper.</p></li>

<li><p> \(x={@ff@}\sin \dfrac{\pi t}{2},\ \ y={@gg@}\cos\dfrac{\pi t}{2},\ \ \ \ {@tdmin@}\le t\le {@tdmax@}\) </p>
<p> Cartesian Equation: [[input:ans4]] [[validation:ans4]] [[feedback:prt4]] </p>
<p> You should now sketch the curve on paper.</p></li>
</ol>]]></text>
    </questiontext>
    <generalfeedback format="moodle_auto_format">
      <text><![CDATA[[[todo]]
Add arrows to graphs. Fix domain in part (c).
[[/todo]]
<p> In each part, we are asked to eliminate the parameter to give the Cartesian equation in \(x\) and \(y\), writing our answer in a form that gives us information about the shape of the curve.  Additionally, we then sketch each curve. </p>

<p> (a) \(x=t,\ \ y={@aa@}-t \implies y = {@aa@} - x.\)</p>
<p> Below is a sketch of the curve. Note that \(0\le t\le 1\)</p>
[[jsxgraph]]
       var board = JXG.JSXGraph.initBoard(divid, { // STACK: when moving to STACK change 'jxgboard' for divid
            boundingbox: [-1, {#aa+1#}, 3, -1],
            keepaspectratio: true,
            showCopyright: false,
            axis: true,
            showNavigation: true
        });
		
		// Curve with sliders	
		var f1 = board.create('functiongraph', [function(x){ return {#aa#} - x;}, 0, 1]);

var pt1 = board.create('point', [
    0,               // x = 0
    {#aa#} - 0       // y = aa - 0
], {
    name: 't = 0',
    label: { offset: [15, 10] },
    size: 2,
    color: 'black',
    fixed: true
});

[[/jsxgraph]]

<p> (b) \(x={@bb@}-t,\ \ y=t+{@cc@} \implies t = {@bb@}- x \implies y = {@bb + cc@} - x.\) </p>
<p> Below is a sketch of the curve. Note that \(0\le t\le\infty\) </p>
[[jsxgraph]]
       var board = JXG.JSXGraph.initBoard(divid, { // STACK: when moving to STACK change 'jxgboard' for divid
            boundingbox: [-3, 6, {#bb+1#}, -1],
            keepaspectratio: true,
            showCopyright: false,
            axis: true,
            showNavigation: true
        });
		
		// Curve
		var f2 = board.create('functiongraph', [function(x){ return {#bb+cc#}- x;}, -20, {#bb#}]);

var pt1 = board.create('point', [{#bb#}, {#bb + cc#} - {#bb#}], {
    name: 't = 0',
    label: { offset: [10, -10] },
    size: 2,
    color: 'black',
    fixed: true
});

[[/jsxgraph]]

<p> (c) \(x=\dfrac{{@dd@}}{t},\ \ y=t-{@ee@} \implies t = \dfrac{{@dd@}}{x} \implies y = \dfrac{{@dd@}}{x} - {@ee@},\) but writing this in the form: </p>
<p> \(\qquad x(y+{@ee@}) = {@dd@},\) </p>
<p> allows us to see more clearly that this is part of a hyperbola with horizontal asymptote at \(y = {@-ee@}\).</p>
<p> Below is a sketch of the curve. Note that \(0&lt;t&lt;3\) </p>
[[jsxgraph]]
       var board = JXG.JSXGraph.initBoard(divid, { // STACK: when moving to STACK change 'jxgboard' for divid
            boundingbox: [-1, 6, 10, {#-ee-1#}],
            keepaspectratio: true,
            showCopyright: false,
            axis: true,
            showNavigation: true
        });
		
		// Curve
		var f3 = board.create('functiongraph', [function(x){ return {#dd#}/x - {#ee#};}, {#dd/3#}, 20], {
    strokeColor: 'blue',
    strokeWidth: 1,
    lastArrow: true
});

var x1 = {#dd/3#};

var pt1 = board.create('point', [x1, {#dd#}/x1 - {#ee#}], {
    name: 't = 3',
    label: { offset: [-10, 15] },
    size: 2,
    color: 'black',
    fixed: true
});

[[/jsxgraph]]

<p> (d) We have \(x={@ff@}\sin \dfrac{\pi t}{2},\ \ y={@gg@}\cos\dfrac{\pi t}{2}.\) Noticing we have trig functions, it makes sense to rearrange and square them: </p>
<p> \(\qquad x = {@ff@}\sin \dfrac{\pi t}{2}, \ \ y = {@gg@}\cos \dfrac{\pi t}{2} \implies  \sin \dfrac{\pi t}{2} = \dfrac{x}{{@ff@}}, \ \ \cos \dfrac{\pi t}{2} = \dfrac{y}{@gg@}\)</p>
<p> Squaring these and adding them, we get </p>
<p> \(\begin{align}
\qquad \sin^2 \dfrac{\pi t}{2} + \cos^2 \dfrac{\pi t}{2} &= 1 \\
\left(\dfrac{x}{{@ff@}}\right)^2 + \left(\dfrac{y}{{@gg@}}\right)^2 &= 1 \\
\dfrac{x^2}{{@ff^2@}} + \dfrac{y^2}{{@gg^2@}} &= 1. \end{align}\)</p>
<p> Below is a sketch of the curve. Note that \({@tdmin@}\le t\le {@tdmax@}\)</p>

[[jsxgraph]]
       var board = JXG.JSXGraph.initBoard(divid, { // STACK: when moving to STACK change 'jxgboard' for divid
    boundingbox: [-{#ff+1#}, {#gg+1#}, {#ff+1#}, -{#gg+1#}],
    keepaspectratio: false,
    axis: true,
    showNavigation: true,
    showCopyright: false
});

var ff = {#ff#}; 
var gg = {#gg#};
var tmin = {#tdmin#}
var tmax = {#tdmax#}

var curve = board.create('curve', [
    function(t) { return ff * Math.sin(Math.PI * t / 2); },
    function(t) { return gg * Math.cos(Math.PI * t / 2); },
    tmin, tmax  // range of t
], {
    strokeColor: 'blue',
    strokeWidth: 1,
    lastArrow: true
});


// Create the start and end points of the curve
var ptStart = board.create('point', [
    function() { return ff * Math.sin(tmin * Math.PI * 0.5); },
    function() { return gg * Math.cos(tmin* Math.PI * 0.5); }
], {
    name: 't = {#tdmin#}',
    label: { offset: [-30, 20] },
    size: 2,
    color: 'black',
    fixed: true
});

var ptEnd = board.create('point', [
    function() { return ff * Math.sin(tmax* Math.PI * 0.5); },
    function() { return gg * Math.cos(tmax * Math.PI * 0.5); }
], {
    name: 't = {#tdmax#}',
    label: { offset: [10, -10] },
    size: 2,
    color: 'black',
    fixed: true
});
[[/jsxgraph]]]]></text>
    </generalfeedback>
    <defaultgrade>1</defaultgrade>
    <penalty>0.1</penalty>
    <hidden>0</hidden>
    <idnumber/>
    <stackversion>
      <text>2025073100</text>
    </stackversion>
    <questionvariables>
      <text>/* This is a question about converting parametrized equations into cartesian forms. Students are encouraged to make graphical considerations, but this is not marked. Only part (a) and (b) include an interactable JSX graph.
Part (d) includes code for changing the domain -- see the tdmin and tdmax variables. To change the domain of parts (a)-(c), follow the approach set forward in (d).*/

aa: rand(3) + 1;
bb: rand(3) + 1;
cc: rand(3) + 1;
dd: rand(3) + 1;
ee: rand(3) + 1;
ff: rand(3) + 2;
gg: rand(3) + 3;
tdmin: -2
tdmax: 0.5
xlim1: min(ff * sin(-%pi/2), ff * sin(%pi/4));
xlim2: max(ff * sin(-%pi/2), ff * sin(%pi/4));
ylim1: min(gg * cos(-%pi/2), gg * cos(%pi/4));
ylim2: max(gg * cos(tdmin*%pi/2), gg * cos(tdmax*%pi/2));
ta1: y = aa - x;
ta2: y = bb + cc - x;
ta3: x(y + ee) = dd;
alt3: y = dd/x - ee;
ta4: x^2/ff^2 + y^2/gg^2 = 1;</text>
    </questionvariables>
    <specificfeedback format="html">
      <text/>
    </specificfeedback>
    <questionnote format="html">
      <text><![CDATA[<p>(a) \(x=t,\  y={@aa@}-t\), equation \(= {@ta1@}\), (b) \(x={@bb@}-t,\ y=t+{@cc@}\), equation \(= {@ta2@}\), </p>
<p>(c)  \(x=\dfrac{{@dd@}}{t}, \ y=t-{@ee@}\), equation \(= {@ta3@}\), (d)  \(x={@ff@}\sin \dfrac{\pi t}{2},\ \ y={@gg@}\cos\dfrac{\pi t}{2}\), equation \(= {@ta4@}\).</p>]]></text>
    </questionnote>
    <questiondescription format="html">
      <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>dot</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>y = ?</syntaxhint>
      <syntaxattribute>1</syntaxattribute>
      <forbidwords/>
      <allowwords/>
      <forbidfloat>1</forbidfloat>
      <requirelowestterms>0</requirelowestterms>
      <checkanswertype>1</checkanswertype>
      <mustverify>1</mustverify>
      <showvalidation>3</showvalidation>
      <options/>
    </input>
    <input>
      <name>ans2</name>
      <type>algebraic</type>
      <tans>ta2</tans>
      <boxsize>10</boxsize>
      <strictsyntax>1</strictsyntax>
      <insertstars>0</insertstars>
      <syntaxhint>y = ?</syntaxhint>
      <syntaxattribute>1</syntaxattribute>
      <forbidwords/>
      <allowwords/>
      <forbidfloat>1</forbidfloat>
      <requirelowestterms>0</requirelowestterms>
      <checkanswertype>1</checkanswertype>
      <mustverify>1</mustverify>
      <showvalidation>3</showvalidation>
      <options/>
    </input>
    <input>
      <name>ans3</name>
      <type>algebraic</type>
      <tans>ta3</tans>
      <boxsize>10</boxsize>
      <strictsyntax>1</strictsyntax>
      <insertstars>0</insertstars>
      <syntaxhint>? = ?</syntaxhint>
      <syntaxattribute>1</syntaxattribute>
      <forbidwords/>
      <allowwords/>
      <forbidfloat>1</forbidfloat>
      <requirelowestterms>0</requirelowestterms>
      <checkanswertype>1</checkanswertype>
      <mustverify>1</mustverify>
      <showvalidation>3</showvalidation>
      <options/>
    </input>
    <input>
      <name>ans4</name>
      <type>algebraic</type>
      <tans>ta4</tans>
      <boxsize>10</boxsize>
      <strictsyntax>1</strictsyntax>
      <insertstars>0</insertstars>
      <syntaxhint>? = ?</syntaxhint>
      <syntaxattribute>1</syntaxattribute>
      <forbidwords/>
      <allowwords/>
      <forbidfloat>1</forbidfloat>
      <requirelowestterms>0</requirelowestterms>
      <checkanswertype>1</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</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>ans2</sans>
        <tans>ta2</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/>
      </feedbackvariables>
      <node>
        <name>0</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>ans3</sans>
        <tans>ta3</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>
      <node>
        <name>1</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>ans3</sans>
        <tans>alt3</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>=</truescoremode>
        <truescore>1</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt3-2-T</trueanswernote>
        <truefeedback format="html">
          <text>This is a correct cartesian equation, well done, however your answer is not in the ideal form. See the solution below.</text>
        </truefeedback>
        <falsescoremode>-</falsescoremode>
        <falsescore>0</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt3-2-F</falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
    </prt>
    <prt>
      <name>prt4</name>
      <value>1.0000000</value>
      <autosimplify>1</autosimplify>
      <feedbackstyle>1</feedbackstyle>
      <feedbackvariables>
        <text/>
      </feedbackvariables>
      <node>
        <name>0</name>
        <description/>
        <answertest>AlgEquiv</answertest>
        <sans>ans4</sans>
        <tans>ta4</tans>
        <testoptions/>
        <quiet>0</quiet>
        <truescoremode>=</truescoremode>
        <truescore>1</truescore>
        <truepenalty/>
        <truenextnode>-1</truenextnode>
        <trueanswernote>prt4-1-T</trueanswernote>
        <truefeedback format="html">
          <text/>
        </truefeedback>
        <falsescoremode>=</falsescoremode>
        <falsescore>0</falsescore>
        <falsepenalty/>
        <falsenextnode>-1</falsenextnode>
        <falseanswernote>prt4-1-F</falseanswernote>
        <falsefeedback format="html">
          <text/>
        </falsefeedback>
      </node>
    </prt>
    <deployedseed>465784813</deployedseed>
    <deployedseed>1418688442</deployedseed>
    <deployedseed>2038502938</deployedseed>
    <deployedseed>961851788</deployedseed>
    <deployedseed>2027525112</deployedseed>
    <deployedseed>1069598882</deployedseed>
    <deployedseed>1310637844</deployedseed>
    <deployedseed>1155360080</deployedseed>
    <deployedseed>913524852</deployedseed>
    <deployedseed>848486779</deployedseed>
    <deployedseed>1440584785</deployedseed>
    <deployedseed>606490118</deployedseed>
    <deployedseed>1552184617</deployedseed>
    <deployedseed>719719123</deployedseed>
    <deployedseed>664469756</deployedseed>
    <deployedseed>67859748</deployedseed>
    <deployedseed>897586643</deployedseed>
    <deployedseed>1024255006</deployedseed>
    <deployedseed>615544988</deployedseed>
    <deployedseed>1912822529</deployedseed>
    <qtest>
      <testcase>1</testcase>
      <description>Test case assuming the teacher's input gets full marks.</description>
      <testinput>
        <name>ans1</name>
        <value>ta1</value>
      </testinput>
      <testinput>
        <name>ans2</name>
        <value>ta2</value>
      </testinput>
      <testinput>
        <name>ans3</name>
        <value>ta3</value>
      </testinput>
      <testinput>
        <name>ans4</name>
        <value>ta4</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>
      <expected>
        <name>prt4</name>
        <expectedscore>1.0000000</expectedscore>
        <expectedpenalty>0.0000000</expectedpenalty>
        <expectedanswernote>prt4-1-T</expectedanswernote>
      </expected>
    </qtest>
    <qtest>
      <testcase>2</testcase>
      <description/>
      <testinput>
        <name>ans1</name>
        <value>y = aa - t + 1</value>
      </testinput>
      <testinput>
        <name>ans2</name>
        <value>y = bb + cc - x + 1</value>
      </testinput>
      <testinput>
        <name>ans3</name>
        <value>x(y = ee) = dd + 1</value>
      </testinput>
      <testinput>
        <name>ans4</name>
        <value>x^2/ff^2 + y^2/gg^2 = 2</value>
      </testinput>
      <expected>
        <name>prt1</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty/>
        <expectedanswernote>prt1-1-F</expectedanswernote>
      </expected>
      <expected>
        <name>prt2</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty/>
        <expectedanswernote>prt2-1-F</expectedanswernote>
      </expected>
      <expected>
        <name>prt3</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty/>
        <expectedanswernote>prt3-2-F</expectedanswernote>
      </expected>
      <expected>
        <name>prt4</name>
        <expectedscore>0.0000000</expectedscore>
        <expectedpenalty/>
        <expectedanswernote>prt4-1-F</expectedanswernote>
      </expected>
    </qtest>
  </question>
</quiz>
