On the Subject of Line Equations

Lemme get this straight...

This module presents a screen showing two coordinates, a display showing “y =” (which also doubles as a delete key), an input display and a keypad. To solve this module, you must find the equation of the straight line which passes through the two coordinates and enter it into the module. Submitting an incorrect equation will result in a strike.

Finding the Line’s Gradient

The gradient of a straight line shows how steep it is. A positive gradient means that the line goes up, a negative gradient means that the line goes down and a gradient of 0 means that the line is horizontal. To find the gradient of the line, use the following equation, where the first point is (x₁, y₁) and the second point is (x₂, y₂):

(y₂ - y₁) / (x₂ - x₁)

Finding the Line’s Y-Intercept

The y-intercept of a straight line is where it crosses the y-axis, or what the y coordinate is when the x coordinate is 0. To find the y-intercept of the line, first create a bit of the equation of the line. The general equation of a straight line is below, where m is the gradient and c is the y-intercept:

y = mx + c

Replace m with the gradient of your line. Then, substitute in the x and y coordinates of either of the two points on the module. Finally, solve the equation for c.

Round both the gradient and the y-intercept of the line to three decimal places, dropping trailing zeroes.

After replacing c with the y-intercept of the line, you should have a complete equation.