// Numbas version: exam_results_page_options {"name": "SOHCAHTOA applied problem", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [["question-resources/Picture1_caMIdF1.png", "/srv/numbas/media/question-resources/Picture1_caMIdF1.png"], ["question-resources/Picture2_6KE4ZpW.png", "/srv/numbas/media/question-resources/Picture2_6KE4ZpW.png"]], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "SOHCAHTOA applied problem", "tags": [], "metadata": {"description": "

Draws a triangle based on 3 side lengths.
NOT ACCESSIBLE

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "

The figure below shows the position of four towns marked on a map.

\n

{plotgraph(1,2,3,WXY,XYW,XWY,theta)}

", "advice": "

Avoid using rounded values in calculations and just round for the final answer.

\n

\n

a) You have the hypothenuse and the angle, and need to find the opposite side.

\n

    This is SOH and therefore a sin question.
    Cover the unknown (O) with your finger to see the rule.

\n

    \\[opp = sin(\\theta) \\times H\\]
    \\[opp = sin(\\var{precround(XYW,0)}) \\times \\var{WX}\\]    

\n

\n

b) Because you found WY in part a), you now have the hypothenuse and the adjacent side in the bottom triangle

\n

    Use CAH, the cos formula, but this time we are trying to find the angle, so cover 'cos' with your finger to find the rule.

\n

    \\[cos(\\theta) = \\frac{adj}{H}\\]
    \\[cos(\\theta) = \\frac{\\var{WZ}}{\\var{precround(WY,1)}}\\]  

\n

c) Pythagoras or trigonometry will work here because you have several sides and angles to work with.

\n

\n

", "rulesets": {}, "extensions": ["jsxgraph"], "variables": {"WZmin": {"name": "WZmin", "group": "Ungrouped variables", "definition": "floor(fixed_WY/2)", "description": "", "templateType": "anything"}, "YZ": {"name": "YZ", "group": "Ungrouped variables", "definition": "sqrt(WY^2-WZ^2)", "description": "", "templateType": "anything"}, "theta": {"name": "theta", "group": "Ungrouped variables", "definition": "degrees(arccos(WZ/WY))", "description": "", "templateType": "anything"}, "XYW": {"name": "XYW", "group": "Ungrouped variables", "definition": "random(30..60)", "description": "", "templateType": "anything"}, "XY": {"name": "XY", "group": "Ungrouped variables", "definition": "WX/(tan(radians(XYW)))", "description": "", "templateType": "anything"}, "WY": {"name": "WY", "group": "Ungrouped variables", "definition": "fixed_WY", "description": "", "templateType": "anything"}, "WZ": {"name": "WZ", "group": "Ungrouped variables", "definition": "random(WZmin..WZmax)", "description": "", "templateType": "anything"}, "WXY": {"name": "WXY", "group": "Ungrouped variables", "definition": "90\n", "description": "", "templateType": "anything"}, "WX": {"name": "WX", "group": "Ungrouped variables", "definition": "random(5..50)", "description": "", "templateType": "anything"}, "fixed_WY": {"name": "fixed_WY", "group": "Ungrouped variables", "definition": "sqrt(WX^2+XY^2)", "description": "", "templateType": "anything"}, "WZmax": {"name": "WZmax", "group": "Ungrouped variables", "definition": "ceil(fixed_WY*sqrt(0.75))", "description": "", "templateType": "anything"}, "XWY": {"name": "XWY", "group": "Ungrouped variables", "definition": "180-(WXY + XYW)", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "WX-XY<>0 &&\nWY-XY>0", "maxRuns": "200"}, "ungrouped_variables": ["WXY", "XYW", "XWY", "WX", "XY", "fixed_WY", "WY", "WZmin", "WZmax", "WZ", "YZ", "theta"], "variable_groups": [{"name": "Unnamed group", "variables": []}], "functions": {"plotgraph": {"parameters": [["WY", "number"], ["WX", "number"], ["XY", "number"], ["WZ", "number"], ["WXY", "number"], ["XYW", "number"], ["XWY", "number"], ["theta", "number"]], "type": "html", "language": "javascript", "definition": "// This functions plots a triangle based on three lengths\n\n//Function to convert angles to radians\nfunction toRadians (angle) {\n return angle * (Math.PI / 180);\n}\n\n//Calculate height of triangle\nvar hX = WX*Math.sin(toRadians(XWY))\nvar hZ = WZ*math.sin(toRadians(theta))\nvar h = Math.max(hX, hZ);\n\n//Set text and graph offsets to appear uniform\nvar xOffset = Math.ceil(WY/10)\nvar yOffset = Math.ceil(WY/2+xOffset-(hX+hZ)/2)\n//Consider removing scale once all adjusted correctly\nvar offset = 1;\nvar textHeight =15;\nvar scale = xOffset/2;\nvar scaleOffset = offset*scale;\nvar scaleText = textHeight*scale;\n// This functions plots two dimensioned lines \n// Max and min x and y values for the axis.\nvar x_min = 0;\nvar x_max = WY+2*xOffset;\nvar y_max = x_max/2;\nvar y_min = -y_max;\n\n//Browser compatibility\nJXG.Options.text.display = 'internal';\n//Use MathJax for LaTeX display\nJXG.Options.text.useMathJax = true;\n\n// Make the JSXGraph board.\nvar div = Numbas.extensions.jsxgraph.makeBoard(\n '500px',\n '500px',\n {\n boundingBox: [0,y_max,x_max,y_min],\n//Change to false after testing\n axis: false,\n }\n);\n\n// div.board is the object created by JSXGraph, which you use to manipulate elements\nvar board = div.board;\n\n//Draw three points \nvar pX = board.create('point', [(WX*Math.cos(toRadians(XWY))+xOffset), (WX*Math.sin(toRadians(XWY)))], \n {size:0, fixed:true, name:'X',\n label:{offset: [-5,10]}});\nvar pY = board.create('point', [(WY+xOffset), (0)],\n {size:0, fixed:true, name:'Y',\n label:{offset: [20,0]}});\nvar pW = board.create('point', [(xOffset), (0)],\n {size:0, fixed:true, name:'W',\n label:{offset: [-20,0]}});\nvar pZ = board.create('point', [(WZ*Math.cos(toRadians(theta))+xOffset), (-WZ*Math.sin(toRadians(theta)))],\n {size:0, fixed:true, name:'Z',\n label:{offset: [-5,-20]}});\n\n//Dummy text for testing variables, remove after testing\n//tempText = board.create('text',[(xOffset),(hX+yOffset),\n//function () {return 'hX is ' + hX.toFixed(2) + ' hZ is ' + hZ.toFixed(2) + ' h is ' + h.toFixed(2) + ' x_max is ' + x_max.toFixed(2) + ' y_max is ' + y_max.toFixed(2)}]);\n//tempText = board.create('text',[(xOffset),(hX+yOffset/2),\n//function () {return 'Theta is ' + theta.toFixed(2)}]);\n//tempText2 = board.create('text',[(xOffset),(-hZ-yOffset/2),\n//function () {return 'WY is ' + WY.toFixed(2) + ' ZY is ' + +pY.Dist(pZ).toFixed(2)}]);\n\n//Draw a line between them\nvar lXY = board.create('line',[pX,pY],{fixed:false, straightFirst:false, straightLast:false, strokeWidth: 1});\nvar lWY = board.create('line',[pW,pY],{fixed:false, straightFirst:false, straightLast:false, strokeWidth: 1});\nvar lWX = board.create('line',[pW,pX],{fixed:false, straightFirst:false, straightLast:false, strokeWidth: 1});\nvar lWZ = board.create('line',[pW,pZ],{fixed:false, straightFirst:false, straightLast:false, strokeWidth: 1});\nvar lZY = board.create('line',[pZ,pY],{fixed:false, straightFirst:false, straightLast:false, strokeWidth: 1});\n\n//Draw angles\nvar angleXYW = board.create('nonreflexangle', [pX,pY,pW], {type:'sector', orthoType:'square', orthoSensitivity:0.4, \nradius:function() { return scale;}\n });\nvar angleWXY = board.create('nonreflexangle', [pW,pX,pY], {type:'sector', orthoType:'square', orthoSensitivity:0.4,\nradius:function() { return scale;} \n});\n/*\nvar angleXWY = board.create('nonreflexangle', [pY,pW,pX], {type:'sector', orthoType:'square', orthoSensitivity:0.4,\nradius:function() { return scale;} \n});\n*/\nvar angleYWZ = board.create('nonreflexangle', [pY,pW,pZ], {type:'sector', orthoType:'square', orthoSensitivity:0.4,\nradius:function() { return scale;} \n});\n\nvar angleWZY = board.create('nonreflexangle', [pW,pZ,pY], {type:'sector', orthoType:'square', orthoSensitivity:0.4,\nradius:function() { return scale;} \n});\n\n\n//Blank out label for this version\nangleXYW.label.setText('');\nangleWXY.label.setText('');\n//angleXWY.label.setText('');\nangleYWZ.label.setText('\\u03B8');\nangleWZY.label.setText('');\n\nvar XYWLabel = angleXYW.label.setText(function () {\n var angle = 180.0 * angleXYW.Value() / Math.PI;\n if ((angle > 90.4) || (angle < 89.6)) {\n return ''+angle.toFixed(0) + '\\u00B0';\n } else {\n return '';\n }\n});\nXYWLabel.setAttribute({anchorX:'middle'});\n\n/* Angle labels used for testing\nvar WXYLabel = angleWXY.label.setText(function () {\n var angle = 180.0 * angleWXY.Value() / Math.PI;\n if ((angle > 90.4) || (angle < 89.6)) {\n return ''+angle.toFixed(2) + '\\u00B0';\n } else {\n return '';\n }\n});\nWXYLabel.setAttribute({anchorX:'middle'});\n\nvar XWYLabel = angleXWY.label.setText(function () {\n var angle = 180.0 * angleXWY.Value() / Math.PI;\n if ((angle > 90.4) || (angle < 89.6)) {\n return ''+angle.toFixed(2) + '\\u00B0';\n } else {\n return '';\n }\n});\nXWYLabel.setAttribute({anchorX:'middle'});\n*/\n\n//Set up dimension labels to be properly aligned\n/*\ntextXY = board.create('text', \n [function () {return (pX.X() + pY.X())/2},\n function () {return ((pX.Y() + pY.Y())/2)+(scaleOffset/2)},\n function () {return +pX.Dist(pY).toFixed(2) + 'km'}],\n {fontSize:15, anchorX:'middle'});\n*/\n\ntextWY = board.create('text', \n [function () {return (pY.X() + pW.X())/2},\n function () {return ((pY.Y() + pW.Y())/2)-scaleOffset/2},\n function () {return '? km'}],\n {fontSize:15, anchorX:'middle'});\n\ntextWX = board.create('text', \n [function () {return (pX.X() + pW.X())/2},\n function () {return ((pX.Y() + pW.Y())/2)+(scaleOffset/2)},\n function () {return +pX.Dist(pW).toFixed(2) + 'km'}],\n {fontSize:15, anchorX:'middle'});\n\ntextWZ = board.create('text', \n [function () {return (pW.X() + pZ.X())/2},\n function () {return ((pZ.Y())/2)+(scaleOffset/2)},\n function () {return +pW.Dist(pZ).toFixed(2) + 'km'}],\n {fontSize:15, anchorX:'middle'});\n\ntextZY = board.create('text', \n [function () {return (pY.X() + pZ.X())/2},\n function () {return ((pZ.Y())/2)+(scaleOffset/2)},\n function () {return '? km'}],\n {fontSize:15, anchorX:'middle'});\n\n//Set up transform for rotating dimension labels\n/*\nvar tXYRot = board.create('transform', \n [function () {return lXY.getAngle()}, \n function () {return (pX.X() + pY.X())/2}, \n function () {return (pX.Y() + pY.Y())/2}],\n {type:'rotate'});\n*/\n\nvar tWYRot = board.create('transform', \n [function () {return lWY.getAngle()}, \n function () {return (pY.X() + pW.X())/2}, \n function () {return (pY.Y() + pW.Y())/2}],\n {type:'rotate'});\n\nvar tWXRot = board.create('transform', \n [function () {return lWX.getAngle()}, \n function () {return (pX.X() + pW.X())/2}, \n function () {return (pX.Y() + pW.Y())/2}],\n {type:'rotate'});\n\nvar tWZRot = board.create('transform', \n [function () {return lWZ.getAngle()}, \n function () {return (pW.X() + pZ.X())/2}, \n function () {return (pZ.Y())/2}],\n {type:'rotate'});\n\nvar tZYRot = board.create('transform', \n [function () {return lZY.getAngle()}, \n function () {return (pY.X() + pZ.X())/2}, \n function () {return (pZ.Y())/2}],\n {type:'rotate'});\n\n//Perform text rotations and update\n//tXYRot.bindTo(textXY);\ntWYRot.bindTo(textWY); \ntWXRot.bindTo(textWX);\ntWZRot.bindTo(textWZ);\ntZYRot.bindTo(textZY);\nboard.update();\n\nreturn div;"}}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Calculate, to the nearest kilometre, the distance between towns W and Y

\n

WY =  [[0]]  km

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "WY-1", "maxValue": "WY+1", "correctAnswerFraction": false, "allowFractions": true, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Calculate, to the nearest degree, the size of the angle marked $\\theta$.

\n

$\\theta$ = [[0]] $^\\circ$

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [{"variable": "WY", "part": "p0", "must_go_first": true}], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "{theta}", "maxValue": "{theta}", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "precisionType": "dp", "precision": 0, "precisionPartialCredit": "50", "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": false, "showPrecisionHint": false, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Calculate to the nearest kilometre, the distance between towns Y and Z.

\n

YZ = [[0]] km

", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [{"variable": "WY", "part": "p0g0", "must_go_first": true}], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "{YZ}", "maxValue": "{YZ}", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "precisionType": "dp", "precision": 0, "precisionPartialCredit": "50", "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": false, "showPrecisionHint": false, "notationStyles": ["en", "si-en"], "correctAnswerStyle": "en"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "David Wishart", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1461/"}, {"name": "Ruth Hand", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3228/"}]}]}], "contributors": [{"name": "David Wishart", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1461/"}, {"name": "Ruth Hand", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3228/"}]}