Main content

## Mathematics of rendering

Current time:0:00Total duration:2:34

# 4. Using the line equation

## Video transcript

- There's a detail that we need to attend to: there's a slight problem with the slope intercept form of the sine geometry. The problem is that if AB is vertical, the slope isn't defined. To see that, look at the slope intercept form in general: y equals m x plus i, where m is the slope and i is the y-intercept. The slope m is the change in y divided by the change in x, meaning that if AB is a vertical line, there is no change in x. So, computing the slope would mean dividing by zero, which is bad. (bell) But we can eliminate this problem by multiplying through by the change in x. So, multiplying through by the change in x, we get change in x times y equals change in y times x plus i times change in x. It's common to move everything to one side and re-write this as change in y times x minus change in x times y plus i times change of x equals zero. Call this term, change in y, a value: a; this term, negative change in x, a value: b; and this term, i times change of x, a value: c; meaning we can write an equation for the line as a x plus b y plus c equals zero. An equation like this for a line goes by several names. It is sometimes called the line equation. It's also called the implicit form for the line. Let's do an example for this specific line, AB. Change in y is negative three. Change in x is one, and i is 11. So, negative three x minus y plus 11 equals zero. That line equation is shown here. Notice that as I move A and B around, the line equation updates accordingly. The line equation can be used with the parametric form of array to compute intersection points, this time, for any type of line, even vertical ones. Use the next exercise to practice computing intersection points using line equations.