// Numbas version: finer_feedback_settings {"name": "Vectors", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "feedback": {"showactualmarkwhen": "always", "showtotalmarkwhen": "always", "showanswerstatewhen": "always", "showpartfeedbackmessageswhen": "always", "allowrevealanswer": true, "showexpectedanswerswhen": "inreview", "showadvicewhen": "inreview"}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Vectors", "tags": [], "metadata": {"description": "

Introduction to vectors using engineering notation.

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "

Vectors are a mathematical object which describe a directional quantity such as displacement, force, or momentum. In this module we will think about vectors which live in 2-dimensional space, and in your course you may also also think about 3-dimensional vectors. Mathematicians, data scientists and physicists commonly think about vectors living in much higher dimensional spaces!

\n

Vectors are described by how far they extend in the $x$-direction and the $y$-direction. We use $\\vec{i}$ to represent the vector which travels one unit right (the $x$-direction), and $\\vec{j}$ for the vector which travels one unit upwards (the $y$-direction).

\n

{unitvecs}

\n

General vectors are described as a combination of these two. For example, the vector $$5\\vec{i}-2\\vec{j}$$describes travelling $5$ units right and $2$ units down (note the negative). Play around with the following vector by clicking and dragging the endpoints, and observe how the vector changes!

\n

{vector}

", "advice": "", "rulesets": {}, "extensions": ["jsxgraph"], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"fixed": {"name": "fixed", "group": "Ungrouped variables", "definition": "jsxgraph(\n 300, 300, [-5.5,5.5,5.5,-5.5],\n [\n ['point', [-2,4], [\"id\":\"start\",\"size\":0,\"withLabel\":false,\n \"fixed\":true]],\n ['point', [3,-2], [\"id\":\"end\", \"size\":0, \"withLabel\":false,\n \"fixed\":true,\"highlight\":false]],\n ['arrow', ['start','end'], [\"strokeWidth\":4,\n \"fixed\":true,\"highlight\":false,\"layer\":10,\n \"withLabel\":true,\"name\":\"$\\\\vec{s}$\",\n \"label\": [\n \"anchorX\": 'middle',\n \"anchorY\": 'middle',\n \"offset\": [0, 0],\n \"distance\": 1.8,\n \"position\": '0.5fr left',\n \"fontSize\":20,\n \"highlight\":false\n ]]],\n \n ],\n \n [\"pan\":[\"enabled\":false],\"zoom\":[\"enabled\":false],\n \"DefaultAxes\":[\n \"x\":[\"highlight\":false,\"fixed\":true,\n \"ticks\":[\"minorTicks\":0,\"insertTicks\":false]],\n \"y\":[\"highlight\":false,\"fixed\":true,\n \"ticks\":[\"minorTicks\":0,\"insertTicks\":false]]\n ]]\n)", "description": "", "templateType": "anything", "can_override": false}, "unitvecs": {"name": "unitvecs", "group": "Ungrouped variables", "definition": "jsxgraph(\n 200,200, [-2.5,2.5,2.5,-2.5],\n [\n ['arrow', [[0,0],[1,0]], [\"strokeWidth\":2,\n \"fixed\":true,\"highlight\":false,\"withLabel\":true,\"name\":\"$\\\\vec{i}$\",\n \"label\": [\n \"anchorX\": 'middle',\n \"anchorY\": 'middle',\n \"offset\": [0, 0],\n \"distance\": 1,\n \"position\": '0.5fr right',\n \"fontSize\":15,\n \"highlight\":false\n ]]\n ],\n \n ['arrow', [[0,0],[0,1]], [\"strokeWidth\":2,\n \"fixed\":true,\"highlight\":false,\"withLabel\":true,\"name\":\"$\\\\vec{j}$\",\n \"label\": [\n \"anchorX\": 'middle',\n \"anchorY\": 'middle',\n \"offset\": [0, 0],\n \"distance\": 1.5,\n \"position\": '0.4fr left',\n \"fontSize\":15,\n \"highlight\":false\n ]]\n ],\n \n ['text',[2.2,-0.2,\"$x$\"], [\n \"fontSize\":15,\"color\":\"gray\",\"fixed\":true,\"highlight\":false]],\n ['text',[0.15,2.3,\"$y$\"], [\n \"fontSize\":15,\"color\":\"gray\",\"fixed\":true,\"highlight\":false]],\n \n ],\n \n [\"pan\":[\"enabled\":false],\"zoom\":[\"enabled\":false],\n \"DefaultAxes\":[\n \"x\":[\"highlight\":false,\"fixed\":true,\n \"ticks\":[\"minorTicks\":0,\"insertTicks\":false]],\n \"y\":[\"highlight\":false,\"fixed\":true,\n \"ticks\":[\"minorTicks\":0,\"insertTicks\":false]]\n ]\n ]\n)", "description": "", "templateType": "anything", "can_override": false}, "vector": {"name": "vector", "group": "Ungrouped variables", "definition": "jessiecode(300,300,[-4.5,4.5,4.5,-4.5],safe(\"\"\"\n \n a = point(0,0) <<\n id:\"A\", size:15, withLabel:false, showInfoBox:false,\n strokeWidth:0,highlightStrokeWidth:0,\n fillOpacity:0,highlightFillOpacity:0.2,\n fillColor:\"orange\",highlightFillColor:\"orange\"\n >>;\n \n b = point(3,2) <<\n id:\"B\", size:15, withLabel:false, showInfoBox:false,\n strokeWidth:0,highlightStrokeWidth:0,\n fillOpacity:0,highlightFillOpacity:0.2,\n fillColor:\"orange\",highlightFillColor:\"orange\"\n >>;\n \n v = arrow(a,b) <<\n strokeWidth:3,highlight:false,color:\"SeaGreen\"\n >>;\n \n vx = function() {return trunc(b.X()-a.X(),1);};\n vy = function() {return trunc(b.Y() - a.Y(),1);};\n sign = function() {if (vy() < 0) {return \"\";} else {return \"+\";}};\n \n t = text(4,-4,function() {return \"$\" + vx() + \"\\\\\\\\vec{i}\" + sign() + vy() + \"\\\\\\\\vec{j}$\";}) <<\n anchorX:\"right\", anchorY:\"bottom\",\n fontSize:18, frozen:true, highlight:false\n >>;\n \n back = polygon([0.2,-3.1],[4.1,-3.1],[4.1,-4.1],[0.2,-4.1]) <<\n withLines: false, highlight: false, frozen: true,\n fillColor: \"#E8E8E8\", fillOpacity:1,\n vertices: << visible: false >>\n >>;\n \n reset = button(4.25,4.25,\"reset\",function() {\n A.X=0;A.Y=0;B.X=3;B.Y=2;\n }) <<\n anchorX:\"right\",anchorY:\"top\", fixed:true, highlight:false,\n cssStyle: \"border-radius:3px\"\n >>;\n \n \n\"\"\"),\n[\n \"showNavigation\": false,\n \"zoom\": [\"enabled\": false], pan: [\"enabled\": false],\n \"DefaultAxes\":[\n \"x\":[\"highlight\":false,\"fixed\":true,\n \"ticks\":[\"minorTicks\":0,\"insertTicks\":false]],\n \"y\":[\"highlight\":false,\"fixed\":true,\n \"ticks\":[\"minorTicks\":0,\"insertTicks\":false]]\n ]\n])", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["fixed", "unitvecs", "vector"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "adaptiveMarkingUseCondition": "", "adaptiveMarkingNotUsedMessage": "", "exploreObjective": null, "prompt": "

If $\\vec{v}$ is the vector whose tail is at the origin $(0,0)$ and whose tip is at the point $(3,2)$, then this vector is expressed as $\\vec{v}=$ [[0]].
Hint: Press  reset  on the diagram to see this vector. Type i and j for $\\vec{i}$ and $\\vec{j}$.

\n

Using the diagram, move the tail of the vector to the point $(1,2)$ and the tip to the point $(-1,3)$. The resulting vector is given by $\\vec{v}=$ [[1]].

\n

Now change the vector until it equals $2.8\\vec{i}-3.1\\vec{j}$. This vector points in an approximately [[2]] direction.

\n

Drag the vector by its middle. Doing this [[3]] its tip and tail positions, but [[4]] its values. This means that vectors with the same length and direction but drawn in different places on the grid [[5]].

", "gaps": [{"type": "jme", "useCustomName": true, "customName": "v", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "adaptiveMarkingUseCondition": "", "adaptiveMarkingNotUsedMessage": "", "exploreObjective": null, "answer": "3i+2j", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "notation": "standard", "mustmatchpattern": {"pattern": "((`+- $n*i `| i `| -i) + (`+- $n*j `| j `| -j)) `| (`+- $n*i `| i `| -i) `| (`+- $n*j `| j `| -j) `| 0", "partialCredit": "100", "message": "?i+?j or ?i-?j", "nameToCompare": "", "warningTime": "submission"}, "valuegenerators": [{"name": "j", "value": ""}], "functionsets": ["extension:jsxgraph", "arithmetic", "complex_numbers", "exponentials", "trigonometry", "rounding", "number_theory", "comparison", "linear_algebra", "booleans", "set_theory", "intervals", "number_ranges", "lists", "dictionaries", "strings", "type_casting", "number_parsing", "precision", "json", "jme", "pattern_matching", "html", "randomisation", "control_flow", "comprehensions", "calculus", "marking", "http", "promises"], "enabledfunctions": [], "disabledfunctions": []}, {"type": "jme", "useCustomName": true, "customName": "u", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "adaptiveMarkingUseCondition": "", "adaptiveMarkingNotUsedMessage": "", "exploreObjective": null, "answer": "-2i+j", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "notation": "standard", "mustmatchpattern": {"pattern": "((`+- $n*i `| i `| -i) + (`+- $n*j `| j `| -j)) `| (`+- $n*i `| i `| -i) `| (`+- $n*j `| j `| -j) `| 0", "partialCredit": 0, "message": "?i+?j or ?i-?j", "nameToCompare": "", "warningTime": "submission"}, "valuegenerators": [{"name": "j", "value": ""}], "functionsets": ["extension:jsxgraph", "arithmetic", "complex_numbers", "exponentials", "trigonometry", "rounding", "number_theory", "comparison", "linear_algebra", "booleans", "set_theory", "intervals", "number_ranges", "lists", "dictionaries", "strings", "type_casting", "number_parsing", "precision", "json", "jme", "pattern_matching", "html", "randomisation", "control_flow", "comprehensions", "calculus", "marking", "http", "promises"], "enabledfunctions": [], "disabledfunctions": []}, {"type": "1_n_2", "useCustomName": true, "customName": "direction", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "adaptiveMarkingUseCondition": "", "adaptiveMarkingNotUsedMessage": "", "exploreObjective": null, "minMarks": 0, "maxMarks": 0, "shuffleChoices": false, "displayType": "dropdownlist", "displayColumns": 0, "showBlankOption": true, "showCellAnswerState": true, "interpretedAnswerForm": "list of list of boolean", "choices": ["north-east", "south-east", "north-west", "south-west"], "matrix": ["0", "1", 0, 0], "distractors": ["", "", "", ""]}, {"type": "1_n_2", "useCustomName": true, "customName": "changes1", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "adaptiveMarkingUseCondition": "", "adaptiveMarkingNotUsedMessage": "", "exploreObjective": null, "minMarks": 0, "maxMarks": 0, "shuffleChoices": false, "displayType": "dropdownlist", "displayColumns": 0, "showBlankOption": true, "showCellAnswerState": true, "interpretedAnswerForm": "list of list of boolean", "choices": ["changes", "does not change"], "matrix": ["1", 0], "distractors": ["", ""]}, {"type": "1_n_2", "useCustomName": true, "customName": "changes2", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "adaptiveMarkingUseCondition": "", "adaptiveMarkingNotUsedMessage": "", "exploreObjective": null, "minMarks": 0, "maxMarks": 0, "shuffleChoices": false, "displayType": "dropdownlist", "displayColumns": 0, "showBlankOption": true, "showCellAnswerState": true, "interpretedAnswerForm": "list of list of boolean", "choices": ["changes", "does not change"], "matrix": ["0", "1"], "distractors": ["", ""]}, {"type": "1_n_2", "useCustomName": true, "customName": "equal", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "adaptiveMarkingUseCondition": "", "adaptiveMarkingNotUsedMessage": "", "exploreObjective": null, "minMarks": 0, "maxMarks": 0, "shuffleChoices": false, "displayType": "dropdownlist", "displayColumns": 0, "showBlankOption": true, "showCellAnswerState": true, "interpretedAnswerForm": "list of list of boolean", "choices": ["are always equal", "are sometimes equal", "are never equal"], "matrix": ["1", "0", 0], "distractors": ["", "", ""]}], "sortAnswers": false, "inlineCorrectAnswer": true}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "adaptiveMarkingUseCondition": "", "adaptiveMarkingNotUsedMessage": "", "exploreObjective": null, "prompt": "

{fixed}

\n

This diagram represents the displacement $\\vec{s}$ (in metres) of a robot on a factory floor. This vector $\\vec{s}$ has its tail at the point $($ [[0]] , [[1]] $)$ and its tip at the point $($ [[2]] , [[3]] $)$.

\n

We have $\\vec{s}=$ [[4]]
(Hint: how far has the robot travelled in each direction?)

", "gaps": [{"type": "numberentry", "useCustomName": true, "customName": "x1", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "adaptiveMarkingUseCondition": "", "adaptiveMarkingNotUsedMessage": "", "exploreObjective": null, "minValue": "-2", "maxValue": "-2", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "y1", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "adaptiveMarkingUseCondition": "", "adaptiveMarkingNotUsedMessage": "", "exploreObjective": null, "minValue": "4", "maxValue": "4", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "x2", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "adaptiveMarkingUseCondition": "", "adaptiveMarkingNotUsedMessage": "", "exploreObjective": null, "minValue": "3", "maxValue": "3", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "y2", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "adaptiveMarkingUseCondition": "", "adaptiveMarkingNotUsedMessage": "", "exploreObjective": null, "minValue": "-2", "maxValue": "-2", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "jme", "useCustomName": true, "customName": "s", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "adaptiveMarkingUseCondition": "", "adaptiveMarkingNotUsedMessage": "", "exploreObjective": null, "answer": "5i-6j", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "notation": "standard", "mustmatchpattern": {"pattern": "((`+- $n*i `| i `| -i) + (`+- $n*j `| j `| -j)) `| (`+- $n*i `| i `| -i) `| (`+- $n*j `| j `| -j) `| 0", "partialCredit": 0, "message": "?i+?j or ?i-?j", "nameToCompare": "", "warningTime": "submission"}, "valuegenerators": [{"name": "j", "value": ""}], "functionsets": ["extension:jsxgraph", "arithmetic", "complex_numbers", "exponentials", "trigonometry", "rounding", "number_theory", "comparison", "linear_algebra", "booleans", "set_theory", "intervals", "number_ranges", "lists", "dictionaries", "strings", "type_casting", "number_parsing", "precision", "json", "jme", "pattern_matching", "html", "randomisation", "control_flow", "comprehensions", "calculus", "marking", "http", "promises"], "enabledfunctions": [], "disabledfunctions": []}], "sortAnswers": false, "inlineCorrectAnswer": true}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "showAllParts": false, "contributors": [{"name": "Fern Gossow", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/38158/"}], "resources": []}]}], "contributors": [{"name": "Fern Gossow", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/38158/"}]}