// Numbas version: finer_feedback_settings {"name": "2.5.3.2 m and b of a line through 2 points", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "2.5.3.2 m and b of a line through 2 points", "tags": [], "metadata": {"description": "

Find the gradient and y-axis intercept of a line through 2 points. The line is not vertical.

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

Calculate the gradient and vertical intercept of the line joining $(\\var{x1},\\var{y1})$ and $(\\var{x2},\\var{y2})$

", "advice": "

\\[ \\begin{align*} \\frac{y-y_1}{x-x_1} &= \\frac{y_2-y_1}{x_2-x_1}\\\\ \\frac{y-(\\var{y1})}{x-(\\var{x1})}&=\\frac{\\var{y2}-(\\var{y1}) }{\\var{x2}-(\\var{x1})} \\\\ \\frac{\\var{yminusy1e}}{\\var{xminusx1e}} &=\\var{expression(string(rational((y2-y1)/(x2-x1))))}\\\\ \\var{yminusy1e}&=\\var{expression(string(rational((y2-y1)/(x2-x1))))}(\\var{xminusx1e})\\\\ \\textrm{So }\\qquad y&=\\var{expression(string(rational((y2-y1)/(x2-x1))))}(\\var{xminusx1e}) +\\var{y1}\\\\&=\\var{eqn} \\end{align*}\\]

\n

Thus, gradient = $\\displaystyle{\\var{me}}$, and vertical intercept = $\\displaystyle{\\var{be}}$

", "rulesets": {}, "extensions": [], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"x1,x2": {"name": "x1,x2", "group": "Ungrouped variables", "definition": "shuffle(-20..20)[0..2]", "description": "", "templateType": "anything", "can_override": false}, "y1,y2": {"name": "y1,y2", "group": "Ungrouped variables", "definition": "repeat(random(-20..20),2)", "description": "", "templateType": "anything", "can_override": false}, "eqn": {"name": "eqn", "group": "Ungrouped variables", "definition": "simplify(expression(m+\"*x+\"+b),[\"basic\",\"unitFactor\",\"zeroFactor\",\"zeroTerm\"])", "description": "", "templateType": "anything", "can_override": false}, "m": {"name": "m", "group": "Ungrouped variables", "definition": "rational((y2-y1)/(x2-x1))", "description": "", "templateType": "anything", "can_override": false}, "b": {"name": "b", "group": "Ungrouped variables", "definition": "rational(m*(-x1)+y1)", "description": "", "templateType": "anything", "can_override": false}, "be": {"name": "be", "group": "Ungrouped variables", "definition": "expression(string(b))", "description": "", "templateType": "anything", "can_override": false}, "me": {"name": "me", "group": "Ungrouped variables", "definition": "expression(string(m))", "description": "", "templateType": "anything", "can_override": false}, "yminusy1e": {"name": "yminusy1e", "group": "Ungrouped variables", "definition": "simplify(expression(\"y-\"+y1),\"all\")", "description": "", "templateType": "anything", "can_override": false}, "xminusx1e": {"name": "xminusx1e", "group": "Ungrouped variables", "definition": "simplify(expression(\"x-\"+x1),\"all\")", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["x1,x2", "y1,y2", "eqn", "m", "b", "be", "me", "yminusy1e", "xminusx1e"], "variable_groups": [], "functions": {}, "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": "

gradient = [[0]]

\n

vertical intercept = [[1]]

", "gaps": [{"type": "numberentry", "useCustomName": true, "customName": "gradient", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "{m}", "maxValue": "{m}", "correctAnswerFraction": true, "allowFractions": true, "mustBeReduced": true, "mustBeReducedPC": "50", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}, {"type": "numberentry", "useCustomName": true, "customName": "intercept", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minValue": "{b}", "maxValue": "{b}", "correctAnswerFraction": true, "allowFractions": true, "mustBeReduced": true, "mustBeReducedPC": "50", "showFractionHint": true, "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question", "contributors": [{"name": "Merryn Horrocks", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4052/"}]}]}], "contributors": [{"name": "Merryn Horrocks", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/4052/"}]}