// Numbas version: finer_feedback_settings {"name": "Lengths of and distance between vectors, dot and cross products, ", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variable_groups": [], "variables": {"a": {"group": "Ungrouped variables", "templateType": "anything", "definition": "vector(repeat(random(1..9)*sign(random(1,-1)),3))", "description": "", "name": "a"}, "crossab": {"group": "Ungrouped variables", "templateType": "anything", "definition": "cross(a,b)", "description": "", "name": "crossab"}, "lena": {"group": "Ungrouped variables", "templateType": "anything", "definition": "precround(abs(a),2)", "description": "", "name": "lena"}, "b": {"group": "Ungrouped variables", "templateType": "anything", "definition": "vector(repeat(random(1..9)*sign(random(1,-1)),3))", "description": "", "name": "b"}, "dotab": {"group": "Ungrouped variables", "templateType": "anything", "definition": "dot(a,b)", "description": "", "name": "dotab"}, "sumab": {"group": "Ungrouped variables", "templateType": "anything", "definition": "a+b", "description": "", "name": "sumab"}, "dist": {"group": "Ungrouped variables", "templateType": "anything", "definition": "precround(abs(a-b),2)", "description": "", "name": "dist"}, "lenb": {"group": "Ungrouped variables", "templateType": "anything", "definition": "precround(abs(b),2)", "description": "", "name": "lenb"}, "diffab": {"group": "Ungrouped variables", "templateType": "anything", "definition": "a-b", "description": "", "name": "diffab"}}, "ungrouped_variables": ["a", "lenb", "lena", "b", "dist", "dotab", "diffab", "sumab", "crossab"], "question_groups": [{"pickingStrategy": "all-ordered", "questions": [], "name": "", "pickQuestions": 0}], "name": "Lengths of and distance between vectors, dot and cross products, ", "functions": {}, "showQuestionGroupNames": false, "parts": [{"scripts": {}, "gaps": [{"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "lena+0.01", "minValue": "lena-0.01", "showCorrectAnswer": true, "marks": 1}, {"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "lenb+0.01", "minValue": "lenb-0.01", "showCorrectAnswer": true, "marks": 1}], "type": "gapfill", "prompt": "

Their lengths: $a=\\lvert\\boldsymbol{a}\\rvert=$ [[0]], $b=\\lvert\\boldsymbol{b}\\rvert=$ [[1]].  (Enter your answers to 2d.p.)

", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "dist+0.01", "minValue": "dist-0.01", "showCorrectAnswer": true, "marks": 1}], "type": "gapfill", "prompt": "

The distance, $d=$ [[0]], between $\\boldsymbol{a}$ and $\\boldsymbol{b}$, assuming their common initial point is at the origin.  (Enter your answer to 2d.p.)

", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "sumab[0]", "minValue": "sumab[0]", "showCorrectAnswer": true, "marks": 1}, {"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "sumab[1]", "minValue": "sumab[1]", "showCorrectAnswer": true, "marks": 1}, {"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "sumab[2]", "minValue": "sumab[2]", "showCorrectAnswer": true, "marks": 1}, {"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "diffab[0]", "minValue": "diffab[0]", "showCorrectAnswer": true, "marks": 1}, {"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "diffab[1]", "minValue": "diffab[1]", "showCorrectAnswer": true, "marks": 1}, {"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "diffab[2]", "minValue": "diffab[2]", "showCorrectAnswer": true, "marks": 1}], "type": "gapfill", "prompt": "

Their sum, $\\boldsymbol{a}+\\boldsymbol{b}=($[[0]]$,$[[1]]$,$[[2]]$)$, and difference, $\\boldsymbol{a}-\\boldsymbol{b}=($[[3]]$,$[[4]]$,$[[5]]$)$.

", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "dotab", "minValue": "dotab", "showCorrectAnswer": true, "marks": 1}], "type": "gapfill", "prompt": "

Their dot product $\\boldsymbol{a\\cdot b}=$ [[0]].

", "showCorrectAnswer": true, "marks": 0}, {"scripts": {}, "gaps": [{"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "crossab[0]", "minValue": "crossab[0]", "showCorrectAnswer": true, "marks": 1}, {"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "crossab[1]", "minValue": "crossab[1]", "showCorrectAnswer": true, "marks": 1}, {"correctAnswerFraction": false, "showPrecisionHint": false, "allowFractions": false, "scripts": {}, "type": "numberentry", "maxValue": "crossab[2]", "minValue": "crossab[2]", "showCorrectAnswer": true, "marks": 1}], "type": "gapfill", "prompt": "

Their cross product $\\boldsymbol{a}\\times\\boldsymbol{b}=($[[0]]$,$[[1]]$,$[[2]]$)$.

", "showCorrectAnswer": true, "marks": 0}], "statement": "

Given the vectors $\\boldsymbol{a}=\\pmatrix{\\var{a[0]},\\var{a[1]},\\var{a[2]}}$ and $\\boldsymbol{b}=\\pmatrix{\\var{b[0]},\\var{b[1]},\\var{b[2]}}$ find:

", "tags": ["checked2015", "MAS1602", "MAS2104"], "rulesets": {"std": ["all", "!collectNumbers", "!noLeadingMinus"]}, "preamble": {"css": "", "js": ""}, "type": "question", "metadata": {"notes": "", "licence": "Creative Commons Attribution 4.0 International", "description": "

Calculations of the lengths of two 3D vectors, the distance between their terminal points, their sum, difference, and dot and cross products.

"}, "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "

For the general 3-component vectors $\\boldsymbol{a}=\\pmatrix{a_1,a_2,a_3}$ and $\\boldsymbol{b}=\\pmatrix{b_1,b_2,b_3}$, we have

\n

a)

\n

Lengths: $a=\\lvert\\boldsymbol{a}\\rvert=\\sqrt{a_1^2+a_2^2+a_3^2}$ and $b=\\lvert\\boldsymbol{b}\\rvert=\\sqrt{b_1^2+b_2^2+b_3^2}$, which are scalar quantities.

\n

 

\n

b)

\n

Distance between the terminal points: $d=\\sqrt{(a_1-b_1)^2+(a_2-b_2)^2+(a_3-b_3)^2}$, which is a scalar quantity.

\n

 

\n

c)

\n

Sum $\\boldsymbol{a}+\\boldsymbol{b}=\\pmatrix{a_1+b_1,a_2+b_2,a_3+b_3}$ and difference $\\boldsymbol{a}-\\boldsymbol{b}=\\pmatrix{a_1-b_1,a_2-b_2,a_3-b_3}$, which are vector quantities.

\n

 

\n

d)

\n

Dot product: $\\boldsymbol{a\\cdot b}=a_1b_1+a_2b_2+a_3b_3$, which is a scalar quantity.

\n

 

\n

e)

\n

Cross product: $\\boldsymbol{a}\\times\\boldsymbol{b}=\\pmatrix{a_2b_3-a_3b_2,a_3b_1-a_1b_3,a_1b_2-a_2b_1}$, which is a vector quantity.

\n

 

\n

In this question, therefore, we have:

\n

a)

\n

Lengths: $a=\\lvert\\boldsymbol{a}\\rvert=\\sqrt{\\var{a[0]^2}+\\var{a[1]^2}+\\var{a[2]^2}}=\\var{lena}$ and $b=\\lvert\\boldsymbol{b}\\rvert=\\sqrt{\\var{b[0]^2}+\\var{b[1]^2}+\\var{b[2]^2}}=\\var{lenb}$.

\n

 

\n

b)

\n

Distance between the terminal points: $d=\\sqrt{(\\simplify[std]{{a[0]}-{b[0]}})^2+(\\simplify[std]{{a[1]}-{b[1]}})^2+(\\simplify[std]{{a[2]}-{b[2]}})^2}=\\var{dist}$.

\n

 

\n

c)

\n

Sum $\\boldsymbol{a}+\\boldsymbol{b}=\\pmatrix{\\simplify[std]{{a[0]}+{b[0]}},\\simplify[std]{{a[1]}+{b[1]}},\\simplify[std]{{a[2]}+{b[2]}}}=\\pmatrix{\\var{sumab[0]},\\var{sumab[1]},\\var{sumab[2]}}$ and difference $\\boldsymbol{a}-\\boldsymbol{b}=\\pmatrix{\\simplify[std]{{a[0]}-{b[0]}},\\simplify[std]{{a[1]}-{b[1]}},\\simplify[std]{{a[2]}-{b[2]}}}=\\pmatrix{\\var{diffab[0]},\\var{diffab[1]},\\var{diffab[2]}}$.

\n

 

\n

d)

\n

Dot product: $\\boldsymbol{a\\cdot b}=(\\var{a[0]}\\times\\var{b[0]})+(\\var{a[1]}\\times\\var{b[1]})+(\\var{a[2]}\\times\\var{b[2]})=\\var{dotab}$.

\n

 

\n

e)

\n

Cross product: $\\boldsymbol{a}\\times\\boldsymbol{b}=\\pmatrix{\\simplify[std]{{a[1]*b[2]}-{a[2]*b[1]}},\\simplify[std]{{a[2]*b[0]}-{a[0]*b[2]}},\\simplify[std]{{a[0]*b[1]}-{a[1]*b[0]}}}=\\pmatrix{\\var{crossab[0]},\\var{crossab[1]},\\var{crossab[2]}}$.

", "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}]}], "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}]}