// Numbas version: finer_feedback_settings {"name": "Create a JSXGraph diagram using JessieCode: Three triangle centres lie on a line", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Create a JSXGraph diagram using JessieCode: Three triangle centres lie on a line", "tags": [], "metadata": {"description": "
This question demonstrates how to construct a JSXGraph diagram using JessieCode.
\nThe construction shows a triangle and its orthocentre, circumcentre and centroid. They are always collinear. You can move the vertices of the triangle.
", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "{triangle_diagram}
\nThis diagram was created using the following JessieCode:
\njessiecode(", "advice": "", "rulesets": {}, "extensions": ["jsxgraph"], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"triangle_diagram": {"name": "triangle_diagram", "group": "Ungrouped variables", "definition": "jessiecode(\n 600,600,\n \"\"\"\n A = point(-2,-2);\n B = point(2,-2);\n C = point(1,2);\n \n circumcenter = circumcenter(A,B,C) << name: \"circumcenter\" >>;\n circle(A,B,C) << strokeOpacity: 0.3 >>;\n \n side_a = segment(B,C) << visible: false >>;\n side_b = segment(A,C) << visible: false >>;\n side_c = segment(B,A) << visible: false >>;\n \n polygon(A,B,C);\n \n M_a = midpoint(B,C) << visible: false >>;\n M_b = midpoint(A,C) << visible: false >>;\n M_c = midpoint(B,A) << visible: false >>;\n \n median_a = line(A,M_a) << dash: 4, color: \"gray\", strokeOpacity: 0.3 >>;\n median_b = line(B,M_b) << dash: 4, color: \"gray\", strokeOpacity: 0.3 >>;\n median_c = line(C,M_c) << dash: 4, color: \"gray\", strokeOpacity: 0.3 >>;\n \n centroid = intersection(median_a,median_b) << name: \"centroid\" >>;\n \n p_a = perpendicular(side_a,A) << dash: 1, color: \"gray\", strokeOpacity: 0.3 >>;\n p_b = perpendicular(side_b,B) << dash: 1, color: \"gray\", strokeOpacity: 0.3 >>;\n p_c = perpendicular(side_c,C) << dash: 1, color: \"gray\", strokeOpacity: 0.3 >>;\n \n orthocenter = intersection(p_a,p_b) << name: \"orthocenter\" >>;\n \n euler_line = line(orthocenter, centroid);\n \"\"\",\n [\n \"axis\": false\n ]\n)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["triangle_diagram"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question", "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Laura Midgley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/18287/"}]}]}], "contributors": [{"name": "Christian Lawson-Perfect", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/7/"}, {"name": "Laura Midgley", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/18287/"}]}
600,600,
\"\"\"
A = point(-2,-2);
B = point(2,-2);
C = point(1,2);
circumcenter = circumcenter(A,B,C) << name: \"circumcenter\" >>;
circle(A,B,C) << strokeOpacity: 0.3 >>;
side_a = segment(B,C) << visible: false >>;
side_b = segment(A,C) << visible: false >>;
side_c = segment(B,A) << visible: false >>;
polygon(A,B,C);
M_a = midpoint(B,C) << visible: false >>;
M_b = midpoint(A,C) << visible: false >>;
M_c = midpoint(B,A) << visible: false >>;
median_a = line(A,M_a) << dash: 4, color: \"gray\", strokeOpacity: 0.3 >>;
median_b = line(B,M_b) << dash: 4, color: \"gray\", strokeOpacity: 0.3 >>;
median_c = line(C,M_c) << dash: 4, color: \"gray\", strokeOpacity: 0.3 >>;
centroid = intersection(median_a,median_b) << name: \"centroid\" >>;
p_a = perpendicular(side_a,A) << dash: 1, color: \"gray\", strokeOpacity: 0.3 >>;
p_b = perpendicular(side_b,B) << dash: 1, color: \"gray\", strokeOpacity: 0.3 >>;
p_c = perpendicular(side_c,C) << dash: 1, color: \"gray\", strokeOpacity: 0.3 >>;
orthocenter = intersection(p_a,p_b) << name: \"orthocenter\" >>;
euler_line = line(orthocenter, centroid);
\"\"\",
[
\"axis\": false
]
)