// Numbas version: finer_feedback_settings {"name": "Vectors: angle between vectors 1", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"functions": {}, "name": "Vectors: angle between vectors 1", "tags": ["angle between vectors", "angle beween two vectors", "degrees and radians", "dot product", "finding the angle between vectors", "inner product", "radians", "scalar product", "vectors"], "advice": "\n
Use the formula:
\n$\\boldsymbol{A \\cdot B} = |\\boldsymbol{A}||\\boldsymbol{B}|\\cos(\\theta)$ where $\\theta$ is the angle between the vectors.
\nHere $|\\boldsymbol{A}| = \\sqrt{ (\\var{s1})^2+(\\var{s2})^2} = \\simplify[all]{sqrt({s1^2+s2^2})},\\;\\;\\;|\\boldsymbol{B}| = \\sqrt{ (\\var{s3})^2+(\\var{s4})^2} = \\simplify[all]{sqrt({s3^2+s4^2})}$
\nand
\n$\\boldsymbol{A \\cdot B} = (\\var{fa},\\var{sa}, \\var{ta}) \\cdot (\\var{fb},\\var{sb}, \\var{tb}) = \\var{g}$.
\nSo \\[\\begin{eqnarray*} \\cos(\\theta)&=&\\frac{\\var{g}}{\\sqrt{2}\\sqrt{2}} = \\simplify[std]{{g}/{2}}\\\\ \\Rightarrow \\theta &=&\\arccos\\left(\\simplify[std]{{g}/{2}}\\right)\\\\ &=&\\var{angle}\\,^{\\circ} \\end{eqnarray*} \\]
Converting from degrees to radians is simply a matter of multiplying the angle in degrees by $\\displaystyle \\frac{\\pi}{180}$.
Hence $\\displaystyle \\var{angle}\\,^{\\circ}=\\simplify[std]{({angle}*pi)/{180}= {precround(angle*pi/180,4)}}$ radians to 4 decimal places.
\n ", "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "parts": [{"prompt": "\n \n \nAngle in degrees = [[0]]$^{\\circ}$
\n \n \n \nAngle in radians = [[1]]radians.
\n \n \n \nNote that you can input the radians as a decimal to 4 decimal places or as a multiple of $\\pi$. You input $\\pi$ using pi.
\n \n \n ", "gaps": [{"minvalue": "{angle}", "type": "numberentry", "maxvalue": "{angle}", "marks": 1.0, "showPrecisionHint": false}, {"checkingaccuracy": 0.0001, "vsetrange": [0.0, 1.0], "vsetrangepoints": 5.0, "checkingtype": "absdiff", "marks": 1.0, "answer": "{precround(angle*pi/180,4)}", "type": "jme"}], "type": "gapfill", "marks": 0.0}], "extensions": [], "statement": "\nGiven the vectors:
\\[\\boldsymbol{A}=\\simplify[std]{{s1}v:e_{a}+{s2}v:e_{b}},\\;\\;\\;\\boldsymbol{B}=\\simplify[std]{{s3}v:e_{c}+{s4}v:e_{d}}\\]
Find the angle in degrees and radians between them.
\nNote the angle must be between $0\\,^{\\circ}$ and $180\\,^{\\circ}$ (between $0$ and $\\pi$ radians)
\n ", "variable_groups": [], "progress": "ready", "type": "question", "variables": {"a": {"definition": "if(t=1,2,1)", "name": "a"}, "c": {"definition": "if(u=1,2,1)", "name": "c"}, "b": {"definition": "if(t=3,2,3)", "name": "b"}, "angle": {"definition": "precround(180/pi*arccos(g/2),1)", "name": "angle"}, "d": {"definition": "if(u=3,2,3)", "name": "d"}, "g": {"definition": "{fa*fb+sa*sb+ta*tb}", "name": "g"}, "s3": {"definition": "random(1,-1)", "name": "s3"}, "s2": {"definition": "random(1,-1)", "name": "s2"}, "s1": {"definition": "random(1,-1)", "name": "s1"}, "s4": {"definition": "if(s1=s3 ,-s2,random(-1,1))", "name": "s4"}, "fa": {"definition": "if(t=1,0,s1)", "name": "fa"}, "fb": {"definition": "if(u=1,0,s3)", "name": "fb"}, "u": {"definition": "random(1,2,3)", "name": "u"}, "t": {"definition": "random(1,2,3)", "name": "t"}, "sb": {"definition": "if(u=2,0,if(u=1,s3,s4))", "name": "sb"}, "sa": {"definition": "if(t=2,0,if(t=1,s1,s2))", "name": "sa"}, "tb": {"definition": "if(u=3,0,s4)", "name": "tb"}, "ta": {"definition": "if(t=3,0,s2)", "name": "ta"}}, "metadata": {"notes": "15/07/2012:
\nAdded tags.
\n16/07/2012:
Added tags.
\nQuestion appears to be working correctly.
Moved the \\rightarrow to the correct place in the solution.
\n
", "description": "
Given vectors $\\boldsymbol{A,\\;B}$, find the angle between them.
", "licence": "Creative Commons Attribution 4.0 International"}, "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}], "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}]}]}], "contributors": [{"name": "Bill Foster", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/6/"}]}