randRange(-5, 5) randRange(-5, 5) randRangeExclude(-5, 5, [X1]) randRangeExclude(-5, 5, [Y1]) (Y1 - Y2) / (X1 - X2) fractionReduce(Y1 - Y2, X1 - X2) SLOPE * X1 - Y1

A line passes through both `(\blue{X1}, \blue{Y1})` and `(\green{X2}, \green{Y2})`.

Express the equation of the line in point slope form.

`y - {}``{} = {}``(x - {}``)`
[$("input#response1").val(), $("input#response2").val(), $("input#response3").val()]
var xyMessage = null, xyEmpty = false; var slopeValidator = Khan.answerTypes.predicate.createValidatorFunctional(function(slope, error) { if (Math.abs(slope - SLOPE) > Math.pow(2, -42)) { return false; } var yMessage = null, yEmpty = false; var xValidator = Khan.answerTypes.predicate.createValidatorFunctional(function(x, error) { var yValidator = Khan.answerTypes.predicate.createValidatorFunctional(function(y, error) { return Math.abs((x * slope - y) - INTERCEPT) < Math.pow(2, -42); }, {forms: 'integer, proper, improper, mixed, decimal'}); var yResult = yValidator(guess[0]); if (yResult.empty) { yEmpty = true; } if (yResult.message !== null) { yMessage = yResult.message; } if (yResult.correct) { yEmpty = false; yMessage = null; } return yResult.correct; }, {forms: 'integer, proper, improper, mixed, decimal'}); var xResult = xValidator(guess[2]); if (xResult.empty || yEmpty) { xyEmpty = true; } if (xResult.message !== null || yMessage !== null) { xyMessage = xResult.message || yMessage; } if (xResult.correct) { xyEmpty = false; xyMessage = null; } return xResult.correct; // TODO(emily): Remove fallback when coefficient actually works }, {forms: 'integer, proper, improper, mixed, decimal, coefficient', fallback: 1}); var slopeResult = slopeValidator(guess[1]); // TODO(emily): In the future, when validator-functions can return empty and // message separately, make this actually work if (slopeResult.empty || xyEmpty) { return ""; } else if (slopeResult.message !== null) { return slopeResult.message; } else if (xyMessage !== null) { return xyMessage; } return slopeResult.correct;

The formula to find the slope is: `m = \dfrac{(y_{1} - y_{2})}{(x_{1} - x_{2})}`.

So, by plugging in the numbers, we get: `\dfrac{\blue{Y1} - negParens(Y2, "green")} {\blue{X1} - negParens(X2, "green")} = \pink{\dfrac{Y1 - Y2}{X1 - X2}} = \pink{SLOPE_FRACTION}`

Select one of the points to substitute for `x_{1}` and `y_{1}` in the point slope formula.

Either `(y - \blue{Y1}) = \pink{SLOPE_FRACTION}(x - \blue{X1})`,
or `(y - \green{Y2}) = \pink{SLOPE_FRACTION}(x - \green{X2})`.

Given the following values, find the equation of the line.

`\begin{eqnarray} x_{1} &=& \blue{X1},\quad &f(x_{1}) = \blue{Y1} \\ x_{2} &=& \green{X2},\quad &f(x_{2}) = \green{Y2} \end{eqnarray}`

`f(x)` is just a fancy term for `y`.

So one point on the line is `(\blue{X1}, \blue{Y1})`. Another is `(\green{X2}, \green{Y2})`.

0

The slope of a line is `\pink{SLOPE_FRACTION}` and its `y`-intercept is `\blue{Y1}`.

The `y`-intercept is the value of `y` when `x = 0`.

So the line goes through the point, `(\blue{X1}, \blue{Y1})`.

Thus, the solution in point slope form can be written as:
`(y - \blue{Y1}) = \pink{SLOPE_FRACTION}(x - \blue{X1})`