// Numbas version: finer_feedback_settings {"name": "Linear graphs: Plotting 2 - non-integer values", "extensions": ["geogebra"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Linear graphs: Plotting 2 - non-integer values", "tags": ["Category: Linear Graphs"], "metadata": {"description": "
Drag points on an axis to plot a linear graph (rational gradient and intercept)
", "licence": "None specified"}, "statement": "Move the points $A$ and $B$ to make line $\\simplify{y={m}x+{c}}$
", "advice": "There are two ways to think about this, either by considering the points A and B, or by considering gradient ($m$) and intercept ($c$).
Let us firstly look at gradient and intercept.
$y=\\simplify{{m}x+{c}}$
Comparing this to the standard equation of a straight line ($y=mx+c$), we can see that $c = \\simplify{{c}}$. Since the intercept tells us where the line intersects the $y$-axis, so we can move our first point to $(0,\\simplify{{c}})$ straight away.
The gradient is a measure of 'how many units up for each unit across' (or 'units down' if the gradient is negative). In this case we want to go {uod} {abs(numerator)} for every {abs(denom)} units we move to the right. Therefore to place the second point we move across {abs(denom)} unit on the $x$-axis and {uod} {abs(numerator)} on the $y$-axis, which takes us to
$(\\var{numerator}, \\simplify{{c+denom}} )$.
The alternative method is to place the points directly
This method will probably give you fraction or decimal coordinates which might be tricky to precisely place so if accuracy is important the first method is better.
Choose any value of $x$ for your first point.
We will take $x = 1$ for this example.
Calculate the corresponding $y$-value by substituting into the equation $y=\\simplify{{m}x+{c}}$:
$y=\\simplify[!collectNumbers,noLeadingMinus]{{m}*1+{c}}$
$y = \\var{m+c}$
\ntherefore the first point is $(1,\\var{m+c})$.
We repeat the process for $x=2$ (or any other value of $x$ that you choose)
$y=\\simplify[!collectNumbers,noLeadingMinus]{{m}*2+{c}}$
\n$y = \\var{2*m+c}$
\ntherefore the second point is $(2,\\var{2*m+c})$.
", "rulesets": {}, "extensions": ["geogebra"], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"app": {"name": "app", "group": "Ungrouped variables", "definition": "geogebra_applet(\n 800,500,\n [\n A: [\n definition: p1,\n label_visible: false\n ],\n B: [\n definition: p2,\n label_visible: false\n ],\n line: [\n definition: \"Line(A,B)\",\n label_visible: false\n ]\n \n \n ]\n \n \n)\n\n", "description": "", "templateType": "anything", "can_override": false}, "m": {"name": "m", "group": "Ungrouped variables", "definition": "rational(numerator/denom)", "description": "", "templateType": "anything", "can_override": false}, "c": {"name": "c", "group": "Ungrouped variables", "definition": "rational(random(-5..5 #0.5 except 0))", "description": "", "templateType": "anything", "can_override": false}, "P1": {"name": "P1", "group": "Ungrouped variables", "definition": "vector(0,0)", "description": "", "templateType": "anything", "can_override": false}, "P2": {"name": "P2", "group": "Ungrouped variables", "definition": "vector(1,1)", "description": "", "templateType": "anything", "can_override": false}, "uod": {"name": "uod", "group": "Ungrouped variables", "definition": "if(m=abs(m),'up','down')", "description": "", "templateType": "anything", "can_override": false}, "numerator": {"name": "numerator", "group": "Ungrouped variables", "definition": "random(2..8)", "description": "", "templateType": "anything", "can_override": false}, "denom": {"name": "denom", "group": "Ungrouped variables", "definition": "random(-5..5 except 1 except -1)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "(m <> 0) & (abs(m) < 5) & gcf(numerator,denom)=1", "maxRuns": 100}, "ungrouped_variables": ["app", "m", "c", "P1", "P2", "uod", "numerator", "denom"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "extension", "useCustomName": false, "customName": "", "marks": 1, "scripts": {}, "customMarkingAlgorithm": "l:\n value(app,\"line\")\n\nax:\n x(app,\"A\")\n\nay:\n y(app,\"A\")\n\nbx:\n x(app,\"B\")\n\nby:\n y(app,\"B\")\n\nmans:\n (ay-by)/(ax-bx)\n\ncans:\n ay - mans*ax\n\nmark:\n feedback(\"Your line is $\\\\var{value(app,'line')}$.\");\n correctif(mans=m AND cans=c)\n\ninterpreted_answer:\n mans\n", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "You can zoom and pan this image.
{app}