// Numbas version: exam_results_page_options {"name": "Trigonometry: Right-angled", "metadata": {"description": "", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "duration": 0, "percentPass": 0, "showQuestionGroupNames": false, "shuffleQuestionGroups": false, "showstudentname": true, "question_groups": [{"name": "Group", "pickingStrategy": "all-ordered", "pickQuestions": 1, "questionNames": ["", "", "", "", "", ""], "variable_overrides": [[], [], [], [], [], []], "questions": [{"name": "Pythagoras' Theorem: Integers", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [["question-resources/undefined_YwBJcjH", "/srv/numbas/media/question-resources/undefined_YwBJcjH"]], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Ben Brawn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/605/"}], "tags": ["epphys", "JSXgraph", "Jsxgraph", "jsxgraph", "pythagoras", "Pythagoras", "Triangle", "triangle"], "metadata": {"description": "", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "", "advice": "

Pythagoras' theorem says that $c^2=a^2+b^2$ for a right-angled triangle whose hypotenuse is labelled $c$ and whose other sides are labelled $a$ and $b$. Based on our diagram we have $\\var{d}^2=\\var{h}^2+\\var{v}^2$.

\n

Now we just solve this for $x$:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
$x^2$$=$$\\var{h}^2+\\var{v}^2$
$x$$=$$\\sqrt{\\var{h}^2+\\var{v}^2}$
$x$$=$$\\sqrt{\\simplify{{h}^2+{v}^2}}$
$x$$=$$\\var{ans}$
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
$\\var{d}^2$$=$$x^2+\\var{v}^2$
$\\var{d}^2-\\var{v}^2$$=$$x^2$
$\\sqrt{\\var{d}^2-\\var{v}^2}$$=$$x$
$\\sqrt{\\simplify{{d}^2-{v}^2}}$$=$$x$
$\\var{ans}$$=$$x$
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
$\\var{d}^2$$=$$\\var{h}^2+\\var{v}^2$
$\\var{d}^2-\\var{h}^2$$=$$\\var{v}^2$
$\\sqrt{\\var{d}^2-\\var{h}^2}$$=$$\\var{v}$
$\\sqrt{\\simplify{{d}^2-{h}^2}}$$=$$\\var{v}$
$\\var{ans}$$=$$\\var{v}$
\n

Therefore the length of $x$ is $\\var{ans}$.

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"scale": {"name": "scale", "group": "Ungrouped variables", "definition": "24/triples[1]", "description": "", "templateType": "anything", "can_override": false}, "triples": {"name": "triples", "group": "Ungrouped variables", "definition": "random([[3, 4, 5], [5, 12, 13], [7, 24, 25], [8, 15, 17], [9, 40, 41], [11, 60, 61], [12, 35, 37], [16, 63, 65], [20, 21, 29], [20, 99, 101], [24, 143, 145], [28, 45, 53], [33, 56, 65], [36, 77, 85], [39, 80, 89], [44, 117, 125], [48, 55, 73], [51, 140, 149], [52, 165, 173], [57, 176, 185], [60, 91, 109], [60, 221, 229], [65, 72, 97], [68, 285, 293], [69, 260, 269], [75, 308, 317], [76, 357, 365], [84, 187, 205], [84, 437, 445], [85, 132, 157], [87, 416, 425], [88, 105, 137], [92, 525, 533], [93, 476, 485], [95, 168, 193], [96, 247, 265], [100, 621, 629], [104, 153, 185], [105, 208, 233], [105, 608, 617], [111, 680, 689], [115, 252, 277], [119, 120, 169], [120, 209, 241], [120, 391, 409], [132, 475, 493], [133, 156, 205], [135, 352, 377], [136, 273, 305], [140, 171, 221], [145, 408, 433], [152, 345, 377], [155, 468, 493], [156, 667, 685], [160, 231, 281], [161, 240, 289], [165, 532, 557], [168, 425, 457], [168, 775, 793], [175, 288, 337], [180, 299, 349], [184, 513, 545], [185, 672, 697], [189, 340, 389], [195, 748, 773], [200, 609, 641], [203, 396, 445], [204, 253, 325], [205, 828, 853], [207, 224, 305], [215, 912, 937], [216, 713, 745], [217, 456, 505], [220, 459, 509], [225, 272, 353], [228, 325, 397], [231, 520, 569], [232, 825, 857], [240, 551, 601], [248, 945, 977], [252, 275, 373], [259, 660, 709], [260, 651, 701], [261, 380, 461], [273, 736, 785], [276, 493, 565], [279, 440, 521], [280, 351, 449], [280, 759, 809], [287, 816, 865], [297, 304, 425], [300, 589, 661], [301, 900, 949], [308, 435, 533], [315, 572, 653], [319, 360, 481], [333, 644, 725], [336, 377, 505], [336, 527, 625], [341, 420, 541], [348, 805, 877], [364, 627, 725], [368, 465, 593], [369, 800, 881], [372, 925, 997], [385, 552, 673], [387, 884, 965], [396, 403, 565], [400, 561, 689], [407, 624, 745], [420, 851, 949], [429, 460, 629], [429, 700, 821], [432, 665, 793], [451, 780, 901], [455, 528, 697], [464, 777, 905], [468, 595, 757], [473, 864, 985], [481, 600, 769], [504, 703, 865], [533, 756, 925], [540, 629, 829], [555, 572, 797], [580, 741, 941], [615, 728, 953], [616, 663, 905], [696, 697, 985]])\n", "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], [13,84,85], [15,112,113], [16,63,65],
[19,180,181], [20,21,29], [20,99,101],
[23,264,265], [24,143,145], [25,312,313], [27,364,365], [28,45,53],
[28,195,197], [31,480,481], [32,255,257], [33,56,65],
[33,544,545], [35,612,613], [36,77,85], [36,323,325], [37,684,685],
[39,80,89], [40,399,401], [41,840,841], [43,924,925],
[44,117,125], [44,483,485], [48,55,73], [48,575,577], [51,140,149],
[52,165,173], [52,675,677], [56,783,785], [57,176,185], [60,91,109],
[60,221,229], [60,899,901], [65,72,97], [68,285,293], [69,260,269],
[75,308,317], [76,357,365], [84,187,205], [84,437,445], [85,132,157],
[87,416,425], [88,105,137], [92,525,533], [93,476,485], [95,168,193],
[96,247,265], [100,621,629], [104,153,185], [105,208,233], [105,608,617],
[108,725,733], [111,680,689], [115,252,277], [116,837,845], [119,120,169],
[120,209,241], [120,391,409], [123,836,845], [129,920,929],
[132,475,493], [133,156,205], [135,352,377], [136,273,305], [140,171,221],
[145,408,433], [152,345,377], [155,468,493], [156,667,685], [160,231,281],
[161,240,289], [165,532,557], [168,425,457], [168,775,793], [175,288,337],
[180,299,349], [184,513,545], [185,672,697], [189,340,389], [195,748,773],
[200,609,641], [203,396,445], [204,253,325], [205,828,853], [207,224,305],
[215,912,937], [216,713,745], [217,456,505], [220,459,509], [225,272,353],
[228,325,397], [231,520,569], [232,825,857], [240,551,601], [248,945,977],
[252,275,373], [259,660,709], [260,651,701], [261,380,461], [273,736,785],
[276,493,565], [279,440,521], [280,351,449], [280,759,809], [287,816,865],
[297,304,425], [300,589,661], [301,900,949], [308,435,533], [315,572,653],
[319,360,481], [333,644,725], [336,377,505], [336,527,625], [341,420,541],
[348,805,877], [364,627,725], [368,465,593], [369,800,881], [372,925,997],
[385,552,673], [387,884,965], [396,403,565], [400,561,689], [407,624,745],
[420,851,949], [429,460,629], [429,700,821], [432,665,793], [451,780,901],
[455,528,697], [464,777,905], [468,595,757], [473,864,985], [481,600,769],
[504,703,865], [533,756,925], [540,629,829], [555,572,797], [580,741,941],
[615,728,953], [616,663,905], [696,697,985]])

", "templateType": "anything", "can_override": false}, "d": {"name": "d", "group": "Ungrouped variables", "definition": "if(vec1[2]=1,triples[2],'$x$')", "description": "

use https://www.mathsisfun.com/numbers/pythagorean-triples.html

\n

\n

so always integer and scale by k for more randomness.

", "templateType": "anything", "can_override": false}, "deltax": {"name": "deltax", "group": "Ungrouped variables", "definition": "precround(-12+2*triples[1]/triples[0],4)", "description": "", "templateType": "anything", "can_override": false}, "h": {"name": "h", "group": "Ungrouped variables", "definition": "if(vec1[1]=1,triples[1],'$x$')", "description": "", "templateType": "anything", "can_override": false}, "v": {"name": "v", "group": "Ungrouped variables", "definition": "if(vec1[0]=1,triples[0],'$x$')", "description": "", "templateType": "anything", "can_override": false}, "ans": {"name": "ans", "group": "Ungrouped variables", "definition": "if(vec1[0]=0,triples[0],if(vec1[1]=0,triples[1],triples[2]))", "description": "", "templateType": "anything", "can_override": false}, "vec1": {"name": "vec1", "group": "Ungrouped variables", "definition": "shuffle([1,1,0])", "description": "", "templateType": "anything", "can_override": false}, "tritop": {"name": "tritop", "group": "Ungrouped variables", "definition": "precround(triples[0]*scale,4)/2", "description": "

top of triangle for jsxgraph, keeping same ratios.

", "templateType": "anything", "can_override": false}, "switcharoo": {"name": "switcharoo", "group": "Ungrouped variables", "definition": "1random(0,1)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["triples", "vec1", "v", "h", "d", "scale", "tritop", "deltax", "switcharoo", "ans"], "variable_groups": [], "functions": {"otherway": {"parameters": [], "type": "html", "language": "javascript", "definition": "\n\nvar 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\n//JXG.Options.text.display = 'internal';\nJXG.Options.text.useMathJax = true;\n\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/1]], { straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true});\n\n//create the diagonal line\nvar vert = board.create('line',[[12,-TT],[-12,TT/1]], { 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\n\n//display the side lengths\nvar vtext= board.create('text',[-15,0,v], {fontSize:20,fixed: true});\nvar htext= board.create('text',[-2,-TT-1,h], {fontSize:20,fixed: true});\nvar dtext= board.create('text',[-2,TT/2+0.3,d], {fontSize:20,fixed: true});\n\n\n//var tRot = board.create('transform', [Math.PI/2.0, 13,0], {type:'rotate'}); \n//tRot.bindTo(vtext);\n\n\n\n\nreturn div;\n\n"}, "triangle": {"parameters": [], "type": "html", "language": "javascript", "definition": "\n\nvar 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\n//JXG.Options.text.display = 'internal';\nJXG.Options.text.useMathJax = true;\n\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/1]], { straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true});\n\n\n//create the diagonal line\nvar vert = board.create('line',[[-12,-TT],[12,TT/1]], { 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\n\n//display the side lengths\nvar vtext= board.create('text',[12.5,0,v], {fontSize:20,fixed: true});\nvar htext= board.create('text',[0,-TT-1,h], {fontSize:20,fixed: true});\nvar dtext= board.create('text',[0,TT/2+0.3,d], {fontSize:20,fixed: true});\n\n//var tRot = board.create('transform', [Math.PI/2.0, 13,0], {type:'rotate'}); \n//tRot.bindTo(vtext);\n\n\n\n\nreturn div;\n\n"}}, "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": "

Given the triangle described below, the value of $x$ is [[0]] .

\n

{if(switcharoo=0,triangle(),otherway())}

", "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": "ans", "maxValue": "ans", "correctAnswerFraction": true, "allowFractions": true, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "Trigonometry: Right angled: Finding trig ratios", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [["question-resources/undefined_YwBJcjH", "/srv/numbas/media/question-resources/undefined_YwBJcjH"]], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Ben Brawn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/605/"}], "tags": ["epphys", "JSXgraph", "Jsxgraph", "jsxgraph", "trig", "trigonometry", "Trigonometry"], "metadata": {"description": "", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "", "advice": "", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"anglelist": {"name": "anglelist", "group": "Ungrouped variables", "definition": "random(['$\\\\theta$',3],['$\\\\phi$',4])", "description": "", "templateType": "anything", "can_override": false}, "ans1num": {"name": "ans1num", "group": "Ungrouped variables", "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,'error'))))", "description": "", "templateType": "anything", "can_override": false}, "scale": {"name": "scale", "group": "Ungrouped variables", "definition": "24/h", "description": "", "templateType": "anything", "can_override": false}, "triples": {"name": "triples", "group": "Ungrouped variables", "definition": "random([[3, 4, 5], [5, 12, 13], [7, 24, 25], [8, 15, 17], [9, 40, 41], [11, 60, 61], [12, 35, 37], [16, 63, 65], [20, 21, 29], [20, 99, 101], [24, 143, 145], [28, 45, 53], [33, 56, 65], [36, 77, 85], [39, 80, 89], [44, 117, 125], [48, 55, 73], [51, 140, 149], [52, 165, 173], [57, 176, 185], [60, 91, 109], [60, 221, 229], [65, 72, 97], [68, 285, 293], [69, 260, 269], [75, 308, 317], [76, 357, 365], [84, 187, 205], [84, 437, 445], [85, 132, 157], [87, 416, 425], [88, 105, 137], [92, 525, 533], [93, 476, 485], [95, 168, 193], [96, 247, 265], [100, 621, 629], [104, 153, 185], [105, 208, 233], [105, 608, 617], [111, 680, 689], [115, 252, 277], [119, 120, 169], [120, 209, 241], [120, 391, 409], [132, 475, 493], [133, 156, 205], [135, 352, 377], [136, 273, 305], [140, 171, 221], [145, 408, 433], [152, 345, 377], [155, 468, 493], [156, 667, 685], [160, 231, 281], [161, 240, 289], [165, 532, 557], [168, 425, 457], [168, 775, 793], [175, 288, 337], [180, 299, 349], [184, 513, 545], [185, 672, 697], [189, 340, 389], [195, 748, 773], [200, 609, 641], [203, 396, 445], [204, 253, 325], [205, 828, 853], [207, 224, 305], [215, 912, 937], [216, 713, 745], [217, 456, 505], [220, 459, 509], [225, 272, 353], [228, 325, 397], [231, 520, 569], [232, 825, 857], [240, 551, 601], [248, 945, 977], [252, 275, 373], [259, 660, 709], [260, 651, 701], [261, 380, 461], [273, 736, 785], [276, 493, 565], [279, 440, 521], [280, 351, 449], [280, 759, 809], [287, 816, 865], [297, 304, 425], [300, 589, 661], [301, 900, 949], [308, 435, 533], [315, 572, 653], [319, 360, 481], [333, 644, 725], [336, 377, 505], [336, 527, 625], [341, 420, 541], [348, 805, 877], [364, 627, 725], [368, 465, 593], [369, 800, 881], [372, 925, 997], [385, 552, 673], [387, 884, 965], [396, 403, 565], [400, 561, 689], [407, 624, 745], [420, 851, 949], [429, 460, 629], [429, 700, 821], [432, 665, 793], [451, 780, 901], [455, 528, 697], [464, 777, 905], [468, 595, 757], [473, 864, 985], [481, 600, 769], [504, 703, 865], [533, 756, 925], [540, 629, 829], [555, 572, 797], [580, 741, 941], [615, 728, 953], [616, 663, 905], [696, 697, 985]])\n", "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], [13,84,85], [15,112,113], [16,63,65],
[19,180,181], [20,21,29], [20,99,101],
[23,264,265], [24,143,145], [25,312,313], [27,364,365], [28,45,53],
[28,195,197], [31,480,481], [32,255,257], [33,56,65],
[33,544,545], [35,612,613], [36,77,85], [36,323,325], [37,684,685],
[39,80,89], [40,399,401], [41,840,841], [43,924,925],
[44,117,125], [44,483,485], [48,55,73], [48,575,577], [51,140,149],
[52,165,173], [52,675,677], [56,783,785], [57,176,185], [60,91,109],
[60,221,229], [60,899,901], [65,72,97], [68,285,293], [69,260,269],
[75,308,317], [76,357,365], [84,187,205], [84,437,445], [85,132,157],
[87,416,425], [88,105,137], [92,525,533], [93,476,485], [95,168,193],
[96,247,265], [100,621,629], [104,153,185], [105,208,233], [105,608,617],
[108,725,733], [111,680,689], [115,252,277], [116,837,845], [119,120,169],
[120,209,241], [120,391,409], [123,836,845], [129,920,929],
[132,475,493], [133,156,205], [135,352,377], [136,273,305], [140,171,221],
[145,408,433], [152,345,377], [155,468,493], [156,667,685], [160,231,281],
[161,240,289], [165,532,557], [168,425,457], [168,775,793], [175,288,337],
[180,299,349], [184,513,545], [185,672,697], [189,340,389], [195,748,773],
[200,609,641], [203,396,445], [204,253,325], [205,828,853], [207,224,305],
[215,912,937], [216,713,745], [217,456,505], [220,459,509], [225,272,353],
[228,325,397], [231,520,569], [232,825,857], [240,551,601], [248,945,977],
[252,275,373], [259,660,709], [260,651,701], [261,380,461], [273,736,785],
[276,493,565], [279,440,521], [280,351,449], [280,759,809], [287,816,865],
[297,304,425], [300,589,661], [301,900,949], [308,435,533], [315,572,653],
[319,360,481], [333,644,725], [336,377,505], [336,527,625], [341,420,541],
[348,805,877], [364,627,725], [368,465,593], [369,800,881], [372,925,997],
[385,552,673], [387,884,965], [396,403,565], [400,561,689], [407,624,745],
[420,851,949], [429,460,629], [429,700,821], [432,665,793], [451,780,901],
[455,528,697], [464,777,905], [468,595,757], [473,864,985], [481,600,769],
[504,703,865], [533,756,925], [540,629,829], [555,572,797], [580,741,941],
[615,728,953], [616,663,905], [696,697,985]])

", "templateType": "anything", "can_override": false}, "d": {"name": "d", "group": "Ungrouped variables", "definition": "triples[2]", "description": "

use https://www.mathsisfun.com/numbers/pythagorean-triples.html

\n

\n

so always integer and scale by k for more randomness.

", "templateType": "anything", "can_override": false}, "deltax": {"name": "deltax", "group": "Ungrouped variables", "definition": "precround(-12+2*h/v,4)", "description": "", "templateType": "anything", "can_override": false}, "h": {"name": "h", "group": "Ungrouped variables", "definition": "triples[1]", "description": "", "templateType": "anything", "can_override": false}, "question": {"name": "question", "group": "Ungrouped variables", "definition": "ratio[0]", "description": "", "templateType": "anything", "can_override": false}, "ans1den": {"name": "ans1den", "group": "Ungrouped variables", "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,'error'))))", "description": "", "templateType": "anything", "can_override": false}, "v": {"name": "v", "group": "Ungrouped variables", "definition": "triples[0]", "description": "", "templateType": "anything", "can_override": false}, "ratio": {"name": "ratio", "group": "Ungrouped variables", "definition": "random(['$\\\\sin(\\\\var{angle})$',0],['$\\\\cos(\\\\var{angle})$',1],['$\\\\tan(\\\\var{angle})$',2])", "description": "", "templateType": "anything", "can_override": false}, "angle": {"name": "angle", "group": "Ungrouped variables", "definition": "anglelist[0]", "description": "", "templateType": "anything", "can_override": false}, "tritop": {"name": "tritop", "group": "Ungrouped variables", "definition": "precround(v*scale,4)/2", "description": "

top of triangle for jsxgraph, keeping same ratios.

", "templateType": "anything", "can_override": false}, "switcharoo": {"name": "switcharoo", "group": "Ungrouped variables", "definition": "random(0,1)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["triples", "v", "h", "d", "anglelist", "angle", "ratio", "question", "ans1num", "ans1den", "scale", "tritop", "deltax", "switcharoo"], "variable_groups": [], "functions": {"otherway": {"parameters": [], "type": "html", "language": "javascript", "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/1]], { straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true});\n\n//create the diagonal line\nvar vert = board.create('line',[[12,-TT],[-12,TT/1]], { 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,1*v+' m'], {fontSize:20,fixed: true});\nvar htext= board.create('text',[-2,-TT-1,1*h+' m'], {fontSize:20,fixed: true});\nvar dtext= board.create('text',[-2,TT/2+0.3,1*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"}, "triangle": {"parameters": [], "type": "html", "language": "javascript", "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/1]], { straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true});\n\n//create the vertical line\nvar vert = board.create('line',[[12,-TT],[12,TT/1]], { straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true});\n\n//create the diagonal line\nvar vert = board.create('line',[[-12,-TT],[12,TT/1]], { 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"}}, "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": "

{if(switcharoo=0,triangle(),otherway())}

\n

Given the triangle described above, the value of {question} is [[0]].

", "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": "{ans1num}/{ans1den}", "maxValue": "{ans1num}/{ans1den}", "correctAnswerFraction": true, "allowFractions": true, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "Trigonometry: Right angled: Finding reciprocal trig ratios", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [["question-resources/undefined_YwBJcjH", "/srv/numbas/media/question-resources/undefined_YwBJcjH"]], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Ben Brawn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/605/"}], "tags": ["epphys", "JSXgraph", "Jsxgraph", "jsxgraph", "trig", "trigonometry", "Trigonometry"], "metadata": {"description": "", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "", "advice": "", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"anglelist": {"name": "anglelist", "group": "Ungrouped variables", "definition": "random(['$\\\\theta$',3],['$\\\\phi$',4])", "description": "", "templateType": "anything", "can_override": false}, "ans1recden": {"name": "ans1recden", "group": "Ungrouped variables", "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,1))))", "description": "", "templateType": "anything", "can_override": false}, "scale": {"name": "scale", "group": "Ungrouped variables", "definition": "24/h", "description": "", "templateType": "anything", "can_override": false}, "triples": {"name": "triples", "group": "Ungrouped variables", "definition": "random([[3, 4, 5], [5, 12, 13], [7, 24, 25], [8, 15, 17], [9, 40, 41], [11, 60, 61], [12, 35, 37], [16, 63, 65], [20, 21, 29], [20, 99, 101], [24, 143, 145], [28, 45, 53], [33, 56, 65], [36, 77, 85], [39, 80, 89], [44, 117, 125], [48, 55, 73], [51, 140, 149], [52, 165, 173], [57, 176, 185], [60, 91, 109], [60, 221, 229], [65, 72, 97], [68, 285, 293], [69, 260, 269], [75, 308, 317], [76, 357, 365], [84, 187, 205], [84, 437, 445], [85, 132, 157], [87, 416, 425], [88, 105, 137], [92, 525, 533], [93, 476, 485], [95, 168, 193], [96, 247, 265], [100, 621, 629], [104, 153, 185], [105, 208, 233], [105, 608, 617], [111, 680, 689], [115, 252, 277], [119, 120, 169], [120, 209, 241], [120, 391, 409], [132, 475, 493], [133, 156, 205], [135, 352, 377], [136, 273, 305], [140, 171, 221], [145, 408, 433], [152, 345, 377], [155, 468, 493], [156, 667, 685], [160, 231, 281], [161, 240, 289], [165, 532, 557], [168, 425, 457], [168, 775, 793], [175, 288, 337], [180, 299, 349], [184, 513, 545], [185, 672, 697], [189, 340, 389], [195, 748, 773], [200, 609, 641], [203, 396, 445], [204, 253, 325], [205, 828, 853], [207, 224, 305], [215, 912, 937], [216, 713, 745], [217, 456, 505], [220, 459, 509], [225, 272, 353], [228, 325, 397], [231, 520, 569], [232, 825, 857], [240, 551, 601], [248, 945, 977], [252, 275, 373], [259, 660, 709], [260, 651, 701], [261, 380, 461], [273, 736, 785], [276, 493, 565], [279, 440, 521], [280, 351, 449], [280, 759, 809], [287, 816, 865], [297, 304, 425], [300, 589, 661], [301, 900, 949], [308, 435, 533], [315, 572, 653], [319, 360, 481], [333, 644, 725], [336, 377, 505], [336, 527, 625], [341, 420, 541], [348, 805, 877], [364, 627, 725], [368, 465, 593], [369, 800, 881], [372, 925, 997], [385, 552, 673], [387, 884, 965], [396, 403, 565], [400, 561, 689], [407, 624, 745], [420, 851, 949], [429, 460, 629], [429, 700, 821], [432, 665, 793], [451, 780, 901], [455, 528, 697], [464, 777, 905], [468, 595, 757], [473, 864, 985], [481, 600, 769], [504, 703, 865], [533, 756, 925], [540, 629, 829], [555, 572, 797], [580, 741, 941], [615, 728, 953], [616, 663, 905], [696, 697, 985]])\n", "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], [13,84,85], [15,112,113], [16,63,65],
[19,180,181], [20,21,29], [20,99,101],
[23,264,265], [24,143,145], [25,312,313], [27,364,365], [28,45,53],
[28,195,197], [31,480,481], [32,255,257], [33,56,65],
[33,544,545], [35,612,613], [36,77,85], [36,323,325], [37,684,685],
[39,80,89], [40,399,401], [41,840,841], [43,924,925],
[44,117,125], [44,483,485], [48,55,73], [48,575,577], [51,140,149],
[52,165,173], [52,675,677], [56,783,785], [57,176,185], [60,91,109],
[60,221,229], [60,899,901], [65,72,97], [68,285,293], [69,260,269],
[75,308,317], [76,357,365], [84,187,205], [84,437,445], [85,132,157],
[87,416,425], [88,105,137], [92,525,533], [93,476,485], [95,168,193],
[96,247,265], [100,621,629], [104,153,185], [105,208,233], [105,608,617],
[108,725,733], [111,680,689], [115,252,277], [116,837,845], [119,120,169],
[120,209,241], [120,391,409], [123,836,845], [129,920,929],
[132,475,493], [133,156,205], [135,352,377], [136,273,305], [140,171,221],
[145,408,433], [152,345,377], [155,468,493], [156,667,685], [160,231,281],
[161,240,289], [165,532,557], [168,425,457], [168,775,793], [175,288,337],
[180,299,349], [184,513,545], [185,672,697], [189,340,389], [195,748,773],
[200,609,641], [203,396,445], [204,253,325], [205,828,853], [207,224,305],
[215,912,937], [216,713,745], [217,456,505], [220,459,509], [225,272,353],
[228,325,397], [231,520,569], [232,825,857], [240,551,601], [248,945,977],
[252,275,373], [259,660,709], [260,651,701], [261,380,461], [273,736,785],
[276,493,565], [279,440,521], [280,351,449], [280,759,809], [287,816,865],
[297,304,425], [300,589,661], [301,900,949], [308,435,533], [315,572,653],
[319,360,481], [333,644,725], [336,377,505], [336,527,625], [341,420,541],
[348,805,877], [364,627,725], [368,465,593], [369,800,881], [372,925,997],
[385,552,673], [387,884,965], [396,403,565], [400,561,689], [407,624,745],
[420,851,949], [429,460,629], [429,700,821], [432,665,793], [451,780,901],
[455,528,697], [464,777,905], [468,595,757], [473,864,985], [481,600,769],
[504,703,865], [533,756,925], [540,629,829], [555,572,797], [580,741,941],
[615,728,953], [616,663,905], [696,697,985]])

", "templateType": "anything", "can_override": false}, "d": {"name": "d", "group": "Ungrouped variables", "definition": "triples[2]", "description": "

use https://www.mathsisfun.com/numbers/pythagorean-triples.html

\n

\n

so always integer and scale by k for more randomness.

", "templateType": "anything", "can_override": false}, "deltax": {"name": "deltax", "group": "Ungrouped variables", "definition": "precround(-12+2*h/v,4)", "description": "", "templateType": "anything", "can_override": false}, "h": {"name": "h", "group": "Ungrouped variables", "definition": "triples[1]", "description": "", "templateType": "anything", "can_override": false}, "question": {"name": "question", "group": "Ungrouped variables", "definition": "ratio[0]", "description": "", "templateType": "anything", "can_override": false}, "ans1recnum": {"name": "ans1recnum", "group": "Ungrouped variables", "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,1))))", "description": "", "templateType": "anything", "can_override": false}, "v": {"name": "v", "group": "Ungrouped variables", "definition": "triples[0]", "description": "", "templateType": "anything", "can_override": false}, "ratio": {"name": "ratio", "group": "Ungrouped variables", "definition": "random(['$\\\\csc(\\\\var{angle})$',0],['$\\\\sec(\\\\var{angle})$',1],['$\\\\cot(\\\\var{angle})$',2])", "description": "", "templateType": "anything", "can_override": false}, "angle": {"name": "angle", "group": "Ungrouped variables", "definition": "anglelist[0]", "description": "", "templateType": "anything", "can_override": false}, "tritop": {"name": "tritop", "group": "Ungrouped variables", "definition": "precround(v*scale,4)/2", "description": "

top of triangle for jsxgraph, keeping same ratios.

", "templateType": "anything", "can_override": false}, "switcharoo": {"name": "switcharoo", "group": "Ungrouped variables", "definition": "random(0,1)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["triples", "v", "h", "d", "anglelist", "angle", "ratio", "question", "ans1recden", "ans1recnum", "scale", "tritop", "deltax", "switcharoo"], "variable_groups": [], "functions": {"otherway": {"parameters": [], "type": "html", "language": "javascript", "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*1]], { straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true});\n\n//create the diagonal line\nvar vert = board.create('line',[[12,-TT],[-12,TT*1]], { 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"}, "triangle": {"parameters": [], "type": "html", "language": "javascript", "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*1]], { straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true});\n\n//create the diagonal line\nvar vert = board.create('line',[[-12,-TT],[12,TT*1]], { 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"}}, "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": "

{if(switcharoo=0,triangle(),otherway())}

\n

Given the triangle described above, the value of {question} is [[0]].

", "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": "{ans1recnum}/{ans1recden}", "maxValue": "{ans1recnum}/{ans1recden}", "correctAnswerFraction": true, "allowFractions": true, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "Trigonometry: Right angled: Find exact angles", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [["question-resources/undefined_YwBJcjH", "/srv/numbas/media/question-resources/undefined_YwBJcjH"]], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Ben Brawn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/605/"}], "tags": ["epphys", "JSXgraph", "Jsxgraph", "jsxgraph", "Triangle", "triangle", "trig", "trigonometry"], "metadata": {"description": "", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "", "advice": "", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"anglelist": {"name": "anglelist", "group": "Ungrouped variables", "definition": "random(['$\\\\theta$',3],['$\\\\phi$',4])", "description": "", "templateType": "anything", "can_override": false}, "scale": {"name": "scale", "group": "Ungrouped variables", "definition": "24/triples[1]", "description": "", "templateType": "anything", "can_override": false}, "triples": {"name": "triples", "group": "Ungrouped variables", "definition": "random([[3, 4, 5], [5, 12, 13], [7, 24, 25], [8, 15, 17], [9, 40, 41], [11, 60, 61], [12, 35, 37], [16, 63, 65], [20, 21, 29], [20, 99, 101], [24, 143, 145], [28, 45, 53], [33, 56, 65], [36, 77, 85], [39, 80, 89], [44, 117, 125], [48, 55, 73], [51, 140, 149], [52, 165, 173], [57, 176, 185], [60, 91, 109], [60, 221, 229], [65, 72, 97], [68, 285, 293], [69, 260, 269], [75, 308, 317], [76, 357, 365], [84, 187, 205], [84, 437, 445], [85, 132, 157], [87, 416, 425], [88, 105, 137], [92, 525, 533], [93, 476, 485], [95, 168, 193], [96, 247, 265], [100, 621, 629], [104, 153, 185], [105, 208, 233], [105, 608, 617], [111, 680, 689], [115, 252, 277], [119, 120, 169], [120, 209, 241], [120, 391, 409], [132, 475, 493], [133, 156, 205], [135, 352, 377], [136, 273, 305], [140, 171, 221], [145, 408, 433], [152, 345, 377], [155, 468, 493], [156, 667, 685], [160, 231, 281], [161, 240, 289], [165, 532, 557], [168, 425, 457], [168, 775, 793], [175, 288, 337], [180, 299, 349], [184, 513, 545], [185, 672, 697], [189, 340, 389], [195, 748, 773], [200, 609, 641], [203, 396, 445], [204, 253, 325], [205, 828, 853], [207, 224, 305], [215, 912, 937], [216, 713, 745], [217, 456, 505], [220, 459, 509], [225, 272, 353], [228, 325, 397], [231, 520, 569], [232, 825, 857], [240, 551, 601], [248, 945, 977], [252, 275, 373], [259, 660, 709], [260, 651, 701], [261, 380, 461], [273, 736, 785], [276, 493, 565], [279, 440, 521], [280, 351, 449], [280, 759, 809], [287, 816, 865], [297, 304, 425], [300, 589, 661], [301, 900, 949], [308, 435, 533], [315, 572, 653], [319, 360, 481], [333, 644, 725], [336, 377, 505], [336, 527, 625], [341, 420, 541], [348, 805, 877], [364, 627, 725], [368, 465, 593], [369, 800, 881], [372, 925, 997], [385, 552, 673], [387, 884, 965], [396, 403, 565], [400, 561, 689], [407, 624, 745], [420, 851, 949], [429, 460, 629], [429, 700, 821], [432, 665, 793], [451, 780, 901], [455, 528, 697], [464, 777, 905], [468, 595, 757], [473, 864, 985], [481, 600, 769], [504, 703, 865], [533, 756, 925], [540, 629, 829], [555, 572, 797], [580, 741, 941], [615, 728, 953], [616, 663, 905], [696, 697, 985]])\n", "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], [13,84,85], [15,112,113], [16,63,65],
[19,180,181], [20,21,29], [20,99,101],
[23,264,265], [24,143,145], [25,312,313], [27,364,365], [28,45,53],
[28,195,197], [31,480,481], [32,255,257], [33,56,65],
[33,544,545], [35,612,613], [36,77,85], [36,323,325], [37,684,685],
[39,80,89], [40,399,401], [41,840,841], [43,924,925],
[44,117,125], [44,483,485], [48,55,73], [48,575,577], [51,140,149],
[52,165,173], [52,675,677], [56,783,785], [57,176,185], [60,91,109],
[60,221,229], [60,899,901], [65,72,97], [68,285,293], [69,260,269],
[75,308,317], [76,357,365], [84,187,205], [84,437,445], [85,132,157],
[87,416,425], [88,105,137], [92,525,533], [93,476,485], [95,168,193],
[96,247,265], [100,621,629], [104,153,185], [105,208,233], [105,608,617],
[108,725,733], [111,680,689], [115,252,277], [116,837,845], [119,120,169],
[120,209,241], [120,391,409], [123,836,845], [129,920,929],
[132,475,493], [133,156,205], [135,352,377], [136,273,305], [140,171,221],
[145,408,433], [152,345,377], [155,468,493], [156,667,685], [160,231,281],
[161,240,289], [165,532,557], [168,425,457], [168,775,793], [175,288,337],
[180,299,349], [184,513,545], [185,672,697], [189,340,389], [195,748,773],
[200,609,641], [203,396,445], [204,253,325], [205,828,853], [207,224,305],
[215,912,937], [216,713,745], [217,456,505], [220,459,509], [225,272,353],
[228,325,397], [231,520,569], [232,825,857], [240,551,601], [248,945,977],
[252,275,373], [259,660,709], [260,651,701], [261,380,461], [273,736,785],
[276,493,565], [279,440,521], [280,351,449], [280,759,809], [287,816,865],
[297,304,425], [300,589,661], [301,900,949], [308,435,533], [315,572,653],
[319,360,481], [333,644,725], [336,377,505], [336,527,625], [341,420,541],
[348,805,877], [364,627,725], [368,465,593], [369,800,881], [372,925,997],
[385,552,673], [387,884,965], [396,403,565], [400,561,689], [407,624,745],
[420,851,949], [429,460,629], [429,700,821], [432,665,793], [451,780,901],
[455,528,697], [464,777,905], [468,595,757], [473,864,985], [481,600,769],
[504,703,865], [533,756,925], [540,629,829], [555,572,797], [580,741,941],
[615,728,953], [616,663,905], [696,697,985]])

", "templateType": "anything", "can_override": false}, "d": {"name": "d", "group": "Ungrouped variables", "definition": "if(vec1[2]=1,triples[2],'')", "description": "

use https://www.mathsisfun.com/numbers/pythagorean-triples.html

\n

\n

so always integer and scale by k for more randomness.

", "templateType": "anything", "can_override": false}, "deltax": {"name": "deltax", "group": "Ungrouped variables", "definition": "precround(-12+2*triples[1]/triples[0],4)", "description": "", "templateType": "anything", "can_override": false}, "h": {"name": "h", "group": "Ungrouped variables", "definition": "if(vec1[1]=1,triples[1],'')", "description": "", "templateType": "anything", "can_override": false}, "vec1": {"name": "vec1", "group": "Ungrouped variables", "definition": "shuffle([1,1,0])", "description": "", "templateType": "anything", "can_override": false}, "v": {"name": "v", "group": "Ungrouped variables", "definition": "if(vec1[0]=1,triples[0],'')", "description": "", "templateType": "anything", "can_override": false}, "ans": {"name": "ans", "group": "Ungrouped variables", "definition": "if(anglelist[1]=3,if(vec1[0]=0, arccos(h/d),if(vec1[1]=0,arcsin(v/d),arctan(v/h))),\nif(vec1[0]=0, arcsin(h/d),if(vec1[1]=0,arccos(v/d),arctan(h/v))))", "description": "", "templateType": "anything", "can_override": false}, "angle": {"name": "angle", "group": "Ungrouped variables", "definition": "anglelist[0]", "description": "", "templateType": "anything", "can_override": false}, "tritop": {"name": "tritop", "group": "Ungrouped variables", "definition": "precround(triples[0]*scale,4)/2", "description": "

top of triangle for jsxgraph, keeping same ratios.

", "templateType": "anything", "can_override": false}, "switcharoo": {"name": "switcharoo", "group": "Ungrouped variables", "definition": "random(0,1)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["triples", "vec1", "v", "h", "d", "scale", "tritop", "deltax", "switcharoo", "ans", "anglelist", "angle"], "variable_groups": [], "functions": {"otherway": {"parameters": [], "type": "html", "language": "javascript", "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*1]], { straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true});\n\n//create the diagonal line\nvar vert = board.create('line',[[12,-TT],[-12,TT*1]], { 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//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//display the side lengths\nvar vtext= board.create('text',[-15,0,v], {fontSize:20,fixed: true});\nvar htext= board.create('text',[-2,-TT-1,h], {fontSize:20,fixed: true});\nvar dtext= board.create('text',[-2,TT/2+0.3,d], {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"}, "triangle": {"parameters": [], "type": "html", "language": "javascript", "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*1]], { straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true});\n\n//create the diagonal line\nvar vert = board.create('line',[[-12,-TT],[12,TT*1]], { 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//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//display the side lengths\nvar vtext= board.create('text',[12.5,0,v], {fontSize:20,fixed: true});\nvar htext= board.create('text',[0,-TT-1,h], {fontSize:20,fixed: true});\nvar dtext= board.create('text',[0,TT/2+0.3,d], {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"}}, "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": "

{if(switcharoo=0,triangle(),otherway())}

\n

Given the triangle described above, the exact value of {angle} is [[0]] $^\\circ$.

\n

Note: to input an inverse trig function type 'arc' infront of the trig function, that is, $\\sin^{-1}(x)=\\mathrm{arcsin}(x)$. 

", "gaps": [{"type": "jme", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": false, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "answer": "{ans}", "showPreview": true, "checkingType": "absdiff", "checkingAccuracy": 0.001, "failureRate": 1, "vsetRangePoints": 5, "vsetRange": [0, 1], "checkVariableNames": false, "singleLetterVariables": false, "allowUnknownFunctions": true, "implicitFunctionComposition": false, "caseSensitive": false, "valuegenerators": []}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "Trigonometry: Right angled: Find angles to nearest degree", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [["question-resources/undefined_YwBJcjH", "/srv/numbas/media/question-resources/undefined_YwBJcjH"]], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Ben Brawn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/605/"}], "tags": ["epphys", "JSXgraph", "Jsxgraph", "jsxgraph", "Triangle", "triangle", "trig", "trigonometry", "Trigonometry"], "metadata": {"description": "", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "", "advice": "

Based on the sides that we have and the angle we are interested in we use

\n

$\\sin \\theta = \\dfrac{\\text{opposite}}{\\text{hypotenuse}}$ $\\cos \\theta = \\dfrac{\\text{adjacent}}{\\text{hypotenuse}}$ $\\tan \\theta = \\dfrac{\\text{opposite}}{\\text{adjacent}}$$\\sin \\phi = \\dfrac{\\text{opposite}}{\\text{hypotenuse}}$ $\\cos \\phi = \\dfrac{\\text{adjacent}}{\\text{hypotenuse}}$ $\\tan \\phi = \\dfrac{\\text{opposite}}{\\text{adjacent}}$

\n

and substitute in the values that we have

\n

$\\sin \\var{anglelist[0]} = \\dfrac{\\var{v}}{\\var{d}}$. $\\cos \\var{anglelist[0]} = \\dfrac{\\var{h}}{\\var{d}}$. $\\tan \\var{anglelist[0]}= \\dfrac{\\var{v}}{\\var{h}}$. $\\sin \\var{anglelist[0]} = \\dfrac{\\var{h}}{\\var{d}}$. $\\cos \\var{anglelist[0]} = \\dfrac{\\var{v}}{\\var{d}}$. $\\tan \\var{anglelist[0]}= \\dfrac{\\var{h}}{\\var{v}}$.

\n

To solve this equation for {anglelist[0]} we apply the inverse trig function to both sides to get

\n

$\\var{anglelist[0]} = \\sin^{-1}\\left(\\dfrac{\\var{v}}{\\var{d}}\\right)$. $\\var{anglelist[0]} = \\cos^{-1}\\left(\\dfrac{\\var{h}}{\\var{d}}\\right)$. $\\var{anglelist[0]}= \\tan^{-1}\\left(\\dfrac{\\var{v}}{\\var{h}}\\right)$. $\\var{anglelist[0]} = \\sin^{-1}\\left(\\dfrac{\\var{h}}{\\var{d}}\\right)$. $\\var{anglelist[0]} = \\cos^{-1}\\left(\\dfrac{\\var{v}}{\\var{d}}\\right)$. $\\var{anglelist[0]}= \\tan^{-1}\\left(\\dfrac{\\var{h}}{\\var{v}}\\right)$.

\n

A calculator (in degrees mode) evaluates this as $\\var{precround(ans,8)}\\ldots^\\circ$ which we round to the nearest degree as $\\var{precround(ans,0)}^\\circ$.

\n

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"anglelist": {"name": "anglelist", "group": "Ungrouped variables", "definition": "random(['$\\\\theta$',3],['$\\\\phi$',4])", "description": "", "templateType": "anything", "can_override": false}, "scale": {"name": "scale", "group": "Ungrouped variables", "definition": "24/triples[1]", "description": "", "templateType": "anything", "can_override": false}, "triples": {"name": "triples", "group": "Ungrouped variables", "definition": "random([[3, 4, 5], [5, 12, 13], [7, 24, 25], [8, 15, 17], [9, 40, 41], [11, 60, 61], [12, 35, 37], [16, 63, 65], [20, 21, 29], [20, 99, 101], [24, 143, 145], [28, 45, 53], [33, 56, 65], [36, 77, 85], [39, 80, 89], [44, 117, 125], [48, 55, 73], [51, 140, 149], [52, 165, 173], [57, 176, 185], [60, 91, 109], [60, 221, 229], [65, 72, 97], [68, 285, 293], [69, 260, 269], [75, 308, 317], [76, 357, 365], [84, 187, 205], [84, 437, 445], [85, 132, 157], [87, 416, 425], [88, 105, 137], [92, 525, 533], [93, 476, 485], [95, 168, 193], [96, 247, 265], [100, 621, 629], [104, 153, 185], [105, 208, 233], [105, 608, 617], [111, 680, 689], [115, 252, 277], [119, 120, 169], [120, 209, 241], [120, 391, 409], [132, 475, 493], [133, 156, 205], [135, 352, 377], [136, 273, 305], [140, 171, 221], [145, 408, 433], [152, 345, 377], [155, 468, 493], [156, 667, 685], [160, 231, 281], [161, 240, 289], [165, 532, 557], [168, 425, 457], [168, 775, 793], [175, 288, 337], [180, 299, 349], [184, 513, 545], [185, 672, 697], [189, 340, 389], [195, 748, 773], [200, 609, 641], [203, 396, 445], [204, 253, 325], [205, 828, 853], [207, 224, 305], [215, 912, 937], [216, 713, 745], [217, 456, 505], [220, 459, 509], [225, 272, 353], [228, 325, 397], [231, 520, 569], [232, 825, 857], [240, 551, 601], [248, 945, 977], [252, 275, 373], [259, 660, 709], [260, 651, 701], [261, 380, 461], [273, 736, 785], [276, 493, 565], [279, 440, 521], [280, 351, 449], [280, 759, 809], [287, 816, 865], [297, 304, 425], [300, 589, 661], [301, 900, 949], [308, 435, 533], [315, 572, 653], [319, 360, 481], [333, 644, 725], [336, 377, 505], [336, 527, 625], [341, 420, 541], [348, 805, 877], [364, 627, 725], [368, 465, 593], [369, 800, 881], [372, 925, 997], [385, 552, 673], [387, 884, 965], [396, 403, 565], [400, 561, 689], [407, 624, 745], [420, 851, 949], [429, 460, 629], [429, 700, 821], [432, 665, 793], [451, 780, 901], [455, 528, 697], [464, 777, 905], [468, 595, 757], [473, 864, 985], [481, 600, 769], [504, 703, 865], [533, 756, 925], [540, 629, 829], [555, 572, 797], [580, 741, 941], [615, 728, 953], [616, 663, 905], [696, 697, 985]])\n", "description": "

Some the following were too skinny and so were removed.

use https://www.mathsisfun.com/numbers/pythagorean-triples.html

\n


random([[3,4,5], [5,12,13], [7,24,25], [8,15,17], [9,40,41],
[11,60,61], [12,35,37], [13,84,85], [15,112,113], [16,63,65],
[19,180,181], [20,21,29], [20,99,101],
[23,264,265], [24,143,145], [25,312,313], [27,364,365], [28,45,53],
[28,195,197], [31,480,481], [32,255,257], [33,56,65],
[33,544,545], [35,612,613], [36,77,85], [36,323,325], [37,684,685],
[39,80,89], [40,399,401], [41,840,841], [43,924,925],
[44,117,125], [44,483,485], [48,55,73], [48,575,577], [51,140,149],
[52,165,173], [52,675,677], [56,783,785], [57,176,185], [60,91,109],
[60,221,229], [60,899,901], [65,72,97], [68,285,293], [69,260,269],
[75,308,317], [76,357,365], [84,187,205], [84,437,445], [85,132,157],
[87,416,425], [88,105,137], [92,525,533], [93,476,485], [95,168,193],
[96,247,265], [100,621,629], [104,153,185], [105,208,233], [105,608,617],
[108,725,733], [111,680,689], [115,252,277], [116,837,845], [119,120,169],
[120,209,241], [120,391,409], [123,836,845], [129,920,929],
[132,475,493], [133,156,205], [135,352,377], [136,273,305], [140,171,221],
[145,408,433], [152,345,377], [155,468,493], [156,667,685], [160,231,281],
[161,240,289], [165,532,557], [168,425,457], [168,775,793], [175,288,337],
[180,299,349], [184,513,545], [185,672,697], [189,340,389], [195,748,773],
[200,609,641], [203,396,445], [204,253,325], [205,828,853], [207,224,305],
[215,912,937], [216,713,745], [217,456,505], [220,459,509], [225,272,353],
[228,325,397], [231,520,569], [232,825,857], [240,551,601], [248,945,977],
[252,275,373], [259,660,709], [260,651,701], [261,380,461], [273,736,785],
[276,493,565], [279,440,521], [280,351,449], [280,759,809], [287,816,865],
[297,304,425], [300,589,661], [301,900,949], [308,435,533], [315,572,653],
[319,360,481], [333,644,725], [336,377,505], [336,527,625], [341,420,541],
[348,805,877], [364,627,725], [368,465,593], [369,800,881], [372,925,997],
[385,552,673], [387,884,965], [396,403,565], [400,561,689], [407,624,745],
[420,851,949], [429,460,629], [429,700,821], [432,665,793], [451,780,901],
[455,528,697], [464,777,905], [468,595,757], [473,864,985], [481,600,769],
[504,703,865], [533,756,925], [540,629,829], [555,572,797], [580,741,941],
[615,728,953], [616,663,905], [696,697,985]])

", "templateType": "anything", "can_override": false}, "d": {"name": "d", "group": "Ungrouped variables", "definition": "if(vec1[2]=1,triples[2],'')", "description": "

diagonal length

", "templateType": "anything", "can_override": false}, "deltax": {"name": "deltax", "group": "Ungrouped variables", "definition": "precround(-12+2*triples[1]/triples[0],4)", "description": "", "templateType": "anything", "can_override": false}, "h": {"name": "h", "group": "Ungrouped variables", "definition": "if(vec1[1]=1,triples[1],'')", "description": "

horizontal length

", "templateType": "anything", "can_override": false}, "vec1": {"name": "vec1", "group": "Ungrouped variables", "definition": "shuffle([1,1,0])", "description": "

(v,h,d) 1 means displayed/given in question, 0 means not

", "templateType": "anything", "can_override": false}, "ansrad": {"name": "ansrad", "group": "Ungrouped variables", "definition": "if(anglelist[1]=3,if(vec1[0]=0, arccos(h/d),if(vec1[1]=0,arcsin(v/d),arctan(v/h))),\nif(vec1[0]=0, arcsin(h/d),if(vec1[1]=0,arccos(v/d),arctan(h/v))))", "description": "", "templateType": "anything", "can_override": false}, "ans": {"name": "ans", "group": "Ungrouped variables", "definition": "ansrad*180/(pi)", "description": "", "templateType": "anything", "can_override": false}, "v": {"name": "v", "group": "Ungrouped variables", "definition": "if(vec1[0]=1,triples[0],'')", "description": "

vertical length

", "templateType": "anything", "can_override": false}, "angle": {"name": "angle", "group": "Ungrouped variables", "definition": "anglelist[0]", "description": "", "templateType": "anything", "can_override": false}, "tritop": {"name": "tritop", "group": "Ungrouped variables", "definition": "precround(triples[0]*scale,4)/2", "description": "

top of triangle for jsxgraph, keeping same ratios.

", "templateType": "anything", "can_override": false}, "switcharoo": {"name": "switcharoo", "group": "Ungrouped variables", "definition": "random(0,1)", "description": "

determines whether the triangle is displayed pointing left or right

", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["triples", "vec1", "v", "h", "d", "scale", "switcharoo", "tritop", "deltax", "ansrad", "anglelist", "angle", "ans"], "variable_groups": [], "functions": {"otherway": {"parameters": [], "type": "html", "language": "javascript", "definition": "var div = Numbas.extensions.jsxgraph.makeBoard('500px','500px',{boundingBox:[-17,17,14,-14],grid:false,axis:false});\nvar board = div.board;\n\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*1]], { straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true});\n\n//create the diagonal line\nvar vert = board.create('line',[[12,-TT],[-12,TT*1]], { 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//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//display the side lengths\nvar vtext= board.create('text',[-15,0,v], {fontSize:20,fixed: true});\nvar htext= board.create('text',[-2,-TT-1,h], {fontSize:20,fixed: true});\nvar dtext= board.create('text',[-2,TT/2+0.3,d], {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"}, "triangle": {"parameters": [], "type": "html", "language": "javascript", "definition": "var div = Numbas.extensions.jsxgraph.makeBoard('500px','500px',{boundingBox:[-13,13,17,-17],grid:false,axis:false});\nvar board = div.board;\n\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*1]], { straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true});\n\n//create the diagonal line\nvar vert = board.create('line',[[-12,-TT],[12,TT*1]], { 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//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//display the side lengths\nvar vtext= board.create('text',[12.5,0,v], {fontSize:20,fixed: true});\nvar htext= board.create('text',[0,-TT-1,h], {fontSize:20,fixed: true});\nvar dtext= board.create('text',[0,TT/2+0.3,d], {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"}}, "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": "

Given the triangle described below, the value of {angle} is [[0]]$^\\circ$ (to the nearest degree).

\n

{if(switcharoo=0,triangle(),otherway())}

\n

\n

", "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": "ans", "maxValue": "ans", "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}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}, {"name": "Trigonometry: Right angled: Find approx side lengths", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [["question-resources/undefined_YwBJcjH", "/srv/numbas/media/question-resources/undefined_YwBJcjH"]], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Ben Brawn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/605/"}], "tags": ["epphys", "JSXgraph", "Jsxgraph", "jsxgraph", "Triangle", "triangle", "trig", "trigonometry", "Trigonometry"], "metadata": {"description": "

A right-angled triangle is displayed either pointing left or right with one of the other angles and one of the sides given. Use SOH CAH TOA to find the side indicated with an x.

", "licence": "Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International"}, "statement": "", "advice": "

Based on the sides that we have and are interested in we use

\n

$\\sin \\theta = \\dfrac{\\text{opposite}}{\\text{hypotenuse}}$ $\\cos \\theta = \\dfrac{\\text{adjacent}}{\\text{hypotenuse}}$ $\\tan \\theta = \\dfrac{\\text{opposite}}{\\text{adjacent}}$

\n

and substitute in the values that we have

\n

$\\sin \\var{anglelist[0]}^\\circ = \\dfrac{\\var{v}}{\\var{d}}$. $\\cos \\var{anglelist[0]}^\\circ = \\dfrac{\\var{h}}{\\var{d}}$. $\\tan \\var{anglelist[0]}^\\circ= \\dfrac{\\var{v}}{\\var{h}}$. $\\sin \\var{anglelist[0]}^\\circ = \\dfrac{\\var{h}}{\\var{d}}$. $\\cos \\var{anglelist[0]}^\\circ = \\dfrac{\\var{v}}{\\var{d}}$. $\\tan \\var{anglelist[0]}^\\circ= \\dfrac{\\var{h}}{\\var{v}}$.

\n

To solve this equation for $x$ we multiply both sides of the equation by the denominator. To solve this equation for $x$ we multiply both sides of the equation by the denominator and then divide both sides of the equation by the trig term.

\n

$x=\\dfrac{\\var{h}}{\\cos \\var{anglelist[0]}^\\circ}$ $x=\\var{d}\\cos \\var{anglelist[0]}^\\circ$ $x=\\dfrac{\\var{v}}{\\sin \\var{anglelist[0]}^\\circ}$ $x=\\dfrac{\\var{v}}{\\tan \\var{anglelist[0]}^\\circ}$ $x=\\var{d}\\sin \\var{anglelist[0]}^\\circ$ $x=\\var{h}\\tan \\var{anglelist[0]}^\\circ$

\n

$x=\\dfrac{\\var{h}}{\\sin \\var{anglelist[0]}^\\circ}$ $x=\\var{d}\\sin \\var{anglelist[0]}^\\circ$ $x=\\dfrac{\\var{v}}{\\cos \\var{anglelist[0]}^\\circ}$ $x=\\var{v}\\tan \\var{anglelist[0]}^\\circ$ $x=\\var{d}\\cos \\var{anglelist[0]}^\\circ$ $x=\\dfrac{\\var{h}}{\\tan \\var{anglelist[0]}^\\circ}$

\n

A calculator (in degrees mode) evaluates this as $\\var{ans}\\ldots$ which we round to one decimal place as $\\var{precround(ans,1)}$

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"deltax": {"name": "deltax", "group": "Ungrouped variables", "definition": "precround(-12+2*triples[1]/triples[0],4)", "description": "", "templateType": "anything", "can_override": false}, "thetaans": {"name": "thetaans", "group": "Ungrouped variables", "definition": "if(vec1=[0,1,2], h/cos(rsang),\nif(vec1=[0,2,1], d*cos(rsang),\nif(vec1=[1,0,2], v/sin(rsang),\nif(vec1=[1,2,0], v/tan(rsang),\nif(vec1=[2,0,1], d*sin(rsang),\nif(vec1=[2,1,0], h*tan(rsang),\n'error'))))))", "description": "

answer using theta (lower angle in diagram)

", "templateType": "anything", "can_override": false}, "ans": {"name": "ans", "group": "Ungrouped variables", "definition": "if(anglelist[1]=3, thetaans, phians)", "description": "

I think I just calculated the answer two different ways

", "templateType": "anything", "can_override": false}, "display_angles1": {"name": "display_angles1", "group": "Ungrouped variables", "definition": "display_angles[1]", "description": "", "templateType": "anything", "can_override": false}, "rsang": {"name": "rsang", "group": "Ungrouped variables", "definition": "smallest_angle*pi/180", "description": "

radians smallest angle

", "templateType": "anything", "can_override": false}, "display_angles": {"name": "display_angles", "group": "Ungrouped variables", "definition": "if(anglelist[1]=3,[smallest_angle,''],['',complement])", "description": "

used in jsxgraph

", "templateType": "anything", "can_override": false}, "display_angles0": {"name": "display_angles0", "group": "Ungrouped variables", "definition": "display_angles[0]", "description": "", "templateType": "anything", "can_override": false}, "vec1": {"name": "vec1", "group": "Ungrouped variables", "definition": "shuffle([0,1,2])", "description": "

shuffles which edge is shortest

", "templateType": "anything", "can_override": false}, "triples": {"name": "triples", "group": "Ungrouped variables", "definition": "random([[3, 4, 5], [5, 12, 13], [7, 24, 25], [8, 15, 17], [9, 40, 41], [11, 60, 61], [12, 35, 37], [16, 63, 65], [20, 21, 29], [20, 99, 101], [24, 143, 145], [28, 45, 53], [33, 56, 65], [36, 77, 85], [39, 80, 89], [44, 117, 125], [48, 55, 73], [51, 140, 149], [52, 165, 173], [57, 176, 185], [60, 91, 109], [60, 221, 229], [65, 72, 97], [68, 285, 293], [69, 260, 269], [75, 308, 317], [76, 357, 365], [84, 187, 205], [84, 437, 445], [85, 132, 157], [87, 416, 425], [88, 105, 137], [92, 525, 533], [93, 476, 485], [95, 168, 193], [96, 247, 265], [100, 621, 629], [104, 153, 185], [105, 208, 233], [105, 608, 617], [111, 680, 689], [115, 252, 277], [119, 120, 169], [120, 209, 241], [120, 391, 409], [132, 475, 493], [133, 156, 205], [135, 352, 377], [136, 273, 305], [140, 171, 221], [145, 408, 433], [152, 345, 377], [155, 468, 493], [156, 667, 685], [160, 231, 281], [161, 240, 289], [165, 532, 557], [168, 425, 457], [168, 775, 793], [175, 288, 337], [180, 299, 349], [184, 513, 545], [185, 672, 697], [189, 340, 389], [195, 748, 773], [200, 609, 641], [203, 396, 445], [204, 253, 325], [205, 828, 853], [207, 224, 305], [215, 912, 937], [216, 713, 745], [217, 456, 505], [220, 459, 509], [225, 272, 353], [228, 325, 397], [231, 520, 569], [232, 825, 857], [240, 551, 601], [248, 945, 977], [252, 275, 373], [259, 660, 709], [260, 651, 701], [261, 380, 461], [273, 736, 785], [276, 493, 565], [279, 440, 521], [280, 351, 449], [280, 759, 809], [287, 816, 865], [297, 304, 425], [300, 589, 661], [301, 900, 949], [308, 435, 533], [315, 572, 653], [319, 360, 481], [333, 644, 725], [336, 377, 505], [336, 527, 625], [341, 420, 541], [348, 805, 877], [364, 627, 725], [368, 465, 593], [369, 800, 881], [372, 925, 997], [385, 552, 673], [387, 884, 965], [396, 403, 565], [400, 561, 689], [407, 624, 745], [420, 851, 949], [429, 460, 629], [429, 700, 821], [432, 665, 793], [451, 780, 901], [455, 528, 697], [464, 777, 905], [468, 595, 757], [473, 864, 985], [481, 600, 769], [504, 703, 865], [533, 756, 925], [540, 629, 829], [555, 572, 797], [580, 741, 941], [615, 728, 953], [616, 663, 905], [696, 697, 985]])\n", "description": "

Some the following were too skinny and so were removed.

use https://www.mathsisfun.com/numbers/pythagorean-triples.html

\n


random([[3,4,5], [5,12,13], [7,24,25], [8,15,17], [9,40,41],
[11,60,61], [12,35,37], [13,84,85], [15,112,113], [16,63,65],
[19,180,181], [20,21,29], [20,99,101],
[23,264,265], [24,143,145], [25,312,313], [27,364,365], [28,45,53],
[28,195,197], [31,480,481], [32,255,257], [33,56,65],
[33,544,545], [35,612,613], [36,77,85], [36,323,325], [37,684,685],
[39,80,89], [40,399,401], [41,840,841], [43,924,925],
[44,117,125], [44,483,485], [48,55,73], [48,575,577], [51,140,149],
[52,165,173], [52,675,677], [56,783,785], [57,176,185], [60,91,109],
[60,221,229], [60,899,901], [65,72,97], [68,285,293], [69,260,269],
[75,308,317], [76,357,365], [84,187,205], [84,437,445], [85,132,157],
[87,416,425], [88,105,137], [92,525,533], [93,476,485], [95,168,193],
[96,247,265], [100,621,629], [104,153,185], [105,208,233], [105,608,617],
[108,725,733], [111,680,689], [115,252,277], [116,837,845], [119,120,169],
[120,209,241], [120,391,409], [123,836,845], [129,920,929],
[132,475,493], [133,156,205], [135,352,377], [136,273,305], [140,171,221],
[145,408,433], [152,345,377], [155,468,493], [156,667,685], [160,231,281],
[161,240,289], [165,532,557], [168,425,457], [168,775,793], [175,288,337],
[180,299,349], [184,513,545], [185,672,697], [189,340,389], [195,748,773],
[200,609,641], [203,396,445], [204,253,325], [205,828,853], [207,224,305],
[215,912,937], [216,713,745], [217,456,505], [220,459,509], [225,272,353],
[228,325,397], [231,520,569], [232,825,857], [240,551,601], [248,945,977],
[252,275,373], [259,660,709], [260,651,701], [261,380,461], [273,736,785],
[276,493,565], [279,440,521], [280,351,449], [280,759,809], [287,816,865],
[297,304,425], [300,589,661], [301,900,949], [308,435,533], [315,572,653],
[319,360,481], [333,644,725], [336,377,505], [336,527,625], [341,420,541],
[348,805,877], [364,627,725], [368,465,593], [369,800,881], [372,925,997],
[385,552,673], [387,884,965], [396,403,565], [400,561,689], [407,624,745],
[420,851,949], [429,460,629], [429,700,821], [432,665,793], [451,780,901],
[455,528,697], [464,777,905], [468,595,757], [473,864,985], [481,600,769],
[504,703,865], [533,756,925], [540,629,829], [555,572,797], [580,741,941],
[615,728,953], [616,663,905], [696,697,985]])

", "templateType": "anything", "can_override": false}, "tritop": {"name": "tritop", "group": "Ungrouped variables", "definition": "precround(triples[0]*scale,4)/2", "description": "

top of triangle for jsxgraph, keeping same ratios.

", "templateType": "anything", "can_override": false}, "d": {"name": "d", "group": "Ungrouped variables", "definition": "if(vec1[2]=1,triples[2],if(vec1[2]=0,'','$x$'))", "description": "

diagonal length in triangle

\n

\n

\n

so always integer and scale by k for more randomness.

", "templateType": "anything", "can_override": false}, "anglelist": {"name": "anglelist", "group": "Ungrouped variables", "definition": "random([smallest_angle,3,'$\\\\theta$'],[complement,4,'$\\\\phi$'])", "description": "

[precround(180*arctan(triples[0]/triples[1])/pi,0),90-precround(180*arctan(triples[0]/triples[1])/pi,0)]

", "templateType": "anything", "can_override": false}, "smallest_angle": {"name": "smallest_angle", "group": "Ungrouped variables", "definition": "precround(180*arctan(triples[0]/triples[1])/pi,0)", "description": "", "templateType": "anything", "can_override": false}, "phians": {"name": "phians", "group": "Ungrouped variables", "definition": "if(vec1=[0,1,2], h/sin(rcang),\nif(vec1=[0,2,1], d*sin(rcang),\nif(vec1=[1,0,2], v/cos(rcang),\nif(vec1=[1,2,0], v*tan(rcang),\nif(vec1=[2,0,1], d*cos(rcang),\nif(vec1=[2,1,0], h/tan(rcang),\n'error'))))))", "description": "

ans using phi (upper angle in diagram)

", "templateType": "anything", "can_override": false}, "scale": {"name": "scale", "group": "Ungrouped variables", "definition": "24/triples[1]", "description": "", "templateType": "anything", "can_override": false}, "rcang": {"name": "rcang", "group": "Ungrouped variables", "definition": "complement*pi/180", "description": "

radians complement angle

", "templateType": "anything", "can_override": false}, "switcharoo": {"name": "switcharoo", "group": "Ungrouped variables", "definition": "random(0,1)", "description": "

determines which orientation the triangle is displayed as

", "templateType": "anything", "can_override": false}, "h": {"name": "h", "group": "Ungrouped variables", "definition": "if(vec1[1]=1,triples[1],if(vec1[1]=0,'','$x$'))", "description": "

horizontal length in triangle

", "templateType": "anything", "can_override": false}, "complement": {"name": "complement", "group": "Ungrouped variables", "definition": "90-smallest_angle", "description": "", "templateType": "anything", "can_override": false}, "v": {"name": "v", "group": "Ungrouped variables", "definition": "if(vec1[0]=1,triples[0],if(vec1[0]=0,'','$x$'))", "description": "

vertical length in triangle

", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["triples", "vec1", "v", "h", "d", "scale", "tritop", "deltax", "switcharoo", "smallest_angle", "complement", "anglelist", "display_angles", "display_angles0", "display_angles1", "rsang", "rcang", "ans", "thetaans", "phians"], "variable_groups": [], "functions": {"otherway": {"parameters": [], "type": "html", "language": "javascript", "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);\ntheta = Numbas.jme.unwrapValue(scope.variables.display_angles0);\nphi = Numbas.jme.unwrapValue(scope.variables.display_angles1);\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/1]], { straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true});\n\n//create the diagonal line\nvar vert = board.create('line',[[12,-TT],[-12,TT/1]], { 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//label the angle theta\nif (theta == '') {\n} else {\nboard.create('text',[5.5,-4*TT/5,\n function() { \n return theta + \"\\u00B0\";\n }], {fontSize:20,fixed: true});\n}\n\n//label the angle phi\nif (phi == '') {\n} else {\nboard.create('text',[-11.5,3*TT/5,\n function() { \n return phi + \"\\u00B0\";\n }], {fontSize:20,fixed: true});\n}\n\n//display the side lengths\nvar vtext= board.create('text',[-15,0,v], {fontSize:20,fixed: true});\nvar htext= board.create('text',[-2,-TT-1,h], {fontSize:20,fixed: true});\nvar dtext= board.create('text',[-2,TT/2+0.3,d], {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"}, "triangle": {"parameters": [], "type": "html", "language": "javascript", "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);\ntheta = Numbas.jme.unwrapValue(scope.variables.display_angles0);\nphi = Numbas.jme.unwrapValue(scope.variables.display_angles1);\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/1]], { straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true});\n\n//create the diagonal line\nvar vert = board.create('line',[[-12,-TT],[12,TT/1]], { 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//label the angle theta\nif (theta == '') {\n} else {\nboard.create('text',[-7.2,-4*TT/5,\n function() { \n return theta + \"\\u00B0\";\n }], {fontSize:20,fixed: true});\n}\n\n//label the angle phi\nif (phi == ''){\n} else {\n board.create('text',[9.6,3*TT/5,\n function() { \n return phi + \"\\u00B0\";\n }], {fontSize:20,fixed: true});\n}\n \n//display the side lengths\nvar vtext= board.create('text',[12.5,0,v], {fontSize:20,fixed: true});\nvar htext= board.create('text',[0,-TT-1,h], {fontSize:20,fixed: true});\nvar dtext= board.create('text',[0,TT/2+0.3,d], {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"}}, "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": "

Given the triangle described below, the value of $x$ is [[0]] to 1 decimal place.

\n

{if(switcharoo=0,triangle(),otherway())}

", "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": "ans", "maxValue": "ans", "correctAnswerFraction": false, "allowFractions": false, "mustBeReduced": false, "mustBeReducedPC": 0, "displayAnswer": "", "precisionType": "dp", "precision": "1", "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}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always"}]}], "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": true, "showtotalmark": true, "showanswerstate": true, "allowrevealanswer": true, "advicethreshold": 0, "intro": "", "end_message": "", "reviewshowscore": true, "reviewshowfeedback": true, "reviewshowexpectedanswer": true, "reviewshowadvice": true, "feedbackmessages": []}, "diagnostic": {"knowledge_graph": {"topics": [], "learning_objectives": []}, "script": "diagnosys", "customScript": ""}, "contributors": [{"name": "Ben Brawn", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/605/"}], "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [["question-resources/undefined_YwBJcjH", "/srv/numbas/media/question-resources/undefined_YwBJcjH"], ["question-resources/undefined_YwBJcjH", "/srv/numbas/media/question-resources/undefined_YwBJcjH"], ["question-resources/undefined_YwBJcjH", "/srv/numbas/media/question-resources/undefined_YwBJcjH"], ["question-resources/undefined_YwBJcjH", "/srv/numbas/media/question-resources/undefined_YwBJcjH"], ["question-resources/undefined_YwBJcjH", "/srv/numbas/media/question-resources/undefined_YwBJcjH"], ["question-resources/undefined_YwBJcjH", "/srv/numbas/media/question-resources/undefined_YwBJcjH"]]}