A straight graph visually depicts a mathematical function. The x- and y-coordinates of the graph's points represent two sets of quantities and the graph plots the relationship between the two. The equation of the line is the algebraic function that derives the y-values from the x-coordinates. The two factors that define this equation are the line's gradient, which is its slope, and its y-intercept, which is y's value when x is 0.
Identify the coordinates of the intersection between the graph and the y-axis. For this example, imagine an intersection at the point (0, 8).
Identify one other point on the graph. For this example, imagine that another point on the graph has the coordinates (3, 2).
Subtract the first point's y-coordinate from the second's -- 8 - 2 = 6.
Subtract the first point's x-coordinate from the second's -- 0 - 3 = -3.
Divide the difference in y-coordinates by the difference in x-coordinates -- 6 ÷ -3 = -2. This is the line's gradient.
Insert the line's gradient and the y-coordinate from Step 1 as "m" and "c" in the equation "y = mx + c." With this example, that gives -- y = -2x + 8. That's the equation of the graph.
- Jupiterimages/Goodshoot/Getty Images