// Numbas version: finer_feedback_settings {"name": "Lois's copy of Area of triangle (UEL)", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"functions": {"triangle": {"definition": "var a = Numbas.jme.unwrapValue(scope.variables.a);\n var b = Numbas.jme.unwrapValue(scope.variables.b);\n var c = Numbas.jme.unwrapValue(scope.variables.c);\n var d = Numbas.jme.unwrapValue(scope.variables.d);\n var h = Numbas.jme.unwrapValue(scope.variables.h);\n var g = Numbas.jme.unwrapValue(scope.variables.g);\nvar xupper=Numbas.jme.unwrapValue(scope.variables.xupper);\nvar xlower=Numbas.jme.unwrapValue(scope.variables.xlower);\n//draw a triangle with integral base and integral height\nvar div = Numbas.extensions.jsxgraph.makeBoard('600px','600px',\n{boundingBox:[xlower,h+3,xupper,-3],\n axis:true,\n showNavigation:false,\n grid:false});\n var brd = div.board; \n//Create the points B and C on the base line together with their labels.\nvar p1=brd.create('point',[a,b],{size:1,name:'',fixed:true});\nvar np1=brd.create('text',[p1.X(),p1.Y()-0.5,function(){return '('+a+','+b+')'}]);\nvar p2=brd.create('point',[c,d],{size:1,name:'',fixed:true});\nvar np2=brd.create('text',[p2.X(),p2.Y()-0.5,function(){return '('+c+','+d+')'}]);\n//Create the base line, and labelled with its length.\nvar p3=brd.create('point',[g,h],{size:1,name:'',fixed:true});\nvar np3=brd.create('text',[p3.X(),p3.Y()+0.5,function(){return '('+g+','+h+')'}]);\nvar seg12=brd.create('segment',[p1,p2]);\nvar seg13=brd.create('segment',[p1,p3]);\nvar seg23=brd.create('segment',[p3,p2]);\n//var lb=brd.create('text',[(p1.X()+p2.X())/2,(p1.Y()+p2.Y())/2-1,function(){return c-a;}]);\nreturn div;", "type": "html", "parameters": [], "language": "javascript"}}, "ungrouped_variables": ["a", "c", "b", "d", "g", "area", "h", "xupper", "xlower"], "name": "Lois's copy of Area of triangle (UEL)", "tags": ["area", "coordinates", "mensuration", "triangle"], "advice": "

The area of a triangle is given by $\\displaystyle \\frac{\\text{base}\\times \\text{height}}{2}$.

\n

Looking at the coordinates of the three vertices we see that the base has length $\\var{c}-1=\\var{c-1} cm$.

\n

The height is $\\var{h}-1=\\var{h-1} cm$.

\n

Hence the area is $\\displaystyle \\frac{\\var{h-1}\\times \\var{c-1}}{2}=\\var{area} cm^2$.

\n

For a comprehensive list of the formulas for the perimeters, areas and volumes of 2-d and 3-d shapes see http://www.sciencehq.com/math-formulas/mensuration-formulas.html

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

Find the area of the triangle in $cm^2$.

\n

\n

Area = [[0]]$cm^2$.

", "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "gaps": [{"allowFractions": false, "variableReplacements": [], "maxValue": "area", "minValue": "area", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "showCorrectAnswer": true, "scripts": {}, "marks": 1, "type": "numberentry", "showPrecisionHint": false}], "showCorrectAnswer": true, "scripts": {}, "marks": 0, "type": "gapfill"}], "extensions": ["jsxgraph"], "statement": "

{triangle()}

\n

The units of measurement are in $cm$.

", "variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "preamble": {"css": "", "js": " "}, "variables": {"a": {"definition": "1", "templateType": "anything", "group": "Ungrouped variables", "name": "a", "description": ""}, "c": {"definition": "random(10..20)", "templateType": "anything", "group": "Ungrouped variables", "name": "c", "description": ""}, "b": {"definition": "1", "templateType": "anything", "group": "Ungrouped variables", "name": "b", "description": ""}, "d": {"definition": "1", "templateType": "anything", "group": "Ungrouped variables", "name": "d", "description": ""}, "g": {"definition": "a+random(-10..10)", "templateType": "anything", "group": "Ungrouped variables", "name": "g", "description": ""}, "area": {"definition": "(c-a)*(h-b)/2", "templateType": "anything", "group": "Ungrouped variables", "name": "area", "description": ""}, "h": {"definition": "b+random(5..20)", "templateType": "anything", "group": "Ungrouped variables", "name": "h", "description": ""}, "xupper": {"definition": "if(g>c,g+5,c+5)", "templateType": "anything", "group": "Ungrouped variables", "name": "xupper", "description": ""}, "xlower": {"definition": "if(g<0,g-2,-2)", "templateType": "anything", "group": "Ungrouped variables", "name": "xlower", "description": ""}}, "metadata": {"description": "

Find the area of a triangle where all three coordinates of the vertices are given.

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