// Numbas version: finer_feedback_settings {"name": "Geometry Recap Exercises", "metadata": {"description": "", "licence": "None specified"}, "duration": 0, "percentPass": "40", "showQuestionGroupNames": false, "showstudentname": true, "question_groups": [{"name": "Group", "pickingStrategy": "all-ordered", "pickQuestions": 1, "questionNames": ["", "", "", "", "", "", "", "", ""], "questions": [{"name": "Trigonometry Q1", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "David Wishart", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1461/"}], "tags": [], "metadata": {"description": "
Draws a triangle based on 3 side lengths.
", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "The figure below shows the position of four towns marked on a map.
\n{plotgraph(WY,WX,XY,WZ,WXY,XYW,XWY,theta)}
", "advice": "Avoid using rounded values in calculations and just round for the final answer.
", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"WZmin": {"name": "WZmin", "group": "Ungrouped variables", "definition": "floor(fixed_WY/2)", "description": "", "templateType": "anything", "can_override": false}, "fixed_WY": {"name": "fixed_WY", "group": "Ungrouped variables", "definition": "sqrt(WX^2+XY^2)", "description": "", "templateType": "anything", "can_override": false}, "XYW": {"name": "XYW", "group": "Ungrouped variables", "definition": "random(30..60)", "description": "", "templateType": "anything", "can_override": false}, "XY": {"name": "XY", "group": "Ungrouped variables", "definition": "WX/(tan(radians(XYW)))", "description": "", "templateType": "anything", "can_override": false}, "WZmax": {"name": "WZmax", "group": "Ungrouped variables", "definition": "ceil(fixed_WY*sqrt(0.75))", "description": "", "templateType": "anything", "can_override": false}, "WXY": {"name": "WXY", "group": "Ungrouped variables", "definition": "90\n", "description": "", "templateType": "anything", "can_override": false}, "WY": {"name": "WY", "group": "Ungrouped variables", "definition": "fixed_WY", "description": "", "templateType": "anything", "can_override": false}, "YZ": {"name": "YZ", "group": "Ungrouped variables", "definition": "sqrt(WY^2-WZ^2)", "description": "", "templateType": "anything", "can_override": false}, "WZ": {"name": "WZ", "group": "Ungrouped variables", "definition": "random(WZmin..WZmax)", "description": "", "templateType": "anything", "can_override": false}, "theta": {"name": "theta", "group": "Ungrouped variables", "definition": "degrees(arccos(WZ/WY))", "description": "", "templateType": "anything", "can_override": false}, "WX": {"name": "WX", "group": "Ungrouped variables", "definition": "random(5..50)", "description": "", "templateType": "anything", "can_override": false}, "XWY": {"name": "XWY", "group": "Ungrouped variables", "definition": "180-(WXY + XYW)", "description": "", "templateType": "anything", "can_override": false}}, "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
\nWY = [[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}", "maxValue": "{WY}", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "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 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": "p0g0", "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, "displayAnswer": "", "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.
\nYZ = [[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, "displayAnswer": "", "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", "type": "question"}, {"name": "Trigonometry Q2 Right angled triangle", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "David Wishart", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1461/"}], "tags": [], "metadata": {"description": "Draws a right angled triangle based on 2 lengths.
", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "Referring to the triangle below.
", "advice": "Use pythagoras theorem to find the answer.
", "rulesets": {}, "variables": {"min_angle": {"name": "min_angle", "group": "Ungrouped variables", "definition": "29\n\n", "description": "", "templateType": "anything"}, "c": {"name": "c", "group": "Ungrouped variables", "definition": "precround(sqrt(b^2-a^2),2)", "description": "", "templateType": "anything"}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "random(b_min..b_max)", "description": "", "templateType": "anything"}, "max_angle": {"name": "max_angle", "group": "Ungrouped variables", "definition": "61", "description": "", "templateType": "anything"}, "b_min": {"name": "b_min", "group": "Ungrouped variables", "definition": "floor(a/(cos(radians(min_angle))))", "description": "", "templateType": "anything"}, "b_max": {"name": "b_max", "group": "Ungrouped variables", "definition": "ceil(a/(cos(radians(max_angle))))", "description": "", "templateType": "anything"}, "a": {"name": "a", "group": "Ungrouped variables", "definition": "random(7..50)", "description": "", "templateType": "anything"}, "units": {"name": "units", "group": "Ungrouped variables", "definition": "random(unitList)", "description": "", "templateType": "anything"}, "unitList": {"name": "unitList", "group": "Ungrouped variables", "definition": "[ safe(\"mm\"), safe(\"cm\"), safe(\"m\"), safe(\"km\") ]", "description": "Units that are to be used for the question.
", "templateType": "list of strings"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["unitList", "units", "a", "min_angle", "max_angle", "b_max", "b_min", "b", "c"], "variable_groups": [{"name": "Unnamed group", "variables": []}], "functions": {"plotgraph": {"parameters": [["units", "string"], ["a", "number"], ["b", "number"], ["c", "number"]], "type": "html", "language": "javascript", "definition": "// This functions plots a right angled triangle based on two lengths\n\n//Set text and graph offsets to appear uniform\nvar yOffset = Math.ceil(a/10);\nvar xOffset = Math.ceil(a+2*yOffset-c/2)\n//Consider removing scale once all adjusted correctly\nvar offset = 1;\nvar textHeight =15;\nvar scale = yOffset/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 = 2*(a+2*yOffset);\nvar y_min = 0;\nvar y_max = a+2*yOffset;\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 '800px',\n '400px',\n {\n boundingBox: [0,y_max,x_max,0],\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 \n// manipulate elements\nvar board = div.board; \n\n//Draw three points \nvar A = board.create('point', [xOffset, yOffset], \n {size:0, fixed:true,\n label:{offset: [-10,-10]}});\nvar B = board.create('point', [xOffset, (a+yOffset)],\n {size:0, fixed:true,\n label:{offset: [0,10]}});\nvar C = board.create('point', [(c+xOffset), yOffset],\n {size:0, fixed:true,\n label:{offset: [10,0]}});\n\n//Draw a line between them\nvar AB = board.create('line',[A,B],{fixed:false, straightFirst:false, straightLast:false, strokeWidth: 1});\nvar BC = board.create('line',[B,C],{fixed:false, straightFirst:false, straightLast:false, strokeWidth: 1});\nvar AC = board.create('line',[A,C],{fixed:false, straightFirst:false, straightLast:false, strokeWidth: 1});\n\nvar CAB = board.create('nonreflexangle', [C,A,B], {type:'sector', orthoType:'square', orthoSensitivity:0.4, \nradius:function() { return scale;} \n});\nvar CABLabel = CAB.label.setText(function () {\n var angle = 180.0 * CAB.Value() / Math.PI;\n if ((angle > 90.4) || (angle < 89.6)) {\n return ''+angle.toFixed(1) + '\\u00B0';\n } else {\n return '';\n }\n});\nCABLabel.setAttribute({anchorX:'middle'});\n\n/*Dummy text for testing variables, remove after testing\ntempText = board.create('text',[(2*a),(a+yOffset),\n// function () {return 'ABC = ' +(180.0*ABC.Value()/Math.PI).toFixed(2)+ ' degreeSymbol'}]);\nfunction () {return 'yOffset is ' + yOffset}]);\n*/\n\n//Set up dimension labels to be properly aligned\ntextAB = board.create('text', \n [function () {return (A.X() + B.X())/2},\n function () {return ((A.Y() + B.Y())/2)+(scaleOffset/2)},\n function () {return +A.Dist(B).toFixed(1) + ' ' + units}],\n {fontSize:15, anchorX:'middle'});\n\ntextBC = board.create('text', \n [function () {return (B.X() + C.X())/2},\n function () {return ((B.Y() + C.Y())/2)+(scaleOffset/2)},\n function () {return +B.Dist(C).toFixed(1) + ' ' + units}],\n {fontSize:15, anchorX:'middle'});\n\n/*\n//Hide this for final version\ntextAC = board.create('text', \n [function () {return (A.X() + C.X())/2},\n function () {return ((A.Y() + C.Y())/2)-scaleOffset},\n function () {return +A.Dist(C).toFixed(1) + ' ' + units}],\n {fontSize:15, anchorX:'middle'});\n*/\n\nvar tABRot = board.create('transform', \n [function () {return AB.getAngle()}, \n function () {return (A.X() + B.X())/2}, \n function () {return (A.Y() + B.Y())/2}],\n {type:'rotate'});\n\nvar tBCRot = board.create('transform', \n [function () {return BC.getAngle()}, \n function () {return (B.X() + C.X())/2}, \n function () {return (B.Y() + C.Y())/2}],\n {type:'rotate'});\n\n//Perform text rotations and update\ntABRot.bindTo(textAB);\ntBCRot.bindTo(textBC); \nboard.update();\n\nreturn div;"}}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": "{plotgraph(units,a,b,c)}
\nWhat is the length of side AC?
\nPlease give answer to 2 decimal places
\nAC = [[0]] {units}
", "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": "2", "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "minValue": "{c}", "maxValue": "{c}", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "precisionType": "dp", "precision": "2", "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": "question"}, {"name": "Trigonometry Q3 Right angled triangle", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "David Wishart", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1461/"}], "variables": {"units": {"templateType": "anything", "definition": "random(unitList)", "description": "", "group": "Ungrouped variables", "name": "units"}, "unitList": {"templateType": "list of strings", "definition": "[ \"mm\", \"cm\", \"m\", \"km\" ]", "description": "Units that are to be used for the question.
", "group": "Ungrouped variables", "name": "unitList"}, "c": {"templateType": "anything", "definition": "precround(a*tan(radians(angleB)),5)", "description": "", "group": "Ungrouped variables", "name": "c"}, "b": {"templateType": "anything", "definition": "precround(sqrt(a^2+c^2),2)", "description": "", "group": "Ungrouped variables", "name": "b"}, "angleC": {"templateType": "anything", "definition": "90-angleB", "description": "", "group": "Ungrouped variables", "name": "angleC"}, "angleB": {"templateType": "anything", "definition": "random(30..60)", "description": "angle
", "group": "Ungrouped variables", "name": "angleB"}, "a": {"templateType": "anything", "definition": "random(5..50)", "description": "", "group": "Ungrouped variables", "name": "a"}}, "statement": "Referring to the triangle below.
", "parts": [{"prompt": "{plotgraph(units,a,b,c,angleB,angleC)}
\nWhat is the length of sides AC and BC?
\nPlease give answer to 2 decimal places
\nAC = [[0]] {units}
\nBC = [[1]] {units}
\nWhat is angle C?
\nPlease give answer to nearest whole degree
\nC = [[2]] $^{\\circ}$
", "marks": 0, "gaps": [{"precisionType": "dp", "notationStyles": ["plain", "en", "si-en"], "minValue": "{c}", "showCorrectAnswer": true, "type": "numberentry", "precisionMessage": "You have not given your answer to the correct precision.", "mustBeReducedPC": 0, "precisionPartialCredit": "50", "maxValue": "{c}", "correctAnswerFraction": false, "precision": "2", "mustBeReduced": false, "strictPrecision": false, "marks": "2", "showPrecisionHint": false, "variableReplacementStrategy": "originalfirst", "correctAnswerStyle": "plain", "variableReplacements": [], "showFeedbackIcon": true, "scripts": {}, "allowFractions": false}, {"precisionType": "dp", "notationStyles": ["plain", "en", "si-en"], "minValue": "{b}", "showCorrectAnswer": true, "type": "numberentry", "precisionMessage": "You have not given your answer to the correct precision.", "mustBeReducedPC": 0, "precisionPartialCredit": "50", "maxValue": "{b}", "correctAnswerFraction": false, "precision": "2", "mustBeReduced": false, "strictPrecision": false, "marks": "2", "showPrecisionHint": false, "variableReplacementStrategy": "originalfirst", "correctAnswerStyle": "plain", "variableReplacements": [], "showFeedbackIcon": true, "scripts": {}, "allowFractions": false}, {"precisionType": "dp", "notationStyles": ["plain", "en", "si-en"], "minValue": "{angleC}", "showCorrectAnswer": true, "type": "numberentry", "precisionMessage": "You have not given your answer to the correct precision.", "mustBeReducedPC": 0, "precisionPartialCredit": 0, "maxValue": "{angleC}", "correctAnswerFraction": false, "precision": "0", "mustBeReduced": false, "strictPrecision": false, "marks": 1, "showPrecisionHint": false, "variableReplacementStrategy": "originalfirst", "correctAnswerStyle": "plain", "variableReplacements": [], "showFeedbackIcon": true, "scripts": {}, "allowFractions": false}], "variableReplacementStrategy": "originalfirst", "type": "gapfill", "variableReplacements": [], "showFeedbackIcon": true, "scripts": {}, "showCorrectAnswer": true}], "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "Draws a right angled triangle based on a length and an angle.
"}, "variablesTest": {"maxRuns": 100, "condition": ""}, "tags": [], "functions": {"plotgraph": {"type": "html", "parameters": [["units", "string"], ["a", "number"], ["b", "number"], ["c", "number"], ["angleB", "number"], ["angleC", "number"]], "definition": "// This functions plots a right angled triangle based on a length and an angle\n\n//Set text and graph offsets to appear uniform\nvar yOffset = Math.ceil(a/10);\nvar xOffset = Math.ceil(a+2*yOffset-c/2)\n//Consider removing scale once all adjusted correctly\nvar offset = 1;\nvar textHeight =15;\nvar scale = yOffset/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 = 2*(a+2*yOffset);\nvar y_min = 0;\nvar y_max = a+2*yOffset;\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 '800px',\n '400px',\n {\n boundingBox: [0,y_max,x_max,0],\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 \n// manipulate elements\nvar board = div.board; \n\n//Draw three points \nvar A = board.create('point', [(c+xOffset), (a+yOffset)], \n {size:0, fixed:true,\n label:{offset: [10,10]}});\nvar B = board.create('point', [(c+xOffset), (yOffset)],\n {size:0, fixed:true,\n label:{offset: [10,-10]}});\nvar C = board.create('point', [(xOffset), (a+yOffset)],\n//Make fixed:true after testing\n {size:0, fixed:false,\n label:{offset: [-15,0]}});\n\n//Draw a line between them\nvar AB = board.create('line',[A,B],{fixed:false, straightFirst:false, straightLast:false, strokeWidth: 1});\nvar BC = board.create('line',[C,B],{fixed:false, straightFirst:false, straightLast:false, strokeWidth: 1});\nvar AC = board.create('line',[C,A],{fixed:false, straightFirst:false, straightLast:false, strokeWidth: 1});\n\n//Draw angle and label\n\n//Used in other versions of this questions\nvar ABC = board.create('nonreflexangle', [A,B,C], {type:'sector', orthoType:'square', orthoSensitivity:0.4, \nradius:function() { return scale;}\n });\nvar ABCLabel = ABC.label.setText(function () {\n var angle = 180.0 * ABC.Value() / Math.PI;\n if ((angle > 90.4) || (angle < 89.6)) {\n return ''+angle.toFixed(0) + '\\u00B0';\n } else {\n return '';\n }\n});\nABCLabel.setAttribute({anchorX:'middle'});\n\nvar CAB = board.create('nonreflexangle', [C,A,B], {type:'sector', orthoType:'square', orthoSensitivity:0.4, \nradius:function() { return scale;} \n});\nvar CABLabel = CAB.label.setText(function () {\n var angle = 180.0 * CAB.Value() / Math.PI;\n if ((angle > 90.4) || (angle < 89.6)) {\n return ''+angle.toFixed(1) + '\\u00B0';\n } else {\n return '';\n }\n});\nCABLabel.setAttribute({anchorX:'middle'});\n\n/*\n//Dummy text for testing variables, remove after testing\ntempText = board.create('text',[(yOffset),(yOffset),\n// function () {return 'ABC = ' +(180.0*ABC.Value()/Math.PI).toFixed(2)+ ' degreeSymbol'}]);\nfunction () {return 'yOffset is ' + yOffset}]);\n*/\n\n//Set up dimension labels to be properly aligned\ntextAB = board.create('text', \n [function () {return (A.X() + B.X())/2},\n function () {return ((A.Y() + B.Y())/2)+(scaleOffset/2)},\n function () {return +A.Dist(B).toFixed(1) + ' ' + units}],\n {fontSize:15, anchorX:'middle'});\n\n/*\n//Hide this for final version\ntextBC = board.create('text', \n [function () {return (B.X() + C.X())/2},\n function () {return ((B.Y() + C.Y())/2)-scaleOffset},\n function () {return +B.Dist(C).toFixed(1) + ' ' + units}],\n {fontSize:15, anchorX:'middle'});\n\n//Hide this for final version\ntextAC = board.create('text', \n [function () {return (A.X() + C.X())/2},\n function () {return ((A.Y() + C.Y())/2)+(scaleOffset/2)},\n function () {return +A.Dist(C).toFixed(1) + ' ' + units}],\n {fontSize:15, anchorX:'middle'});\n*/\n\nvar tABRot = board.create('transform', \n [function () {return AB.getAngle()}, \n function () {return (A.X() + B.X())/2}, \n function () {return (A.Y() + B.Y())/2}],\n {type:'rotate'});\n\n/*\n//Hide this for final version\nvar tBCRot = board.create('transform', \n [function () {return BC.getAngle()}, \n function () {return (B.X() + C.X())/2}, \n function () {return (B.Y() + C.Y())/2}],\n {type:'rotate'});\n\n//Hide this for final version\nvar tACRot = board.create('transform', \n [function () {return AC.getAngle()}, \n function () {return (A.X() + C.X())/2}, \n function () {return (A.Y() + C.Y())/2}],\n {type:'rotate'});\n*/\n\n//Perform text rotations and update\ntABRot.bindTo(textAB);\n//Hide this for final version\n//tBCRot.bindTo(textBC); \n//Hide this for final version\n//tACRot.bindTo(textAC);\nboard.update();\n\nreturn div;", "language": "javascript"}}, "preamble": {"css": "", "js": ""}, "variable_groups": [{"variables": [], "name": "Unnamed group"}], "advice": "Use SOHCAHTOA to relate the sides and angles.
", "rulesets": {}, "ungrouped_variables": ["unitList", "units", "a", "angleB", "c", "b", "angleC"], "type": "question"}, {"name": "Apply the sine rule (2 angles, 1 side, degrees)", "extensions": [], "custom_part_types": [], "resources": [["question-resources/Triangle_700_1fsikuZ.gif", "/srv/numbas/media/question-resources/Triangle_700_1fsikuZ.gif"]], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Newcastle University Mathematics and Statistics", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/697/"}, {"name": "Andrew Chuter", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4565/"}], "tags": [], "metadata": {"description": "Two questions testing the application of the Sine Rule when given two angles and a side. In this question, the triangle is always acute.
", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "Suppose that $\\Delta ABC$ is a triangle with all interior angles less than $90^{\\circ}$. Sides and angles are labelled as shown in the diagram below (not to scale).
\nGiven the following two angles and a side length, determine the other two side lengths and the angle. Write down the side lengths as whole numbers and the angle correct to the nearest degree.
\n\n", "advice": "We use the Sine Rule to find $b$: $\\dfrac{a}{\\sin A}=\\dfrac{b}{\\sin B}$. Thus $b=\\dfrac{a \\sin B}{\\sin A}\\approx\\var{b0}$.
\nSince $A+B+C=180$, we calculate $C=180-A-B=\\var{CC2}$.
\nWe use the Sine Rule to find $c$: $\\dfrac{a}{\\sin A}=\\dfrac{c}{\\sin C}$. Thus $c=\\dfrac{a \\sin C}{\\sin A}\\approx\\var{c0}$.
\n", "rulesets": {"std": ["all", "!collectNumbers", "fractionNumbers", "!noLeadingMinus"]}, "variables": {"cc4": {"name": "cc4", "group": "Ungrouped variables", "definition": "pi-AA3-BB3", "description": "", "templateType": "anything"}, "cc1": {"name": "cc1", "group": "Ungrouped variables", "definition": "180-aa0-bb0", "description": "", "templateType": "anything"}, "b3": {"name": "b3", "group": "Ungrouped variables", "definition": "random(7..20)", "description": "", "templateType": "anything"}, "s5": {"name": "s5", "group": "Ungrouped variables", "definition": "sin(AA5)", "description": "", "templateType": "anything"}, "c31": {"name": "c31", "group": "Ungrouped variables", "definition": "ceil(sqrt(x4))", "description": "", "templateType": "anything"}, "c2": {"name": "c2", "group": "Ungrouped variables", "definition": "floor(sqrt(x2))", "description": "", "templateType": "anything"}, "check2": {"name": "check2", "group": "Ungrouped variables", "definition": "pi-AA3-BB3-CC3", "description": "", "templateType": "anything"}, "t3": {"name": "t3", "group": "Ungrouped variables", "definition": "sin(BB3)", "description": "", "templateType": "anything"}, "aa2": {"name": "aa2", "group": "Ungrouped variables", "definition": "precround(aa1,3)", "description": "", "templateType": "anything"}, "c3": {"name": "c3", "group": "Ungrouped variables", "definition": "random(c4..c5 except 0)", "description": "", "templateType": "anything"}, "q3": {"name": "q3", "group": "Ungrouped variables", "definition": "(a3^2+c3^2-b3^2)/(2*a3*c3)", "description": "", "templateType": "anything"}, "x4": {"name": "x4", "group": "Ungrouped variables", "definition": "abs(a3^2-b3^2)", "description": "", "templateType": "anything"}, "aa0": {"name": "aa0", "group": "Ungrouped variables", "definition": "precround(arccos(p0)*180/pi,0)", "description": "", "templateType": "anything"}, "bb1": {"name": "bb1", "group": "Ungrouped variables", "definition": "pi-aa0-cc0", "description": "", "templateType": "anything"}, "aa1": {"name": "aa1", "group": "Ungrouped variables", "definition": "pi-bb0-cc0", "description": "", "templateType": "anything"}, "x5": {"name": "x5", "group": "Ungrouped variables", "definition": "a3^2+b3^2", "description": "", "templateType": "anything"}, "aa4": {"name": "aa4", "group": "Ungrouped variables", "definition": "180-BB3-CC3", "description": "", "templateType": "anything"}, "cc0": {"name": "cc0", "group": "Ungrouped variables", "definition": "precround(arccos(r0),4)", "description": "", "templateType": "anything"}, "c1": {"name": "c1", "group": "Ungrouped variables", "definition": "max(c01,c02)", "description": "", "templateType": "anything"}, "bb5": {"name": "bb5", "group": "Ungrouped variables", "definition": "precround(BB4,3)", "description": "", "templateType": "anything"}, "bb2": {"name": "bb2", "group": "Ungrouped variables", "definition": "precround(bb1,3)", "description": "", "templateType": "anything"}, "p0": {"name": "p0", "group": "Ungrouped variables", "definition": "(c0^2+b0^2-a0^2)/(2*c0*b0)", "description": "", "templateType": "anything"}, "bb4": {"name": "bb4", "group": "Ungrouped variables", "definition": "pi-AA3-CC3", "description": "", "templateType": "anything"}, "check1": {"name": "check1", "group": "Ungrouped variables", "definition": "pi-AA0-BB0-CC0", "description": "", "templateType": "anything"}, "r0": {"name": "r0", "group": "Ungrouped variables", "definition": "(a0^2+b0^2-c0^2)/(2*a0*b0)", "description": "", "templateType": "anything"}, "aa3": {"name": "aa3", "group": "Ungrouped variables", "definition": "precround(arccos(p3),4)", "description": "", "templateType": "anything"}, "temp1": {"name": "temp1", "group": "Ungrouped variables", "definition": "a0*t0/s0", "description": "", "templateType": "anything"}, "c01": {"name": "c01", "group": "Ungrouped variables", "definition": "ceil(sqrt(x1))", "description": "", "templateType": "anything"}, "u2": {"name": "u2", "group": "Ungrouped variables", "definition": "sin(cc2)", "description": "", "templateType": "anything"}, "cc3": {"name": "cc3", "group": "Ungrouped variables", "definition": "precround(arccos(r3)*180/pi,0)", "description": "", "templateType": "anything"}, "c4": {"name": "c4", "group": "Ungrouped variables", "definition": "max(c31,c32)", "description": "", "templateType": "anything"}, "bb3": {"name": "bb3", "group": "Ungrouped variables", "definition": "precround(arccos(q3)*180/pi,0)", "description": "", "templateType": "anything"}, "p3": {"name": "p3", "group": "Ungrouped variables", "definition": "(c3^2+b3^2-a3^2)/(2*c3*b3)", "description": "", "templateType": "anything"}, "s2": {"name": "s2", "group": "Ungrouped variables", "definition": "sin(aa2)", "description": "", "templateType": "anything"}, "u5": {"name": "u5", "group": "Ungrouped variables", "definition": "sin(CC5)", "description": "", "templateType": "anything"}, "c02": {"name": "c02", "group": "Ungrouped variables", "definition": "ceil(min(a0,b0)*0.05)", "description": "", "templateType": "anything"}, "q0": {"name": "q0", "group": "Ungrouped variables", "definition": "(a0^2+c0^2-b0^2)/(2*a0*c0)", "description": "", "templateType": "anything"}, "u3": {"name": "u3", "group": "Ungrouped variables", "definition": "sin(CC3)", "description": "", "templateType": "anything"}, "cc5": {"name": "cc5", "group": "Ungrouped variables", "definition": "precround(CC4,3)", "description": "", "templateType": "anything"}, "bb0": {"name": "bb0", "group": "Ungrouped variables", "definition": "precround(arccos(q0)*180/pi,0)", "description": "", "templateType": "anything"}, "c0": {"name": "c0", "group": "Ungrouped variables", "definition": "random(c1..c2 except 0)", "description": "", "templateType": "anything"}, "t5": {"name": "t5", "group": "Ungrouped variables", "definition": "sin(BB5)", "description": "", "templateType": "anything"}, "a0": {"name": "a0", "group": "Ungrouped variables", "definition": "random(10..25)", "description": "", "templateType": "anything"}, "x2": {"name": "x2", "group": "Ungrouped variables", "definition": "a0^2+b0^2", "description": "", "templateType": "anything"}, "s0": {"name": "s0", "group": "Ungrouped variables", "definition": "sin(aa0)", "description": "", "templateType": "anything"}, "cc2": {"name": "cc2", "group": "Ungrouped variables", "definition": "precround(cc1,0)", "description": "", "templateType": "anything"}, "c5": {"name": "c5", "group": "Ungrouped variables", "definition": "floor(sqrt(x5))", "description": "", "templateType": "anything"}, "b0": {"name": "b0", "group": "Ungrouped variables", "definition": "random(10..25)", "description": "", "templateType": "anything"}, "t2": {"name": "t2", "group": "Ungrouped variables", "definition": "sin(bb2)", "description": "", "templateType": "anything"}, "t0": {"name": "t0", "group": "Ungrouped variables", "definition": "sin(bb0)", "description": "", "templateType": "anything"}, "r3": {"name": "r3", "group": "Ungrouped variables", "definition": "(a3^2+b3^2-c3^2)/(2*a3*b3)", "description": "", "templateType": "anything"}, "x1": {"name": "x1", "group": "Ungrouped variables", "definition": "abs(a0^2-b0^2)", "description": "", "templateType": "anything"}, "u0": {"name": "u0", "group": "Ungrouped variables", "definition": "sin(cc0)", "description": "", "templateType": "anything"}, "a3": {"name": "a3", "group": "Ungrouped variables", "definition": "random(7..20)", "description": "", "templateType": "anything"}, "s3": {"name": "s3", "group": "Ungrouped variables", "definition": "sin(AA3)", "description": "", "templateType": "anything"}, "aa5": {"name": "aa5", "group": "Ungrouped variables", "definition": "precround(AA4,0)", "description": "", "templateType": "anything"}, "c32": {"name": "c32", "group": "Ungrouped variables", "definition": "ceil(min(a3,b3)*0.05)", "description": "", "templateType": "anything"}, "temp2": {"name": "temp2", "group": "Ungrouped variables", "definition": "b0-temp1", "description": "", "templateType": "anything"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["c4", "s3", "cc0", "temp2", "temp1", "b0", "cc3", "b3", "u2", "q0", "q3", "c0", "cc5", "s2", "s0", "cc1", "u0", "u3", "cc2", "aa5", "aa4", "aa1", "aa0", "aa3", "aa2", "x2", "c31", "c32", "a0", "a3", "bb0", "s5", "c3", "c2", "c1", "x1", "c02", "x4", "x5", "p3", "p0", "r0", "r3", "bb3", "t5", "t2", "t3", "t0", "u5", "c5", "cc4", "c01", "bb5", "bb4", "check2", "bb2", "bb1", "check1"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": "$A=\\var{AA0}^\\circ$, $B=\\var{BB0}^\\circ$, $a=\\var{a0}$
\nSide length $b=$ [[0]]
\nAngle $C=$ [[1]]$^\\circ$
\nSide length $c=$ [[2]]
", "stepsPenalty": 1, "steps": [{"type": "information", "useCustomName": false, "customName": "", "marks": 0, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": "Use the Sine Rule: $\\dfrac{a}{\\sin A}=\\dfrac{b}{\\sin B}=\\dfrac{c}{\\sin C}$.
"}], "gaps": [{"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "minValue": "{b0}", "maxValue": "{b0}", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "minValue": "{CC2}", "maxValue": "{CC2}", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "precisionType": "dp", "precision": "0", "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.", "strictPrecision": false, "showPrecisionHint": false, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": false, "customName": "", "marks": 1, "showCorrectAnswer": true, "showFeedbackIcon": true, "scripts": {}, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "adaptiveMarkingPenalty": 0, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "minValue": "{c0}", "maxValue": "{c0}", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "type": "question"}, {"name": "Trigonometry Q4 Sine rule", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "David Wishart", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1461/"}], "statement": "Referring to the triangle below.
", "variables": {"asinA": {"description": "", "templateType": "anything", "name": "asinA", "definition": "a/(sin(radians(angleA)))\n", "group": "Ungrouped variables"}, "c": {"description": "", "templateType": "anything", "name": "c", "definition": "asinA*sin(radians(angleC))", "group": "Ungrouped variables"}, "b": {"description": "", "templateType": "anything", "name": "b", "definition": "asinA*sin(radians(angleB))", "group": "Ungrouped variables"}, "angleB": {"description": "angle
", "templateType": "anything", "name": "angleB", "definition": "random(30..60)", "group": "Ungrouped variables"}, "units": {"description": "", "templateType": "anything", "name": "units", "definition": "random(unitList)", "group": "Ungrouped variables"}, "unitList": {"description": "Units that are to be used for the question.
", "templateType": "list of strings", "name": "unitList", "definition": "[ \"mm\", \"cm\", \"m\", \"km\" ]", "group": "Ungrouped variables"}, "angleC": {"description": "", "templateType": "anything", "name": "angleC", "definition": "random(30..60 except angleB)", "group": "Ungrouped variables"}, "a": {"description": "", "templateType": "anything", "name": "a", "definition": "random(5..50)", "group": "Ungrouped variables"}, "angleA": {"description": "", "templateType": "anything", "name": "angleA", "definition": "180-(angleB+angleC)", "group": "Ungrouped variables"}}, "tags": [], "advice": "Use the sine rule to calculate the sides and the properties of a triangle to find the missing angle.
", "variable_groups": [{"variables": [], "name": "Unnamed group"}], "parts": [{"variableReplacementStrategy": "originalfirst", "type": "gapfill", "marks": 0, "prompt": "{plotgraph(units,a,b,c,angleA,angleB,angleC)}
\nWhat is the length of sides AB and AC?
\nPlease give answer to 2 decimal places
\nAB = [[0]] {units}
\nAC = [[1]] {units}
\nWhat is angle C to the nearest degree?
\nC = [[2]] $^{\\circ}$
", "scripts": {}, "gaps": [{"variableReplacementStrategy": "originalfirst", "precision": "2", "correctAnswerFraction": false, "marks": "3", "scripts": {}, "showPrecisionHint": false, "variableReplacements": [], "showFeedbackIcon": true, "strictPrecision": false, "allowFractions": false, "type": "numberentry", "precisionPartialCredit": "50", "precisionMessage": "You have not given your answer to the correct precision.", "notationStyles": ["plain", "en", "si-en"], "maxValue": "{c}", "correctAnswerStyle": "plain", "minValue": "{c}", "mustBeReducedPC": 0, "mustBeReduced": false, "showCorrectAnswer": true, "precisionType": "dp"}, {"variableReplacementStrategy": "originalfirst", "precision": "2", "correctAnswerFraction": false, "marks": "3", "scripts": {}, "showPrecisionHint": false, "variableReplacements": [], "showFeedbackIcon": true, "strictPrecision": false, "allowFractions": false, "type": "numberentry", "precisionPartialCredit": "50", "precisionMessage": "You have not given your answer to the correct precision.", "notationStyles": ["plain", "en", "si-en"], "maxValue": "{b}", "correctAnswerStyle": "plain", "minValue": "{b}", "mustBeReducedPC": 0, "mustBeReduced": false, "showCorrectAnswer": true, "precisionType": "dp"}, {"variableReplacementStrategy": "originalfirst", "precision": 0, "correctAnswerFraction": false, "marks": "2", "scripts": {}, "showPrecisionHint": false, "variableReplacements": [], "showFeedbackIcon": true, "strictPrecision": false, "allowFractions": false, "type": "numberentry", "precisionPartialCredit": "50", "precisionMessage": "You have not given your answer to the correct precision.", "notationStyles": ["plain", "en", "si-en"], "maxValue": "{angleC}", "correctAnswerStyle": "plain", "minValue": "{angleC}", "mustBeReducedPC": 0, "mustBeReduced": false, "showCorrectAnswer": true, "precisionType": "dp"}], "variableReplacements": [], "showFeedbackIcon": true, "showCorrectAnswer": true}], "functions": {"plotgraph": {"type": "html", "language": "javascript", "parameters": [["units", "string"], ["a", "number"], ["b", "number"], ["c", "number"], ["angleA", "number"], ["angleB", "number"], ["angleC", "number"]], "definition": "// This functions plots a triangle based on two angles and a length\n\n//Function ot convert angles to radians\nfunction toRadians (angle) {\n return angle * (Math.PI / 180);\n}\n\n//Calculate height of triangle\nvar h = b*Math.sin(toRadians(angleC))\n\n//Set text and graph offsets to appear uniform\nvar xOffset = Math.ceil(a/10)\nvar yOffset = Math.ceil(a/2+xOffset-h/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 = a+2*xOffset;\nvar y_min = 0;\nvar y_max = a+2*xOffset;\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,0],\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/*\n//Dummy text for testing variables, remove after testing\ntempText = board.create('text',[(xOffset),(h+yOffset),\nfunction () {return 'A is ' + angleA + ' B is ' + angleB + ' C is ' + angleC}]);\ntempText2 = board.create('text',[(xOffset),(yOffset/2),\nfunction () {return 'a is ' + a + ' b is ' + b + ' c is ' + c}]);\n*/\n\n//Draw three points \nvar pA = board.create('point', [(b*Math.cos(toRadians(angleC))+xOffset), (b*Math.sin(toRadians(angleC))+yOffset)], \n//Make fixed:true after testing\n {size:0, fixed:true,\n label:{offset: [0,10]}});\nvar pB = board.create('point', [(a+xOffset), (yOffset)],\n {size:0, fixed:true,\n label:{offset: [10,-10]}});\nvar pC = board.create('point', [(xOffset), (yOffset)],\n {size:0, fixed:true,\n label:{offset: [-10,-10]}});\n\n\n//Draw a line between them\nvar AB = board.create('line',[pA,pB],{fixed:false, straightFirst:false, straightLast:false, strokeWidth: 1});\nvar BC = board.create('line',[pC,pB],{fixed:false, straightFirst:false, straightLast:false, strokeWidth: 1});\nvar AC = board.create('line',[pC,pA],{fixed:false, straightFirst:false, straightLast:false, strokeWidth: 1});\n\n//Draw angle and label\n//Used in other versions of this questions\nvar ABC = board.create('nonreflexangle', [pA,pB,pC], {type:'sector', orthoType:'square', orthoSensitivity:0.4, \nradius:function() { return scale;}\n });\nvar ABCLabel = ABC.label.setText(function () {\n var angle = 180.0 * ABC.Value() / Math.PI;\n if ((angle > 90.4) || (angle < 89.6)) {\n return ''+angle.toFixed(0) + '\\u00B0';\n } else {\n return '';\n }\n});\nABCLabel.setAttribute({anchorX:'middle'});\n\nvar CAB = board.create('nonreflexangle', [pC,pA,pB], {type:'sector', orthoType:'square', orthoSensitivity:0.4, \nradius:function() { return scale;} \n});\nvar CABLabel = CAB.label.setText(function () {\n var angle = 180.0 * CAB.Value() / Math.PI;\n if ((angle > 90.4) || (angle < 89.6)) {\n return ''+angle.toFixed(0) + '\\u00B0';\n } else {\n return '';\n }\n});\nCABLabel.setAttribute({anchorX:'middle'});\n\n/*\nvar BCA = board.create('nonreflexangle', [pB,pC,pA], {type:'sector', orthoType:'square', orthoSensitivity:0.4, \nradius:function() { return scale;} \n});\nvar BCALabel = BCA.label.setText(function () {\n var angle = 180.0 * BCA.Value() / Math.PI;\n if ((angle > 90.4) || (angle < 89.6)) {\n return ''+angle.toFixed(0) + '\\u00B0';\n } else {\n return '';\n }\n});\nCABLabel.setAttribute({anchorX:'middle'});\n*/\n\n//Not used in this version\n/*\ntextAB = board.create('text', \n [function () {return (pA.X() + pB.X())/2},\n function () {return ((pA.Y() + pB.Y())/2)+(scaleOffset/2)},\n function () {return +pA.Dist(pB).toFixed(2) + ' ' + units}],\n {fontSize:15, anchorX:'middle'});\n*/\n\n//Set up dimension labels to be properly aligned\ntextBC = board.create('text', \n [function () {return (pB.X() + pC.X())/2},\n function () {return ((pB.Y() + pC.Y())/2)-scaleOffset},\n function () {return +pB.Dist(pC).toFixed(0) + ' ' + units}],\n {fontSize:15, anchorX:'middle'});\n\n/*\n//Not used in this version\ntextAC = board.create('text', \n [function () {return (pA.X() + pC.X())/2},\n function () {return ((pA.Y() + pC.Y())/2)+(scaleOffset/2)},\n function () {return +pA.Dist(pC).toFixed(2) + ' ' + units}],\n {fontSize:15, anchorX:'middle'});\n\nvar tABRot = board.create('transform', \n [function () {return AB.getAngle()}, \n function () {return (pA.X() + pB.X())/2}, \n function () {return (pA.Y() + pB.Y())/2}],\n {type:'rotate'});\n*/\n\n//Set up rotation transform for label\nvar tBCRot = board.create('transform', \n [function () {return BC.getAngle()}, \n function () {return (pB.X() + pC.X())/2}, \n function () {return (pB.Y() + pC.Y())/2}],\n {type:'rotate'});\n\n/*\n//Hide this for final version\nvar tACRot = board.create('transform', \n [function () {return AC.getAngle()}, \n function () {return (pA.X() + pC.X())/2}, \n function () {return (pA.Y() + pC.Y())/2}],\n {type:'rotate'});\n*/\n\n//Perform text rotations and update\n//tABRot.bindTo(textAB);\n//Hide this for final version\ntBCRot.bindTo(textBC); \n//Hide this for final version\n//tACRot.bindTo(textAC);\nboard.update();\n\nreturn div;"}}, "variablesTest": {"maxRuns": 100, "condition": "angleA<>90"}, "preamble": {"js": "", "css": ""}, "metadata": {"description": "Draws a triangle based on 2 angles and a side length.
", "licence": "Creative Commons Attribution 4.0 International"}, "rulesets": {}, "ungrouped_variables": ["unitList", "units", "a", "angleB", "angleC", "angleA", "asinA", "b", "c"], "type": "question"}, {"name": "Trigonometry Q5 Cosine rule", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "David Wishart", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1461/"}], "parts": [{"scripts": {}, "variableReplacements": [], "showFeedbackIcon": true, "gaps": [{"precisionPartialCredit": "50", "showFeedbackIcon": true, "precisionType": "dp", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "notationStyles": ["plain", "en", "si-en"], "minValue": "{angleA}", "mustBeReducedPC": 0, "correctAnswerFraction": false, "scripts": {}, "mustBeReduced": false, "precision": "2", "correctAnswerStyle": "plain", "strictPrecision": false, "precisionMessage": "You have not given your answer to the correct precision.", "allowFractions": false, "marks": "3", "type": "numberentry", "showPrecisionHint": false, "maxValue": "{angleA}", "showCorrectAnswer": true}, {"precisionPartialCredit": "50", "showFeedbackIcon": true, "precisionType": "dp", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "notationStyles": ["plain", "en", "si-en"], "minValue": "{angleB}", "mustBeReducedPC": 0, "correctAnswerFraction": false, "scripts": {}, "mustBeReduced": false, "precision": "2", "correctAnswerStyle": "plain", "strictPrecision": false, "precisionMessage": "You have not given your answer to the correct precision.", "allowFractions": false, "marks": "3", "type": "numberentry", "showPrecisionHint": false, "maxValue": "{angleB}", "showCorrectAnswer": true}, {"precisionPartialCredit": "50", "showFeedbackIcon": true, "precisionType": "dp", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "notationStyles": ["plain", "en", "si-en"], "minValue": "{angleC}", "mustBeReducedPC": 0, "correctAnswerFraction": false, "scripts": {}, "mustBeReduced": false, "precision": "2", "correctAnswerStyle": "plain", "strictPrecision": false, "precisionMessage": "You have not given your answer to the correct precision.", "allowFractions": false, "marks": "3", "type": "numberentry", "showPrecisionHint": false, "maxValue": "{angleC}", "showCorrectAnswer": true}], "marks": 0, "type": "gapfill", "prompt": "{plotgraph(units,a,b,c,angleA,angleB,angleC)}
\nWhat are the angles A, B and C?
\nPlease give answer to 2 decimal places
\nA = [[0]] $^{\\circ}$
\nB = [[1]] $^{\\circ}$
\nC = [[2]] $^{\\circ}$
\n", "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true}], "variablesTest": {"maxRuns": "200", "condition": "b-c<>0 &&\na-c>0"}, "variable_groups": [{"variables": [], "name": "Unnamed group"}], "statement": "Referring to the triangle below.
", "advice": "Use the cosine rule to find the angles.
", "ungrouped_variables": ["unitList", "units", "a", "angleARough", "asinA", "angleMin", "angleBmax", "bMax", "bMin", "b", "angleBRough", "angleCRough", "c", "angleA", "angleB", "angleC"], "metadata": {"description": "Draws a triangle based on 3 side lengths.
", "licence": "Creative Commons Attribution 4.0 International"}, "tags": [], "rulesets": {}, "preamble": {"js": "", "css": ""}, "functions": {"plotgraph": {"parameters": [["units", "string"], ["a", "number"], ["b", "number"], ["c", "number"], ["angleA", "number"], ["angleB", "number"], ["angleC", "number"]], "language": "javascript", "type": "html", "definition": "// This functions plots a triangle based on three lengths\n\n//Function ot convert angles to radians\nfunction toRadians (angle) {\n return angle * (Math.PI / 180);\n}\n\n//Calculate height of triangle\nvar h = b*Math.sin(toRadians(angleC))\n\n//Set text and graph offsets to appear uniform\nvar xOffset = Math.ceil(a/10)\nvar yOffset = Math.ceil(a/2+xOffset-h/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 = a+2*xOffset;\nvar y_min = 0;\nvar y_max = a+2*xOffset;\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,0],\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/*\n//Dummy text for testing variables, remove after testing\ntempText = board.create('text',[(xOffset),(h+yOffset*1.5),\nfunction () {return 'A is ' + angleA.toFixed(4) + ' B is ' + angleB.toFixed(4) + ' C is ' + angleC.toFixed(4)}]);\ntempText2 = board.create('text',[(xOffset),(yOffset/2),\nfunction () {return 'a is ' + a + ' b is ' + b + ' c is ' + c}]);\n*/\n\n//Draw three points \nvar pA = board.create('point', [(b*Math.cos(toRadians(angleC))+xOffset), (b*Math.sin(toRadians(angleC))+yOffset)], \n//Make fixed:true after testing\n {size:0, fixed:true,\n label:{offset: [0,10]}});\nvar pB = board.create('point', [(a+xOffset), (yOffset)],\n {size:0, fixed:true,\n label:{offset: [10,-10]}});\nvar pC = board.create('point', [(xOffset), (yOffset)],\n {size:0, fixed:true,\n label:{offset: [-10,-10]}});\n\n//Draw a line between them\nvar AB = board.create('line',[pA,pB],{fixed:false, straightFirst:false, straightLast:false, strokeWidth: 1});\nvar BC = board.create('line',[pC,pB],{fixed:false, straightFirst:false, straightLast:false, strokeWidth: 1});\nvar AC = board.create('line',[pC,pA],{fixed:false, straightFirst:false, straightLast:false, strokeWidth: 1});\n\n//Draw angles\nvar ABC = board.create('nonreflexangle', [pA,pB,pC], {type:'sector', orthoType:'square', orthoSensitivity:0.4, \nradius:function() { return scale;}\n });\nvar CAB = board.create('nonreflexangle', [pC,pA,pB], {type:'sector', orthoType:'square', orthoSensitivity:0.4,\nradius:function() { return scale;} \n});\nvar BCA = board.create('nonreflexangle', [pB,pC,pA], {type:'sector', orthoType:'square', orthoSensitivity:0.4,\nradius:function() { return scale;} \n});\n\n//Blank out label for this version\nABC.label.setText('');\nCAB.label.setText('');\nBCA.label.setText('');\n\n/* Angle labels used for testing\nvar ABCLabel = ABC.label.setText(function () {\n var angle = 180.0 * ABC.Value() / Math.PI;\n if ((angle > 90.4) || (angle < 89.6)) {\n return ''+angle.toFixed(2) + '\\u00B0';\n } else {\n return '';\n }\n});\nABCLabel.setAttribute({anchorX:'middle'});\n\nvar CABLabel = CAB.label.setText(function () {\n var angle = 180.0 * CAB.Value() / Math.PI;\n if ((angle > 90.4) || (angle < 89.6)) {\n return ''+angle.toFixed(2) + '\\u00B0';\n } else {\n return '';\n }\n});\nCABLabel.setAttribute({anchorX:'middle'});\n\nvar BCALabel = BCA.label.setText(function () {\n var angle = 180.0 * BCA.Value() / Math.PI;\n if ((angle > 90.4) || (angle < 89.6)) {\n return ''+angle.toFixed(2) + '\\u00B0';\n } else {\n return '';\n }\n});\nBCALabel.setAttribute({anchorX:'middle'});\n*/\n\n//Set up dimension labels to be properly aligned\ntextAB = board.create('text', \n [function () {return (pA.X() + pB.X())/2},\n function () {return ((pA.Y() + pB.Y())/2)+(scaleOffset/2)},\n function () {return +pA.Dist(pB).toFixed(2) + ' ' + units}],\n {fontSize:15, anchorX:'middle'});\n\ntextBC = board.create('text', \n [function () {return (pB.X() + pC.X())/2},\n function () {return ((pB.Y() + pC.Y())/2)-scaleOffset},\n function () {return +pB.Dist(pC).toFixed(0) + ' ' + units}],\n {fontSize:15, anchorX:'middle'});\n\ntextAC = board.create('text', \n [function () {return (pA.X() + pC.X())/2},\n function () {return ((pA.Y() + pC.Y())/2)+(scaleOffset/2)},\n function () {return +pA.Dist(pC).toFixed(2) + ' ' + units}],\n {fontSize:15, anchorX:'middle'});\n\n//Set up transform for rotating dimension labels\nvar tABRot = board.create('transform', \n [function () {return AB.getAngle()}, \n function () {return (pA.X() + pB.X())/2}, \n function () {return (pA.Y() + pB.Y())/2}],\n {type:'rotate'});\n\nvar tBCRot = board.create('transform', \n [function () {return BC.getAngle()}, \n function () {return (pB.X() + pC.X())/2}, \n function () {return (pB.Y() + pC.Y())/2}],\n {type:'rotate'});\n\n\nvar tACRot = board.create('transform', \n [function () {return AC.getAngle()}, \n function () {return (pA.X() + pC.X())/2}, \n function () {return (pA.Y() + pC.Y())/2}],\n {type:'rotate'});\n\n//Perform text rotations and update\ntABRot.bindTo(textAB);\ntBCRot.bindTo(textBC); \ntACRot.bindTo(textAC);\nboard.update();\n\nreturn div;"}}, "variables": {"angleA": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "180*arccos((b^2+c^2-a^2)/(2*b*c))/PI\n", "name": "angleA"}, "angleBRough": {"templateType": "anything", "group": "Ungrouped variables", "description": "angle
", "definition": "180*arcsin(b/asinA)/PI", "name": "angleBRough"}, "bMax": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "asinA*sin(radians(angleBmax))", "name": "bMax"}, "c": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "precround(((a^2+b^2-2*a*b*cos(radians(angleCRough)))^0.5),0)", "name": "c"}, "angleARough": {"templateType": "anything", "group": "Ungrouped variables", "description": "Temp
", "definition": "random(75..120 except 89 except 90 except 91)", "name": "angleARough"}, "a": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "random(5..50)", "name": "a"}, "units": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "random(unitList)", "name": "units"}, "angleMin": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "30\n", "name": "angleMin"}, "angleC": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "180-(angleA + angleB)", "name": "angleC"}, "asinA": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "a/(sin(radians(angleARough)))\n", "name": "asinA"}, "angleBmax": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "150-angleARough", "name": "angleBmax"}, "unitList": {"templateType": "list of strings", "group": "Ungrouped variables", "description": "Units that are to be used for the question.
", "definition": "[ \"mm\", \"cm\", \"m\", \"km\" ]", "name": "unitList"}, "angleCRough": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "180-(angleARough+angleBRough)", "name": "angleCRough"}, "bMin": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "asinA*sin(radians(angleMin))", "name": "bMin"}, "angleB": {"templateType": "anything", "group": "Ungrouped variables", "description": "angleB
", "definition": "180*arccos((a^2+c^2-b^2)/(2*a*c))/PI\n", "name": "angleB"}, "b": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "random(floor(bMin)..floor(bMax) except a)", "name": "b"}}, "type": "question"}, {"name": "2 triangle problem with angle of depression", "extensions": [], "custom_part_types": [], "resources": [["question-resources/angleofdepression_problem.svg", "/srv/numbas/media/question-resources/angleofdepression_problem.svg"]], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Merryn Horrocks", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4052/"}], "tags": [], "metadata": {"description": "Students are given a diagram with 2 triangles. They are given 2 randomised lengths, and a randomised angle of depression.
\nThey need to compute an angle by subtracting the angle of depression from 90°. Then they need to use the sine rule to calculate a second angle. Then they need to use the alternate angles on parallel lines theorem to work out a third angle. They use these to calculate a third angle, which they use in the right-angle triangle with the sine ratio to compute the third side. They then use the cos ratio to compute the length of the third side.
", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "A person standing on the top of a building at $J$ looks down to a garden on the ground at point $M$. The angle of depression from $J$ to $M$ is $\\var{aod}$°. There is a window in the building at $K$, $\\var{JK}$ metres below $J$. The distance from $M$ to $K$ is $\\var{KM}$ metres.
\n\nnot to scale
\n", "advice": "$\\angle MJK = 90° - \\var{aod}° = \\var{aMJK}°$
\nIn $\\triangle JKM$, by the sine rule, $\\frac{JK}{\\sin (\\angle M)}=\\frac{KM}{\\sin (\\angle J)}$
\n$\\frac{\\var{JK}}{\\sin (\\angle M)}=\\frac{\\var{KM}}{\\sin \\var{aMJK}°}$
\n$\\angle M = \\angle JMK = \\var{aJMK}°$
\n\nNow $\\angle JML = \\var{aod}$° (alternate angles on parallel lines)
\nSo $\\angle KML = \\angle JML - \\angle JMK = \\var{aod}° - \\var{aJMK}° = \\var{aKML}° $
\nThe angle of elevation from $M$ to $K$ is $\\var{aKML}° $.
\n\n$\\triangle KML$ is a right-angle triangle, and $\\angle KML = 90°$
\nSo to find $KL$ we can use the sine ratio: $\\sin(angle)=\\frac{opposite}{hypotenuse}$
\n$\\sin(\\var{aKML})° = \\frac{KL}{\\var{KM}}$
\n$KL = \\var{KM} \\times \\sin(\\var{aKML}°) = \\var{KL}$ m
\nThe distance from the ground to $K$ is $\\var{KL}$ m.
\n\nTo find $LM$ we can use the cosine ratio: $\\cos(angle)=\\frac{adjacent}{hypotenuse}$
\n$\\cos(\\var{aKML})° = \\frac{LM}{\\var{KM}}$
\n$LM = \\var{KM} \\times \\cos(\\var{aKML}°) = \\var{LM}$ m
\nThe distance from the pond to the building is $\\var{LM}$ m.
\n", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"aod": {"name": "aod", "group": "Ungrouped variables", "definition": "random(50..75)", "description": "", "templateType": "anything", "can_override": false}, "JK": {"name": "JK", "group": "Ungrouped variables", "definition": "random(2..25)", "description": "", "templateType": "anything", "can_override": false}, "KM": {"name": "KM", "group": "Ungrouped variables", "definition": "random(JK..JK*2)", "description": "", "templateType": "anything", "can_override": false}, "aMJK": {"name": "aMJK", "group": "Ungrouped variables", "definition": "90-aod", "description": "", "templateType": "anything", "can_override": false}, "aJMK": {"name": "aJMK", "group": "Ungrouped variables", "definition": "round(degrees(arcsin(JK*sin(radians(aMJK))/KM )))", "description": "", "templateType": "anything", "can_override": false}, "KL": {"name": "KL", "group": "Ungrouped variables", "definition": "round(KM * sin(radians(aKML)))", "description": "", "templateType": "anything", "can_override": false}, "aKML": {"name": "aKML", "group": "Ungrouped variables", "definition": "aod-aJMK", "description": "", "templateType": "anything", "can_override": false}, "KLmin": {"name": "KLmin", "group": "Ungrouped variables", "definition": "round(KM * sin(radians(aKML-1))-0.1)", "description": "", "templateType": "anything", "can_override": false}, "KLmax": {"name": "KLmax", "group": "Ungrouped variables", "definition": "round(KM * sin(radians(aKML+1))+0.1)", "description": "", "templateType": "anything", "can_override": false}, "LM": {"name": "LM", "group": "Ungrouped variables", "definition": "round(KM * cos(radians(aKML)))", "description": "", "templateType": "anything", "can_override": false}, "LMmin": {"name": "LMmin", "group": "Ungrouped variables", "definition": "round(KM * cos(radians(aKML-1))-0.1)", "description": "", "templateType": "anything", "can_override": false}, "LMmax": {"name": "LMmax", "group": "Ungrouped variables", "definition": "round(KM * cos(radians(aKML+1))+0.1)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["aod", "JK", "KM", "aMJK", "aJMK", "aKML", "KL", "KLmin", "KLmax", "LM", "LMmin", "LMmax"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"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, "prompt": "Calculate the angle of elevation from $M$ to $K$. Give your answer to the nearest degree.
", "minValue": "aKML-1", "maxValue": "aKML+1", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"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, "prompt": "What is the distance, in metres, from the ground (at $L$) to the window (at $K$)? Give your answer to the nearest metre.
", "minValue": "{KLmin}", "maxValue": "{KLmax}", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"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, "prompt": "How far is it, in metres, from the building to the garden (i.e. what is the length of $LM$)?
\nGive your answer to the nearest metre.
", "minValue": "{LMmin}", "maxValue": "{LMmax}", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question"}, {"name": "Converting angles from degrees to radians", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Ben Brawn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/605/"}, {"name": "Xiaodan Leng", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2146/"}], "metadata": {"licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International", "description": "Convert from degrees to radians
"}, "preamble": {"js": "", "css": ""}, "statement": "Please
Note: to enter the value $\\pi$ simply type pi. For example, $\\frac{3\\pi}{2}$ could be entered as 3*pi/2 or even as 3pi/2
", "variable_groups": [], "functions": {}, "variables": {"b": {"name": "b", "templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "random(2,3,4,5,6,9,10,12,15,18,20,30,36,45,60,90)"}, "med": {"name": "med", "templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": " random(30, 45, 60, 90)"}, "easy1": {"name": "easy1", "templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "random(180,360)"}, "ans3": {"name": "ans3", "templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "a*180/b"}, "easyans": {"name": "easyans", "templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "if(easy1=180, pi, 2*pi)"}, "medansden": {"name": "medansden", "templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "switch(med=30, 6, med=45, 4, med=60, 3, med=90, 2)"}, "a": {"name": "a", "templateType": "anything", "group": "Ungrouped variables", "description": "", "definition": "random(2..12)"}}, "tags": [], "parts": [{"variableReplacements": [], "gaps": [{"checkingAccuracy": 0.001, "variableReplacements": [], "vsetRangePoints": 5, "vsetRange": [0, 1], "valuegenerators": [], "type": "jme", "useCustomName": false, "failureRate": 1, "checkingType": "absdiff", "checkVariableNames": false, "unitTests": [], "customName": "", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "customMarkingAlgorithm": "", "showPreview": true, "answer": "{easyans}", "showCorrectAnswer": true, "scripts": {}, "extendBaseMarkingAlgorithm": true, "marks": 1}], "type": "gapfill", "useCustomName": false, "prompt": "$\\var{easy1}^\\circ=$ [[0]]
", "unitTests": [], "customName": "", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "customMarkingAlgorithm": "", "showCorrectAnswer": true, "sortAnswers": false, "scripts": {}, "extendBaseMarkingAlgorithm": true, "marks": 0}, {"variableReplacements": [], "gaps": [{"checkingAccuracy": 0.001, "variableReplacements": [], "vsetRangePoints": 5, "vsetRange": [0, 1], "valuegenerators": [], "type": "jme", "useCustomName": false, "failureRate": 1, "checkingType": "absdiff", "checkVariableNames": false, "unitTests": [], "customName": "", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "customMarkingAlgorithm": "", "showPreview": true, "answer": "pi/{medansden}", "showCorrectAnswer": true, "scripts": {}, "extendBaseMarkingAlgorithm": true, "marks": 1}], "type": "gapfill", "useCustomName": false, "prompt": "$\\var{med}^\\circ=$ [[0]]
", "unitTests": [], "customName": "", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "customMarkingAlgorithm": "", "showCorrectAnswer": true, "sortAnswers": false, "scripts": {}, "extendBaseMarkingAlgorithm": true, "marks": 0}, {"variableReplacements": [], "gaps": [{"variableReplacements": [], "answerSimplification": "fractionNumbers", "variableReplacementStrategy": "originalfirst", "checkVariableNames": false, "showCorrectAnswer": true, "showPreview": true, "answer": "{a*b/180}pi", "unitTests": [], "scripts": {}, "vsetRange": [0, 1], "marks": 1, "vsetRangePoints": 5, "valuegenerators": [], "type": "jme", "useCustomName": false, "customName": "", "failureRate": 1, "checkingAccuracy": 0.001, "showFeedbackIcon": true, "extendBaseMarkingAlgorithm": true, "checkingType": "absdiff", "customMarkingAlgorithm": ""}], "type": "gapfill", "useCustomName": false, "prompt": "$\\var{a*b}^\\circ=$ [[0]]
", "unitTests": [], "customName": "", "variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "customMarkingAlgorithm": "", "showCorrectAnswer": true, "sortAnswers": false, "scripts": {}, "extendBaseMarkingAlgorithm": true, "marks": 0}], "variablesTest": {"condition": "", "maxRuns": 100}, "advice": "$180^\\circ$ is equal to $\\pi$ radians. This means for each $180^\\circ$ we can replace it with $\\pi$ radians. To determine how many $180^\\circ$s are
For example, $\\displaystyle 72^\\circ=\\frac{72^\\circ}{180^\\circ}\\times \\pi=\\frac{2\\pi}{5}$.
\n\nIt is useful to memorise some of the very common angles, for example, $30^\\circ=\\displaystyle \\frac{\\pi}{6},\\, 45^\\circ=\\frac{\\pi}{4},\\, 60^\\circ=\\frac{\\pi}{3}, \\,90^\\circ=\\frac{\\pi}{2}, \\,180^\\circ=\\pi$ and $360^\\circ=2\\pi$.
", "rulesets": {}, "ungrouped_variables": ["easy1", "easyans", "med", "medansden", "a", "b", "ans3"], "type": "question"}, {"name": "Converting angles from radians to degrees", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Ben Brawn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/605/"}, {"name": "Xiaodan Leng", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2146/"}], "variable_groups": [], "functions": {}, "tags": [], "ungrouped_variables": ["d", "ans1", "m", "ans2", "a", "b", "ans3"], "statement": "Please
Convert from radians to degrees
"}, "parts": [{"variableReplacementStrategy": "originalfirst", "marks": 0, "prompt": "$\\displaystyle\\simplify{{m}*pi}=$ [[0]]$^\\circ$
", "type": "gapfill", "gaps": [{"variableReplacementStrategy": "originalfirst", "scripts": {}, "marks": 1, "correctAnswerStyle": "plain", "showCorrectAnswer": true, "correctAnswerFraction": false, "mustBeReducedPC": 0, "allowFractions": false, "notationStyles": ["plain", "en", "si-en"], "type": "numberentry", "maxValue": "{ans2}", "showFeedbackIcon": true, "minValue": "{ans2}", "variableReplacements": [], "mustBeReduced": false}], "showFeedbackIcon": true, "showCorrectAnswer": true, "variableReplacements": [], "scripts": {}}, {"variableReplacementStrategy": "originalfirst", "marks": 0, "prompt": "$\\displaystyle\\simplify{pi/{d}}=$ [[0]]$^\\circ$
", "type": "gapfill", "gaps": [{"variableReplacementStrategy": "originalfirst", "scripts": {}, "marks": 1, "correctAnswerStyle": "plain", "showCorrectAnswer": true, "correctAnswerFraction": false, "mustBeReducedPC": 0, "allowFractions": false, "notationStyles": ["plain", "en", "si-en"], "type": "numberentry", "maxValue": "{ans1}", "showFeedbackIcon": true, "minValue": "{ans1}", "variableReplacements": [], "mustBeReduced": false}], "showFeedbackIcon": true, "showCorrectAnswer": true, "variableReplacements": [], "scripts": {}}, {"variableReplacementStrategy": "originalfirst", "marks": 0, "prompt": "$\\displaystyle\\simplify{{a}*pi/{b}}=$ [[0]]$^\\circ$
", "type": "gapfill", "gaps": [{"variableReplacementStrategy": "originalfirst", "scripts": {}, "marks": 1, "correctAnswerStyle": "plain", "showCorrectAnswer": true, "correctAnswerFraction": false, "mustBeReducedPC": 0, "allowFractions": false, "notationStyles": ["plain", "en", "si-en"], "type": "numberentry", "maxValue": "{ans3}", "showFeedbackIcon": true, "minValue": "{ans3}", "variableReplacements": [], "mustBeReduced": false}], "showFeedbackIcon": true, "showCorrectAnswer": true, "variableReplacements": [], "scripts": {}}], "advice": "$\\pi$ radians is equal to $180^\\circ$. This means each $\\pi$ we see we can replace it with $180^\\circ$. In other words, to convert from radians to degrees we divide by $\\pi$ and multiply by $180^\\circ$.
\n\nFor example, $\\displaystyle \\frac{2\\pi}{5}=\\frac{2\\pi\\times 180^\\circ}{5\\pi}=\\frac{2\\times 180^\\circ}{5}=72^\\circ$.
\n\nIt is useful to memorise some of the very common angles, for example, $\\displaystyle \\frac{\\pi}{6}=30^\\circ,\\, \\frac{\\pi}{4}=45^\\circ,\\, \\frac{\\pi}{3}=60^\\circ, \\,\\frac{\\pi}{2}=90^\\circ, \\,\\pi=180^\\circ$ and $2\\pi=360^\\circ$.
", "type": "question", "variables": {"b": {"group": "Ungrouped variables", "description": "", "definition": "random(2,3,4,5,6,9,10,12,15,18,20,30,36,45,60,90)", "name": "b", "templateType": "anything"}, "d": {"group": "Ungrouped variables", "description": "", "definition": "random(2,3,4,6)", "name": "d", "templateType": "anything"}, "m": {"group": "Ungrouped variables", "description": "", "definition": "random(1,2)", "name": "m", "templateType": "anything"}, "ans1": {"group": "Ungrouped variables", "description": "", "definition": "switch(d=6, 30, d=4, 45, d=3, 60, d=2, 90 )", "name": "ans1", "templateType": "anything"}, "ans2": {"group": "Ungrouped variables", "description": "", "definition": "if(m=1,180,360)", "name": "ans2", "templateType": "anything"}, "ans3": {"group": "Ungrouped variables", "description": "", "definition": "a*180/b", "name": "ans3", "templateType": "anything"}, "a": {"group": "Ungrouped variables", "description": "", "definition": "random(2..12)", "name": "a", "templateType": "anything"}}, "rulesets": {}}]}], "allowPrinting": true, "navigation": {"allowregen": true, "reverse": true, "browse": true, "allowsteps": true, "showfrontpage": true, "showresultspage": "oncompletion", "navigatemode": "sequence", "onleave": {"action": "none", "message": ""}, "preventleave": true, "startpassword": ""}, "timing": {"allowPause": true, "timeout": {"action": "none", "message": ""}, "timedwarning": {"action": "none", "message": ""}}, "feedback": {"showactualmark": false, "showtotalmark": true, "showanswerstate": false, "allowrevealanswer": false, "advicethreshold": 0, "intro": "", "reviewshowscore": true, "reviewshowfeedback": true, "reviewshowexpectedanswer": true, "reviewshowadvice": true, "feedbackmessages": [], "enterreviewmodeimmediately": true, "showexpectedanswerswhen": "inreview", "showpartfeedbackmessageswhen": "oncompletion", "showactualmarkwhen": "oncompletion", "showtotalmarkwhen": "always", "showanswerstatewhen": "oncompletion", "showadvicewhen": "inreview"}, "type": "exam", "contributors": [{"name": "Mark Patterson", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/5064/"}], "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [["question-resources/Triangle_700_1fsikuZ.gif", "/srv/numbas/media/question-resources/Triangle_700_1fsikuZ.gif"], ["question-resources/angleofdepression_problem.svg", "/srv/numbas/media/question-resources/angleofdepression_problem.svg"]]}