// Numbas version: finer_feedback_settings {"name": "Harry's copy of Find unit vector parallel to given vector, ", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"type": "question", "variable_groups": [], "variables": {"unitu": {"definition": "vector(precround(u[0]/lenu,3),precround(u[1]/lenu,3),precround(u[2]/lenu,3))", "description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "unitu"}, "u": {"definition": "vector(repeat(random(1..9)*sign(random(1,-1)),3))", "description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "u"}, "lenu": {"definition": "abs(u)", "description": "", "group": "Ungrouped variables", "templateType": "anything", "name": "lenu"}}, "statement": "

Find a unit vector $\\boldsymbol{\\hat{a}}$, which is parallel to $\\boldsymbol{u}=\\pmatrix{\\var{u[0]},\\var{u[1]},\\var{u[2]}}$.

", "showQuestionGroupNames": false, "advice": "

Note that in this advice, the full calculator display is used in the calculation of each step; any rounding is purely for display clarity.

\n

There is only one unit vector parallel to a vector $\\boldsymbol{u}=\\pmatrix{u_1,u_2,u_3}$, namely the unit vector $\\boldsymbol{\\hat{u}}=\\boldsymbol{u}/\\lvert\\boldsymbol{u}\\rvert$, where $\\lvert\\boldsymbol{u}\\rvert=\\sqrt{u_1^2+u_2^2+u_3^2}$.

\n

In this question $\\lvert\\boldsymbol{u}\\rvert=\\sqrt{(\\var{u[0]})^2+(\\var{u[1]})^2+(\\var{u[2]})^2}=\\var{precround(lenu,3)}$, and so $\\boldsymbol{\\hat{a}}=\\boldsymbol{\\hat{u}}=\\frac{1}{\\var{precround(lenu,3)}}\\pmatrix{\\var{u[0]},\\var{u[1]},\\var{u[2]}}=\\pmatrix{\\var{unitu[0]},\\var{unitu[1]},\\var{unitu[2]}}$ to 3d.p.

\n

There is also an anti-parallel unit vector $-\\boldsymbol{\\hat{u}}=\\pmatrix{\\var{-unitu[0]},\\var{-unitu[1]},\\var{-unitu[2]}}$.

", "rulesets": {}, "parts": [{"type": "gapfill", "scripts": {}, "gaps": [{"allowFractions": false, "scripts": {}, "maxValue": "unitu[0]+0.001", "showCorrectAnswer": true, "type": "numberentry", "minValue": "unitu[0]-0.001", "showPrecisionHint": false, "correctAnswerFraction": false, "marks": 1}, {"allowFractions": false, "scripts": {}, "maxValue": "unitu[1]+0.001", "showCorrectAnswer": true, "type": "numberentry", "minValue": "unitu[1]-0.001", "showPrecisionHint": false, "correctAnswerFraction": false, "marks": 1}, {"allowFractions": false, "scripts": {}, "maxValue": "unitu[2]+0.001", "showCorrectAnswer": true, "type": "numberentry", "minValue": "unitu[2]-0.001", "showPrecisionHint": false, "correctAnswerFraction": false, "marks": 1}], "showCorrectAnswer": true, "prompt": "

$\\boldsymbol{\\hat{a}}=($[[0]]$,$[[1]]$,$[[2]]$)$.  (Enter your answers to 3d.p.)

", "marks": 0}], "preamble": {"js": "", "css": ""}, "tags": ["checked2015", "MAS1602", "MAS2104", "vector"], "functions": {}, "metadata": {"notes": "", "description": "

Find the unit vector parallel to a given vector.

", "licence": "Creative Commons Attribution 4.0 International"}, "ungrouped_variables": ["u", "lenu", "unitu"], "variablesTest": {"maxRuns": 100, "condition": ""}, "question_groups": [{"pickingStrategy": "all-ordered", "pickQuestions": 0, "name": "", "questions": []}], "name": "Harry's copy of Find unit vector parallel to given vector, ", "contributors": [{"name": "Harry Flynn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/976/"}]}]}], "contributors": [{"name": "Harry Flynn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/976/"}]}