// Numbas version: finer_feedback_settings {"name": "Maria's copy of Trigonometry: Right angled: Finding trig ratios", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [["question-resources/undefined", "/srv/numbas/media/question-resources/undefined"], ["question-resources/undefined_YwBJcjH", "/srv/numbas/media/question-resources/undefined_YwBJcjH"]], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variable_groups": [], "name": "Maria's copy of Trigonometry: Right angled: Finding trig ratios", "statement": "
Please give your answer to two decimal places.
", "preamble": {"css": "", "js": ""}, "functions": {"triangle": {"definition": "var div = Numbas.extensions.jsxgraph.makeBoard('500px','500px',{boundingBox:[-13,13,17,-17],grid:false,axis:false});\nvar board = div.board;\n\n//Doesn't look like you need this\nJXG.Options.text.useMathJax = true;\n\n// get the height of the triangle\nTT = Numbas.jme.unwrapValue(scope.variables.tritop);\ndx = Numbas.jme.unwrapValue(scope.variables.deltax);\nh = Numbas.jme.unwrapValue(scope.variables.h);\nv = Numbas.jme.unwrapValue(scope.variables.v);\nd = Numbas.jme.unwrapValue(scope.variables.d);\n\n\n// create the horizontal line\nvar hor = board.create('line',[[-12,-TT],[12,-TT]], { straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true});\n\n//create the vertical line\nvar vert = board.create('line',[[12,-TT],[12,TT]], { straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true});\n\n//create the diagonal line\nvar vert = board.create('line',[[-12,-TT],[12,TT]], { straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true});\n\n//create the box for right angle\nboard.create('line',[[(12-0.1*TT),-TT],[(12-0.1*TT),-TT*0.9]], { straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true});\nboard.create('line',[[(12-0.1*TT),-TT*0.9],[12,-TT*0.9]], { straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true});\n\n//these are the guides for angle label\n//var p1 = board.create('point', [-12*6/10, -6*TT/10]);\n//var p2 = board.create('point', [-12*6/10, -TT]);\n//var p3 = board.create('point', [12, 3*TT/5]);\n//var p4 = board.create('point', [12*6/10, 3*TT/5]);\n\n\n//label the angle theta\nboard.create('text',[-7.2,-4*TT/5,\n function() { \n return '$\\\\theta$';\n }], {fontSize:20,fixed: true});\n\n//label the angle phi\nboard.create('text',[9.6,3*TT/5,\n function() { \n return '$\\\\phi$';\n }], {fontSize:20,fixed: true});\n\n\n//display the side lengths\nvar vtext= board.create('text',[12.5,0,v+' m'], {fontSize:20,fixed: true});\nvar htext= board.create('text',[0,-TT-1,h+' m'], {fontSize:20,fixed: true});\nvar dtext= board.create('text',[0,TT/2+0.3,d+' m'], {fontSize:20,fixed: true});\n\n//can't figure out how to rotate text. http://jsxgraph.uni-bayreuth.de/wiki/index.php/Texts_and_Transformations suggests the following\n//var tRot = board.create('transform', [Math.PI/2, 13,0], {type:'rotate'}); \n//tRot.bindTo(vtext);\n\n\n\n\nreturn div;\n\n", "language": "javascript", "parameters": [], "type": "html"}, "otherway": {"definition": "var div = Numbas.extensions.jsxgraph.makeBoard('500px','500px',{boundingBox:[-17,17,14,-14],grid:false,axis:false});\nvar board = div.board;\n\n//Doesn't look like you need this\nJXG.Options.text.useMathJax = true;\n\n// get the height of the triangle\nTT = Numbas.jme.unwrapValue(scope.variables.tritop);\ndx = Numbas.jme.unwrapValue(scope.variables.deltax);\nh = Numbas.jme.unwrapValue(scope.variables.h);\nv = Numbas.jme.unwrapValue(scope.variables.v);\nd = Numbas.jme.unwrapValue(scope.variables.d);\n\n\n// create the horizontal line\nvar hor = board.create('line',[[-12,-TT],[12,-TT]], { straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true});\n\n//create the vertical line\nvar vert = board.create('line',[[-12,-TT],[-12,TT]], { straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true});\n\n//create the diagonal line\nvar vert = board.create('line',[[12,-TT],[-12,TT]], { straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true});\n\n//create the box for right angle\nboard.create('line',[[(-12+0.1*TT),-TT],[(-12+0.1*TT),-TT*0.9]], { straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true});\nboard.create('line',[[(-12+0.1*TT),-TT*0.9],[-12,-TT*0.9]], { straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true});\n\n//these are the guides for angle label\n//var p1 = board.create('point', [-12*6/10, -6*TT/10]);\n//var p2 = board.create('point', [-12*6/10, -TT]);\n//var p3 = board.create('point', [12, 3*TT/5]);\n//var p4 = board.create('point', [12*6/10, 3*TT/5]);\n\n\n//label the angle theta\nboard.create('text',[+6.2,-4*TT/5,\n function() { \n return '$\\\\theta$';\n }], {fontSize:20,fixed: true});\n\n//label the angle phi\nboard.create('text',[-11,3*TT/5,\n function() { \n return '$\\\\phi$';\n }], {fontSize:20,fixed: true});\n\n\n//display the side lengths\nvar vtext= board.create('text',[-16,0,v+' m'], {fontSize:20,fixed: true});\nvar htext= board.create('text',[-2,-TT-1,h+' m'], {fontSize:20,fixed: true});\nvar dtext= board.create('text',[-2,TT/2+0.3,d+' m'], {fontSize:20,fixed: true});\n\n//can't figure out how to rotate text. http://jsxgraph.uni-bayreuth.de/wiki/index.php/Texts_and_Transformations suggests the following\n//var tRot = board.create('transform', [Math.PI/2, 13,0], {type:'rotate'}); \n//tRot.bindTo(vtext);\n\n\n\n\nreturn div;\n\n", "language": "javascript", "parameters": [], "type": "html"}}, "ungrouped_variables": ["triples", "v", "h", "d", "anglelist", "angle", "ratio", "question", "ans1num", "ans1den", "scale", "tritop", "deltax", "switcharoo"], "variables": {"scale": {"definition": "24/h", "templateType": "anything", "name": "scale", "description": "", "group": "Ungrouped variables"}, "switcharoo": {"definition": "random(0,1)", "templateType": "anything", "name": "switcharoo", "description": "", "group": "Ungrouped variables"}, "ratio": {"definition": "random(['$\\\\sin(\\\\var{angle})$',0],['$\\\\cos(\\\\var{angle})$',1],['$\\\\tan(\\\\var{angle})$',2])", "templateType": "anything", "name": "ratio", "description": "", "group": "Ungrouped variables"}, "tritop": {"definition": "precround(v*scale,4)/2", "templateType": "anything", "name": "tritop", "description": "top of triangle for jsxgraph, keeping same ratios.
", "group": "Ungrouped variables"}, "v": {"definition": "triples[0]", "templateType": "anything", "name": "v", "description": "", "group": "Ungrouped variables"}, "deltax": {"definition": "precround(-12+2*h/v,4)", "templateType": "anything", "name": "deltax", "description": "", "group": "Ungrouped variables"}, "anglelist": {"definition": "random(['$\\\\theta$',3],['$\\\\phi$',4])", "templateType": "anything", "name": "anglelist", "description": "", "group": "Ungrouped variables"}, "ans1den": {"definition": "if((anglelist[1]=3 and ratio[1]=0) or (anglelist[1]=4 and ratio[1]=1),d,\n if((anglelist[1]=3 and ratio[1]=1) or (anglelist[1]=4 and ratio[1]=0),d,\n if(anglelist[1]=3 and ratio[1]=2 ,h,\n if(anglelist[1]=4 and ratio[1]=2 ,v))))", "templateType": "anything", "name": "ans1den", "description": "", "group": "Ungrouped variables"}, "h": {"definition": "triples[1]", "templateType": "anything", "name": "h", "description": "", "group": "Ungrouped variables"}, "ans1num": {"definition": "if((anglelist[1]=3 and ratio[1]=0) or (anglelist[1]=4 and ratio[1]=1),v,\n if((anglelist[1]=3 and ratio[1]=1) or (anglelist[1]=4 and ratio[1]=0),h,\n if(anglelist[1]=3 and ratio[1]=2 ,v,\n if(anglelist[1]=4 and ratio[1]=2 ,h))))", "templateType": "anything", "name": "ans1num", "description": "", "group": "Ungrouped variables"}, "triples": {"definition": "random([[3,4,5], [5,12,13], [7,24,25], [8,15,17], [9,40,41],[11,60,61], [12,35,37]])\n", "templateType": "anything", "name": "triples", "description": "Some the following were too skinny and so were removed.
random([[3,4,5], [5,12,13], [7,24,25], [8,15,17], [9,40,41],
[11,60,61], [12,35,37]])
use https://www.mathsisfun.com/numbers/pythagorean-triples.html
\n\nso always integer and scale by k for more randomness.
", "group": "Ungrouped variables"}}, "metadata": {"description": "", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "variablesTest": {"condition": "", "maxRuns": 100}, "parts": [{"marks": 0, "prompt": "{if(switcharoo=0,triangle(),otherway())}
\nGiven the triangle described above, the value of {question} is [[0]].
", "showCorrectAnswer": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "unitTests": [], "showFeedbackIcon": true, "useCustomName": false, "customName": "", "sortAnswers": false, "customMarkingAlgorithm": "", "scripts": {}, "type": "gapfill", "extendBaseMarkingAlgorithm": true, "gaps": [{"correctAnswerStyle": "plain", "showCorrectAnswer": true, "allowFractions": false, "unitTests": [], "customName": "", "mustBeReduced": false, "scripts": {}, "precision": "2", "type": "numberentry", "showPrecisionHint": false, "precisionPartialCredit": 0, "maxValue": "{ans1num}/{ans1den}", "marks": 1, "notationStyles": ["plain", "en", "si-en"], "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "precisionType": "dp", "showFeedbackIcon": true, "useCustomName": false, "correctAnswerFraction": false, "customMarkingAlgorithm": "", "strictPrecision": true, "precisionMessage": "You have not given your answer to the correct precision.", "extendBaseMarkingAlgorithm": true, "mustBeReducedPC": 0, "minValue": "{ans1num}/{ans1den}"}]}], "extensions": ["jsxgraph"], "advice": "Use SOHCAHTOA to help you answer these questions:
\nor Pythagoras' Theorem:
\n", "rulesets": {}, "tags": [], "type": "question", "contributors": [{"name": "Mark Hodds", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/510/"}, {"name": "Paul Emanuel", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2551/"}, {"name": "Samantha Konig", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2560/"}, {"name": "Maria Aneiros", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3388/"}]}]}], "contributors": [{"name": "Mark Hodds", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/510/"}, {"name": "Paul Emanuel", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2551/"}, {"name": "Samantha Konig", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2560/"}, {"name": "Maria Aneiros", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/3388/"}]}