// Numbas version: finer_feedback_settings {"name": "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": {}, "name": "Angle between two vectors", "tags": ["angle between vectors", "angle beween two vectors", "degrees and radians", "dot product", "finding the angle between vectors", "inner product", "radians", "scalar product", "vectors"], "type": "question", "advice": "
Bruker formelen:
\n$\\boldsymbol{A \\cdot B} = |\\boldsymbol{A}||\\boldsymbol{B}|\\cos(\\theta)$ der $\\theta$ er vinkelen mellom vektorene.
\nHer er $|\\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})}$
\nog
\n$\\boldsymbol{A \\cdot B} = (\\var{fa},\\var{sa}, \\var{ta}) \\cdot (\\var{fb},\\var{sb}, \\var{tb}) = \\var{g}$.
\nSlik at \\[\\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*} \\]
Konvertering fra grader til radianer gjøres ved å multiplisere vinkel i grader med $\\displaystyle \\frac{\\pi}{180}$.
Da blir $\\displaystyle \\var{angle}\\,^{\\circ}=\\simplify[std]{({angle}*pi)/{180}= {precround(angle*pi/180,4)}}$ radianer i 4 siffers nøyaktighet.
", "rulesets": {"std": ["all", "fractionNumbers", "!collectNumbers", "!noLeadingMinus"]}, "parts": [{"prompt": "Angle in degrees = [[0]]$^{\\circ}$
\nAngle in radians = [[1]]radians.
\nNote that you can input the radians as a decimal to 4 decimal places or as a mulptiple of $\\pi$. You input $\\pi$ as pi.
", "gaps": [{"minvalue": "{angle}", "type": "numberentry", "maxvalue": "{angle}", "marks": 1.0, "showPrecisionHint": false}, {"expectedvariablenames": [], "checkingaccuracy": 0.0001, "vsetrange": [0.0, 1.0], "showpreview": true, "vsetrangepoints": 5.0, "checkingtype": "absdiff", "marks": 1.0, "answer": "{precround(angle*pi/180,4)}", "checkvariablenames": false, "type": "jme"}], "type": "gapfill", "marks": 0.0}], "extensions": [], "statement": "Given the vectors
$\\mathbf{A}=\\var{fa}\\mathbf{i}+\\var{sa}\\mathbf{j}+\\var{ta}\\mathbf{k},\\;\\;\\;\\boldsymbol{B}=\\var{fb}\\mathbf{i}+\\var{sb}\\mathbf{j}+ \\var{tb}\\mathbf{k}$
Find the angle between these vectors in degrees and radians.
\nNote that the angle must be between $0\\,^{\\circ}$ and $180\\,^{\\circ}$ (between $0$ and $\\pi$ radians)
", "variable_groups": [], "progress": "ready", "preamble": {"css": "", "js": ""}, "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": "\n \t\t15/07/2012:
\n \t\tAdded tags.
\n \t\t16/07/2012:
Added tags.
\n \t\tQuestion appears to be working correctly.
Moved the \\rightarrow to the correct place in the solution.
\n \t\t
\n \t\t", "description": "
Gitt vektorene $\\boldsymbol{A,\\;B}$, finn vinkelen mellom dem.
", "licence": "Creative Commons Attribution 4.0 International"}, "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/"}]}