// Numbas version: finer_feedback_settings {"name": "Triangle problems", "extensions": [], "custom_part_types": [], "resources": [["question-resources/area-of-a-equilateral-triangle-formula.png", "/srv/numbas/media/question-resources/area-of-a-equilateral-triangle-formula.png"]], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"functions": {"tri": {"definition": " var c = document.createElement('canvas');\n $(c).attr('width',200).attr('height',200);\n var context = c.getContext('2d');\n \nvar height = 100 * (Math.sqrt(3)/2);\nvar XX = 100\nvar YY = 100\n\n// the triangle\ncontext.beginPath();\ncontext.moveTo(100, 100);\ncontext.lineTo(XX+50, YY+height);\ncontext.lineTo(XX-50, YY+height);\ncontext.closePath();\n \n// the outline\ncontext.lineWidth = 10;\ncontext.strokeStyle = '#666666';\ncontext.stroke();\n \n// the fill color\ncontext.fillStyle = \"#FFCC00\";\ncontext.fill();\n\n return c;\n ", "type": "html", "language": "javascript", "parameters": [["h", "number"]]}, "tri1": {"definition": " var c = document.createElement('canvas');\n $(c).attr('width',500).attr('height',500);\n var context = c.getContext('2d');\n \nvar height = 100 * (Math.sqrt(3)/2);\nvar XX = 200\nvar YY = 200\n\n// the triangle\ncontext.beginPath();\ncontext.moveTo(100, 100);\ncontext.lineTo(XX+50, YY+height);\ncontext.lineTo(XX-50, YY+height);\ncontext.closePath();\n \n// the outline\ncontext.lineWidth = 10;\ncontext.strokeStyle = '#666666';\ncontext.stroke();\n \n// the fill color\ncontext.fillStyle = \"#FFCC00\";\ncontext.fill();\n\n return c;\n ", "type": "html", "language": "javascript", "parameters": [["a", "number"]]}}, "ungrouped_variables": ["side1", "ans1", "lent2", "area2", "ans2"], "name": "Triangle problems", "tags": [], "preamble": {"css": "", "js": ""}, "advice": "

Part1

\n

\n

where a=length of side

\n

$\\frac{\\sqrt3}{4} \\times \\var{side1}^2= \\var{ans1}m^2$

\n

Or another method is:

\n

A = $\\frac{1}{2}$ab $\\sin(c)$ = $\\frac{1}{2} \\times \\var{side1} \\times \\var{side1} \\times \\sin(60) = \\var{ans1}m^2$

\n

\n

Formula for perpendicular height of triangle.

\n

Area = $\\frac{1}{2} \\times $base$  \\times$ perpendicular height

\n

$2 \\times \\frac{\\var{area2}}{\\var{lent2}} = \\var{ans2}m$

", "rulesets": {}, "parts": [{"prompt": "

Find the area of an equilateral triangle which has a side of $\\var{side1}$m.

\n

{tri(side1)}

\n

[[0]]m$^2$

", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "gaps": [{"precisionType": "dp", "precisionMessage": "You have not given your answer to the correct precision.", "allowFractions": false, "variableReplacements": [], "maxValue": "{ans1}", "strictPrecision": false, "minValue": "{ans1}", "variableReplacementStrategy": "originalfirst", "precisionPartialCredit": 0, "correctAnswerFraction": false, "showCorrectAnswer": true, "precision": "2", "scripts": {}, "marks": 1, "showPrecisionHint": false, "type": "numberentry"}], "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "gapfill"}, {"prompt": "

Calculate the perpendicular height of a triangle whose base length is $\\var{lent2}$m, if the area of this triangle is $\\var{area2}$m$^2$

\n

{tri1(lent2)}

\n

[[0]]m

\n

", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "gaps": [{"precisionType": "dp", "precisionMessage": "You have not given your answer to the correct precision.", "allowFractions": false, "variableReplacements": [], "maxValue": "{ans2}", "strictPrecision": false, "minValue": "{ans2}", "variableReplacementStrategy": "originalfirst", "precisionPartialCredit": 0, "correctAnswerFraction": false, "showCorrectAnswer": true, "precision": "2", "scripts": {}, "marks": 1, "showPrecisionHint": false, "type": "numberentry"}], "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "gapfill"}], "extensions": [], "statement": "

Correct to 2 decimal place

", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"ans1": {"definition": "(sqrt(3)/4)*side1^2", "templateType": "anything", "group": "Ungrouped variables", "name": "ans1", "description": ""}, "ans2": {"definition": "(2*area2)/lent2", "templateType": "anything", "group": "Ungrouped variables", "name": "ans2", "description": ""}, "area2": {"definition": "random(60..70#0.1)", "templateType": "anything", "group": "Ungrouped variables", "name": "area2", "description": ""}, "lent2": {"definition": "random(7..12#0.5)", "templateType": "anything", "group": "Ungrouped variables", "name": "lent2", "description": ""}, "side1": {"definition": "random(12..16#0.25)", "templateType": "anything", "group": "Ungrouped variables", "name": "side1", "description": ""}}, "metadata": {"description": "

Areas of triangles

\n

rebelmaths

", "licence": "Creative Commons Attribution 4.0 International"}, "type": "question", "showQuestionGroupNames": false, "question_groups": [{"name": "", "pickingStrategy": "all-ordered", "pickQuestions": 0, "questions": []}], "contributors": [{"name": "Paul Howes", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/632/"}]}]}], "contributors": [{"name": "Paul Howes", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/632/"}]}