<?xml version="1.0" encoding="UTF-8"?>
<quiz>
<!-- question: 34898  -->
  <question type="formulas">
    <name>
      <text><![CDATA[Vector - Resolve F, E, Num. & Graph - xMax 200]]></text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<p>Force F has a magnitude of {w_given} N and direction of {theta360} degrees measured anti-clockwise from the positive x-axis.</p>]]></text>
    </questiontext>
    <generalfeedback format="html">
      <text></text>
    </generalfeedback>
    <defaultgrade>4</defaultgrade>
    <penalty>0.3333333</penalty>
    <hidden>0</hidden>
    <idnumber></idnumber>
    <correctfeedback format="html">
      <text><![CDATA[<p>Your answer is correct.</p>]]></text>
    </correctfeedback>
    <partiallycorrectfeedback format="html">
      <text><![CDATA[<p>Your answer is partially correct.</p>]]></text>
    </partiallycorrectfeedback>
    <incorrectfeedback format="html">
      <text><![CDATA[<p>Your answer is incorrect.</p>]]></text>
    </incorrectfeedback>
    <shownumcorrect/>
<varsrandom><text>wx = {-200:-60:10, 60:200:10};
wy = {-200:-60:10, 60:200:10};</text>
</varsrandom>
<varsglobal><text><![CDATA[# For scaling the axis: x-max = scalingFACTOR*20
scalingFACTOR = 10;

# Calculate given values for the task
w_given = round(sqrt(wx**2+wy**2),2);
theta = round(180*atan(wy/wx)/pi(),1);
theta360 = wx > 0 ? theta : theta+180;
phi_1 = (theta360 + 180);
phi = phi_1  > 360 ? (phi_1  -  360) : phi_1;]]></text>
</varsglobal>
<answernumbering><text>none</text>
</answernumbering>
<answers>
 <partindex>
  <text>0</text>
 </partindex>
 <placeholder>
  <text></text>
 </placeholder>
 <answermark>
  <text>1</text>
 </answermark>
 <answertype>
  <text>0</text>
 </answertype>
 <numbox>
  <text>2</text>
 </numbox>
 <vars1>
  <text></text>
 </vars1>
 <answer>
  <text>[wx, wy]</text>
 </answer>
 <vars2>
  <text></text>
 </vars2>
 <correctness>
  <text><![CDATA[sum(map("<",map("abs", map("/",_d, _a)),0.02))/len(_a)]]></text>
 </correctness>
 <unitpenalty>
  <text>1</text>
 </unitpenalty>
 <postunit>
  <text></text>
 </postunit>
 <ruleid>
  <text>1</text>
 </ruleid>
 <otherrule>
  <text></text>
 </otherrule>
 <subqtext format="html">
<text><![CDATA[<p>a) Calculate both components Fx and Fy of the given force F (3 s.f.).</p>
Fx = {_0} N &nbsp &nbsp Fy = {_1} N]]></text>
 </subqtext>
 <feedback format="html">
<text></text>
 </feedback>
 <correctfeedback format="html">
<text></text>
 </correctfeedback>
 <partiallycorrectfeedback format="html">
<text></text>
 </partiallycorrectfeedback>
 <incorrectfeedback format="html">
<text></text>
 </incorrectfeedback>
</answers>
<answers>
 <partindex>
  <text>1</text>
 </partindex>
 <placeholder>
  <text></text>
 </placeholder>
 <answermark>
  <text>1</text>
 </answermark>
 <answertype>
  <text>0</text>
 </answertype>
 <numbox>
  <text>2</text>
 </numbox>
 <vars1>
  <text></text>
 </vars1>
 <answer>
  <text>[w_given, phi]</text>
 </answer>
 <vars2>
  <text></text>
 </vars2>
 <correctness>
  <text><![CDATA[sum(map("<",map("abs", map("/",_d, _a)),0.02))/len(_a)]]></text>
 </correctness>
 <unitpenalty>
  <text>1</text>
 </unitpenalty>
 <postunit>
  <text></text>
 </postunit>
 <ruleid>
  <text>1</text>
 </ruleid>
 <otherrule>
  <text></text>
 </otherrule>
 <subqtext format="html">
<text><![CDATA[<p>b) Write the magnitude and direction of the equilibrant force E (3 s.f.).</p>
Magnitude E = {_0} N &nbsp &nbsp Angle &nbsp \(\phi = \){_1} degree (Give the positive angle &nbsp \( 0<\phi<360 \)).]]></text>
 </subqtext>
 <feedback format="html">
<text></text>
 </feedback>
 <correctfeedback format="html">
<text></text>
 </correctfeedback>
 <partiallycorrectfeedback format="html">
<text></text>
 </partiallycorrectfeedback>
 <incorrectfeedback format="html">
<text></text>
 </incorrectfeedback>
</answers>
<answers>
 <partindex>
  <text>2</text>
 </partindex>
 <placeholder>
  <text></text>
 </placeholder>
 <answermark>
  <text>2</text>
 </answermark>
 <answertype>
  <text>0</text>
 </answertype>
 <numbox>
  <text>4</text>
 </numbox>
 <vars1>
  <text></text>
 </vars1>
 <answer>
  <text>[wx,wy,-wx,-wy]</text>
 </answer>
 <vars2>
  <text></text>
 </vars2>
 <correctness>
  <text><![CDATA[sum(map("<",map("abs", map("/",_d, _a)),0.02))/len(_a)]]></text>
 </correctness>
 <unitpenalty>
  <text>1</text>
 </unitpenalty>
 <postunit>
  <text></text>
 </postunit>
 <ruleid>
  <text>1</text>
 </ruleid>
 <otherrule>
  <text></text>
 </otherrule>
 <subqtext format="html">
<text><![CDATA[<p>c1) Adjust F in the diagram below until its components Fx and Fy fit your calculated values.</p>
<p>c2) Adjust the Equilibrant vector E until it resembles the equilibrant vector.</p>

<span class=nolink>
<jsxgraph width="400" height="400" ext_formulas="">

    // JavaScript code to create the construction.
    var jsxCode = function (question) {
        // The scalingFactor (of the coordinate system) is read from the variable in Formulas question.
        // For scaling the axis: x-max = scalingFACTOR*20
        var FACTOR = {scalingFACTOR};
        var xMAX = 20*FACTOR;
        var xCOLOR = "#d07";
        var yCOLOR = "#00f";
        var wCOLOR = "#909";
        var exCOLOR = "#d80";
        var eyCOLOR = "#068";
        var eCOLOR = "#0a0";


        // Import the initial coordinates from formulas input field of this part: requires array with 2 answers
        // Array is stored in [x, y] and initialized with scaled values of [10,10] as default
        var x, y, ex, ey;
        [x, y, ex, ey] = question.getAllValues([10*FACTOR,10*FACTOR,-10*FACTOR,-10*FACTOR]);

        // Initialize the board with coordinate system
        var board = question.initBoard({
                axis:true,
                boundingbox: [-22*FACTOR,22*FACTOR,22*FACTOR,-22*FACTOR],
                showCopyright: false,
                showNavigation: false
            });
        board.create('text', [xMAX,2*FACTOR,'X'], {visible:true, fixed:true, fontSize:15});
        board.create('text', [1*FACTOR,xMAX,'Y'], {visible:true, fixed:true, fontSize:15});

        // Attributes for better graphic appearance of points, lines, vectors
        var w_attributes = {fixed:question.isSolved, showInfobox:false, color:wCOLOR, strokeWidth:4,
            snapSizeX:FACTOR, snapSizeY:FACTOR, snapToGrid:true,
            label:{position:'bot',autoPosition: true, offset:[10,10], color:wCOLOR, fontSize:15}};
        var x_attributes = {fixed:question.isSolved, snapToGrid: false, showInfobox:false, color:xCOLOR, strokeWidth:2, 
            snapSizeX:FACTOR, snapSizeY:FACTOR, snapToGrid:true,
            label:{position:'bot',autoPosition: true, offset:[10,10], color:xCOLOR, fontSize:15}};
        var y_attributes = {fixed:question.isSolved, snapToGrid: false, showInfobox:false, color:yCOLOR, strokeWidth:2,
            snapSizeX:FACTOR, snapSizeY:FACTOR, snapToGrid:true,
            label:{position:'bot',autoPosition: true, offset:[10,10], color:yCOLOR, fontSize:15}};

        var e_attributes = {fixed:question.isSolved, showInfobox:false, color:eCOLOR, strokeWidth:4,
            snapSizeX:FACTOR, snapSizeY:FACTOR, snapToGrid:true,
            label:{position:'bot',autoPosition: true, offset:[10,10], color:eCOLOR, fontSize:15}};
        var ex_attributes = {fixed:question.isSolved, snapToGrid: false, showInfobox:false, color:exCOLOR, strokeWidth:2, 
            snapSizeX:FACTOR, snapSizeY:FACTOR, snapToGrid:true,
            label:{position:'bot',autoPosition: true, offset:[10,10], color:exCOLOR, fontSize:15}};
        var ey_attributes = {fixed:question.isSolved, snapToGrid: false, showInfobox:false, color:eyCOLOR, strokeWidth:2,
            snapSizeX:FACTOR, snapSizeY:FACTOR, snapToGrid:true,
            label:{position:'bot',autoPosition: true, offset:[10,10], color:eyCOLOR, fontSize:15}};   
            
        //Create Points for the vectors
        var oP = board.create("point", [0,0], {fixed:true, visible:false});
        var W = board.create("point", [x,y], w_attributes);
        W.setLabel(""), W.size(2);
        var E = board.create("point", [ex,ey], e_attributes);
        E.setLabel(""), E.size(2);

        // Points WX, WY will be dependent on point W, points EX and EY on E
        x = ()=>{return W.X()};
        y = ()=>{return W.Y()};
        var WX = board.create("point", [x,0], {visible:false});
        var WY = board.create("point", [0,y], {visible:false});

        ex = ()=>{return E.X()};
        ey = ()=>{return E.Y()};
        var EX = board.create("point", [ex,0], {visible:false});
        var EY = board.create("point", [0,ey], {visible:false});

        // Create vectors
        var wx = board.create("arrow", [ oP, WX], x_attributes);
        var wy = board.create("arrow", [ oP, WY], y_attributes);
        var w  = board.create("arrow", [ oP, W ], w_attributes);
        wx.setLabel("Fx");
        wy.setLabel("Fy");       
        w.setLabel("F");

        var e_x = board.create("arrow", [ oP, EX], ex_attributes);
        var e_y = board.create("arrow", [ oP, EY], ey_attributes);
        var e  = board.create("arrow", [ oP, E ], e_attributes);
        e_x.setLabel("Ex");
        e_y.setLabel("Ey");       
        e.setLabel("E");

        // Create dashed lines
        var xLine = board.create("line", [[x,0], [x,y]], x_attributes);
        var yLine = board.create("line", [[0,y], [x,y]], y_attributes);
        xLine.dash(2);
        yLine.dash(2);

        var exLine = board.create("line", [[ex,0], [ex,ey]], ex_attributes);
        var eyLine = board.create("line", [[0,ey], [ex,ey]], ey_attributes);
        exLine.dash(2);
        eyLine.dash(2);
        
        // Update the board
        board.update();

        // Whenever the construction is altered the values of the points are sent to formulas.
        question.bindInput(0,x);
        question.bindInput(1,y);
        question.bindInput(2,ex);
        question.bindInput(3,ey);
    };

    // Execute the JavaScript code.
    new JSXQuestion(BOARDID, jsxCode);

</jsxgraph>
</span>]]></text>
 </subqtext>
 <feedback format="html">
<text></text>
 </feedback>
 <correctfeedback format="html">
<text></text>
 </correctfeedback>
 <partiallycorrectfeedback format="html">
<text></text>
 </partiallycorrectfeedback>
 <incorrectfeedback format="html">
<text></text>
 </incorrectfeedback>
</answers>
  </question>

</quiz>