3. Calculate intersection point
About this video
The video finds the intersection I of ray CP and segment AB by saying I = R(t*) for some special parameter value t*. With C = (0, 0) and P = (2, 1/2), this gives I sub x = 2t* and I sub y = t*/2; substituting these into AB's equation y = -3x + 11 gives one equation in t*, which is solved and plugged back in to find I.
You'll be able to
- explain what t* means for a ray hitting a line segment.
- write the x and y equations for a point on a parametric ray.
- substitute the ray equations into a line equation and solve for t*.
Key words
- t star (t*)
- The special value of t where the ray hits the object, so that I = R(t*).
- Intersection point
- The point I where the ray meets the line segment AB.
- Substitution
- Replacing a variable in one equation with an expression from another equation.
- System of equations
- Several equations that must all be true at the same time.
Transcript
- Now that you have a feel for how t works, we're ready to calculate our intersection point I between our ray CP and our line segment AB. Recall from the previous video that the slope intercept form of the line AB is y equals negative three x plus 11 and the parametric representation of the ray CP is the function R of t equals one minus t times C plus t times P.
Different values of the parameter t locate different points on the ray. The intersection point that we're after is one such point on the ray so there must be some value of t, call it t star, such that I equals R of t star. This is really two equations, one for the x-coordinate of I and one for the y-coordinate.
These two equations are I sub x equals R sub x of t star, which equals one minus t star times C sub x plus t star times P sub x. In the same way I sub y equals R sub y of t star, which equals one minus t star times C sub y plus t star times P sub y. In this particular case C, our camera position, has coordinates zero, zero and P has coordinates two, 1/2.
So we have I sub x equals t star times two and I sub y equals t star times 1/2. I is also on the line segment AB meaning that I satisfies the slope intercept form for AB, that is I sub y equals negative three times I sub x plus 11. So we have three equations and three unknowns, I sub x, I sub y and t star.
We can solve the system of equations by substituting the first two equations into the third to get an equation just in t star. 1/2 t star equals negative three times two times t star plus 11. Solve this for t star, then plug that value of t star into the first two equations to get I sub x and I sub y.
And that's how it's done. Before we continue get some experience using this kind of parametric function in the next exercise.
Video © Khan Academy, used under CC BY-NC-SA. Watch on Khan Academy. Puzzicle is not affiliated with Khan Academy.