// Numbas version: finer_feedback_settings {"name": "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": [{"functions": {}, "ungrouped_variables": ["a", "c", "b", "d", "g", "f", "s3", "s2", "s1", "s4", "inner", "theta"], "name": "3d - angle between two vectors", "tags": ["dot product", "dot product of two vectors", "inner product", "Rebel", "REBEL", "rebel", "rebelmaths", "scalar product", "three dimensional vectors", "vectors"], "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\\[\\theta=\\cos^{-1}\\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\\[\\theta=\\var{theta}\\]
\nThen round to the nearest degree.
", "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "parts": [{"stepsPenalty": 0, "prompt": "Find $\\boldsymbol{a\\cdot b} =\\;\\;$ [[0]]
", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "gaps": [{"allowFractions": false, "variableReplacements": [], "maxValue": "a*d+b*f+c*g", "minValue": "a*d+b*f+c*g", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "marks": 10, "type": "numberentry", "showPrecisionHint": false}], "steps": [{"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}$,
\nthe 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\\]
", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "information"}], "marks": 0, "scripts": {}, "showCorrectAnswer": true, "type": "gapfill"}, {"stepsPenalty": 0, "precisionType": "dp", "prompt": "Find the angle between $\\mathbf{a}$ and $\\mathbf{b}$ to the nearest degree.
", "marks": 10, "precisionMessage": "You have not given your answer to the correct precision.", "allowFractions": false, "variableReplacements": [], "precision": 0, "maxValue": "arccos((a*d+b*f+c*g)/(sqrt(a^2+b^2+c^2)*sqrt(d^2+f^2+g^2)))/pi*180", "minValue": "arccos((a*d+b*f+c*g)/(sqrt(a^2+b^2+c^2)*sqrt(d^2+f^2+g^2)))/pi*180", "variableReplacementStrategy": "originalfirst", "strictPrecision": false, "correctAnswerFraction": false, "steps": [{"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}$.
\nRearrange to get $\\cos \\theta =\\frac{\\mathbf{a}\\cdot \\mathbf{b}}{|\\mathbf{a}||\\mathbf{b}|}$
", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "information"}], "precisionPartialCredit": 0, "scripts": {}, "showCorrectAnswer": true, "type": "numberentry", "showPrecisionHint": false}], "extensions": [], "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}\\]
answer the following question:
", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "preamble": {"css": "", "js": ""}, "variables": {"a": {"definition": "s1*random(2..9)", "templateType": "anything", "group": "Ungrouped variables", "name": "a", "description": ""}, "c": {"definition": "s3*random(2..9)", "templateType": "anything", "group": "Ungrouped variables", "name": "c", "description": ""}, "b": {"definition": "s2*random(2..9)", "templateType": "anything", "group": "Ungrouped variables", "name": "b", "description": ""}, "d": {"definition": "s4*random(2..9)", "templateType": "anything", "group": "Ungrouped variables", "name": "d", "description": ""}, "g": {"definition": "random(2..9)", "templateType": "anything", "group": "Ungrouped variables", "name": "g", "description": ""}, "f": {"definition": "random(2..9)", "templateType": "anything", "group": "Ungrouped variables", "name": "f", "description": ""}, "s3": {"definition": "random(-1, 1)", "templateType": "anything", "group": "Ungrouped variables", "name": "s3", "description": ""}, "s2": {"definition": "random(-1, 1)", "templateType": "anything", "group": "Ungrouped variables", "name": "s2", "description": ""}, "s1": {"definition": "random(-1, 1)", "templateType": "anything", "group": "Ungrouped variables", "name": "s1", "description": ""}, "s4": {"definition": "random(-1,1)", "templateType": "anything", "group": "Ungrouped variables", "name": "s4", "description": ""}, "inner": {"definition": "a*d+b*f+c*g", "templateType": "anything", "group": "Ungrouped variables", "name": "inner", "description": ""}, "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", "templateType": "anything", "group": "Ungrouped variables", "name": "theta", "description": ""}}, "metadata": {"description": "angle between two vectors
\nrebelmaths
", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}], "contributors": [{"name": "Julie Crowley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/113/"}]}]}], "contributors": [{"name": "Julie Crowley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/113/"}]}