A line's equation can be either y = mx + c or x = k.

If x1 != x2 then m = (y2 - y1) / (x2 - x1) = slope and c = y-intercept

when given two points on the line as (x1, y1) and (x2, y2).

Substiture in first equation, y = 3x + 3 is the line equation.

Similarly for the second, x1 = 2, y1 = 18, x2 = 6, y2 = 6 so

m = (6 - 18) / (6 - 0) = -2

so y = -2x + c, use any one of the points, say (0, 18) to put

y = 18 = -2x + c = -2 * 0 + c = c

equation is y = -2x + 18

3rd equation: x1 = x2 so line equation is x = k, using any point, x = 6.