// Numbas version: finer_feedback_settings {"name": "Simon's copy of 3d - angle between two vectors", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"extensions": [], "tags": [], "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

angle between two vectors

\n

rebelmaths

"}, "ungrouped_variables": ["a", "c", "b", "d", "g", "f", "s3", "s2", "s1", "s4", "inner", "theta"], "statement": "

Given the vectors:
\\[\\boldsymbol{a}=\\simplify[std]{{a}v:i+{b}v:j+{c}v:k},\\;\\;\\;\\boldsymbol{b}=\\simplify[std]{{d}v:i+{f}v:j+{g}v:k}\\]

\n

answer the following question:

", "variablesTest": {"condition": "", "maxRuns": 100}, "variable_groups": [], "parts": [{"showCorrectAnswer": true, "prompt": "

Find $\\boldsymbol{a\\cdot b} =\\;\\;$ [[0]]

", "variableReplacementStrategy": "originalfirst", "stepsPenalty": 0, "customMarkingAlgorithm": "", "sortAnswers": false, "type": "gapfill", "scripts": {}, "marks": 0, "unitTests": [], "steps": [{"marks": 0, "showCorrectAnswer": true, "prompt": "

For $\\mathbf{a}=a_1\\mathbf{i}+a_2\\mathbf{j}+a_3\\mathbf{k}$ and   $\\mathbf{b}=b_1\\mathbf{i}+b_2\\mathbf{j}+b_3\\mathbf{k}$,

\n

the scalar or dot product of $\\mathbf{a}$ and $\\mathbf{b}$ is given by

\n

\\[\\mathbf{a} \\cdot \\mathbf{b}= a_1b_1+a_2b_2+a_3b_3\\]

", "unitTests": [], "variableReplacementStrategy": "originalfirst", "customMarkingAlgorithm": "", "type": "information", "extendBaseMarkingAlgorithm": true, "scripts": {}, "variableReplacements": [], "showFeedbackIcon": true}], "gaps": [{"showCorrectAnswer": true, "minValue": "a*d+b*f+c*g", "variableReplacementStrategy": "originalfirst", "customMarkingAlgorithm": "", "mustBeReducedPC": 0, "type": "numberentry", "mustBeReduced": false, "correctAnswerFraction": false, "scripts": {}, "marks": "1", "correctAnswerStyle": "plain", "unitTests": [], "maxValue": "a*d+b*f+c*g", "notationStyles": ["plain", "en", "si-en"], "allowFractions": false, "extendBaseMarkingAlgorithm": true, "variableReplacements": [], "showFeedbackIcon": true}], "extendBaseMarkingAlgorithm": true, "variableReplacements": [], "showFeedbackIcon": true}, {"minValue": "arccos((a*d+b*f+c*g)/(sqrt(a^2+b^2+c^2)*sqrt(d^2+f^2+g^2)))/pi*180", "notationStyles": ["plain", "en", "si-en"], "prompt": "

Find the angle between $\\mathbf{a}$ and $\\mathbf{b}$ to the nearest degree. 

", "precisionPartialCredit": 0, "variableReplacementStrategy": "originalfirst", "mustBeReduced": false, "correctAnswerFraction": false, "marks": "1", "precisionMessage": "You have not given your answer to the correct precision.", "unitTests": [], "scripts": {}, "showFeedbackIcon": true, "showCorrectAnswer": true, "mustBeReducedPC": 0, "customMarkingAlgorithm": "", "stepsPenalty": 0, "type": "numberentry", "strictPrecision": false, "allowFractions": false, "correctAnswerStyle": "plain", "showPrecisionHint": true, "maxValue": "arccos((a*d+b*f+c*g)/(sqrt(a^2+b^2+c^2)*sqrt(d^2+f^2+g^2)))/pi*180", "steps": [{"marks": 0, "showCorrectAnswer": true, "prompt": "

$\\mathbf{a}\\cdot \\mathbf{b}=|\\mathbf{a}||\\mathbf{b}|\\cos\\theta$, where $\\theta$ is the angle between the vector $\\mathbf{a}$ and $\\mathbf{b}$.

\n

Rearrange to get $\\cos \\theta =\\frac{\\mathbf{a}\\cdot \\mathbf{b}}{|\\mathbf{a}||\\mathbf{b}|}$

", "unitTests": [], "variableReplacementStrategy": "originalfirst", "customMarkingAlgorithm": "", "type": "information", "extendBaseMarkingAlgorithm": true, "scripts": {}, "variableReplacements": [], "showFeedbackIcon": true}], "extendBaseMarkingAlgorithm": true, "precision": 0, "precisionType": "dp", "variableReplacements": []}], "name": "Simon's copy of 3d - angle between two vectors", "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "functions": {}, "preamble": {"js": "", "css": ""}, "variables": {"inner": {"definition": "a*d+b*f+c*g", "group": "Ungrouped variables", "templateType": "anything", "description": "", "name": "inner"}, "c": {"definition": "s3*random(2..9)", "group": "Ungrouped variables", "templateType": "anything", "description": "", "name": "c"}, "a": {"definition": "s1*random(2..9)", "group": "Ungrouped variables", "templateType": "anything", "description": "", "name": "a"}, "d": {"definition": "s4*random(2..9)", "group": "Ungrouped variables", "templateType": "anything", "description": "", "name": "d"}, "s2": {"definition": "random(-1, 1)", "group": "Ungrouped variables", "templateType": "anything", "description": "", "name": "s2"}, "b": {"definition": "s2*random(2..9)", "group": "Ungrouped variables", "templateType": "anything", "description": "", "name": "b"}, "s4": {"definition": "random(-1,1)", "group": "Ungrouped variables", "templateType": "anything", "description": "", "name": "s4"}, "f": {"definition": "random(2..9)", "group": "Ungrouped variables", "templateType": "anything", "description": "", "name": "f"}, "s1": {"definition": "random(-1, 1)", "group": "Ungrouped variables", "templateType": "anything", "description": "", "name": "s1"}, "s3": {"definition": "random(-1, 1)", "group": "Ungrouped variables", "templateType": "anything", "description": "", "name": "s3"}, "g": {"definition": "random(2..9)", "group": "Ungrouped variables", "templateType": "anything", "description": "", "name": "g"}, "theta": {"definition": "arccos((a*d+b*f+c*g)/(sqrt(a^2+b^2+c^2)*sqrt(d^2+f^2+g^2)))/pi*180", "group": "Ungrouped variables", "templateType": "anything", "description": "", "name": "theta"}}, "advice": "

(a)

\n

\\[ \\begin{eqnarray*} \\boldsymbol{a\\cdot b}&=& (\\var{a}, \\var{b},\\var{c}) \\cdot (\\var{d}, \\var{f},\\var{g})\\\\ &=&({\\var{a}\\times\\var{d})+(\\var{b}\\times\\var{f})+(\\var{c}\\times\\var{g})}\\\\ &=& \\var{inner} \\end{eqnarray*} \\]

\n

(b)

\n

$\\mathbf{a}\\cdot \\mathbf{b}=|\\mathbf{a}||\\mathbf{b}|\\cos\\theta$, where $\\theta$ is the angle between the vector $\\mathbf{a}$ and $\\mathbf{b}$.

\n

Rearrange gives $\\cos \\theta =\\frac{\\mathbf{a}\\cdot \\mathbf{b}}{|\\mathbf{a}||\\mathbf{b}|}$

\n

\n

So for our question:

\n

\n

\\[\\cos(\\theta)=\\left(\\frac{\\var{inner}}{\\sqrt{(\\var{a})^2+(\\var{b})^2+(\\var{c})^2}\\sqrt{(\\var{d})^2+(\\var{f})^2+(\\var{g})^2}}\\right)\\]

\n

\\[\\cos(\\theta)=\\left(\\frac{\\var{inner}}{\\sqrt{\\var{a^2+b^2+c^2}}\\sqrt{\\var{d^2+f^2+g^2}}}\\right)\\]

\n

\\[\\theta=\\cos^{-1}\\left(\\frac{\\var{inner}}{\\sqrt{\\var{a^2+b^2+c^2}}\\sqrt{\\var{d^2+f^2+g^2}}}\\right)\\]

\n

\\[\\theta=\\var{theta}\\]

\n

which gives $\\var{precround(theta,0)}$ to the nearest degree.

", "type": "question", "contributors": [{"name": "Julie Crowley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/113/"}, {"name": "Simon Thomas", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3148/"}]}]}], "contributors": [{"name": "Julie Crowley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/113/"}, {"name": "Simon Thomas", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3148/"}]}