If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

# 2. Parametric form of a ray

## Video transcript

recall that to figure out where a two-dimensional ray intersects a line segment we started by first introducing a coordinate system once we have our coordinate system we can write our line a B in slope intercept form since in this example a has coordinates 3 2 and B has coordinates 4 negative 1 the slope intercept form of a B is y equals negative 3x plus 11 similarly if I pick P to have coordinates 2 1/2 then the slope-intercept form of the Rays CP is y equals 1/4 X the point I we're looking for is on both of these lines so if I sub X and I sub y represent the coordinates of I then I sub y equals negative 3 I sub X plus 11 because I lies on a B and I sub y equals 1/4 I sub X because I lies on the Rays CP solving these two equations for the two unknowns gives us the coordinates I sub X and I sub y using the slope intercept form of the Ray works in two dimensions and is fairly simple to understand but there's a problem when we generalize it to three dimensions the problem is that in three dimensions the Ray doesn't have a slope intercept form so we'll have to throw out this representation of our array in preparation for three-dimensional ray tracing to represent our ray CP we'll use something called a parametric function what I'm about to write looks a little strange at first but bear with me these functions start to become familiar with practice my ray will be represented by a new function R of T that is a weighted average of C and P where T is the weight in particular I'm going to write R of T as 1 minus T times C plus T times P notice what happens when T equals 0 1 minus T is just 1 so R of 0 is C and when T equals 1 R of 1 equals P that's convenient because I can real able see as R of 0 and it can real able P as R of 1 R of 1/2 would be exactly halfway between C and P values of T greater than 1 named points on the Ray often the seen beyond P before we continue get some experience using this kind of parametric function in the next exercise