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.

# 3. Calculate intersection point

Now we are ready to calculate an intersection point using our ray CP (parametric form) and our line AB (slope-intercept form).

## Want to join the conversation?

• So a lot of people seem to feel lost in this as well huh • Does someone have a better explanation of what t* represents? • What confuses me so far is that lines are well defined functions so we can 'easily' figure out any point along the line. However when creating a scene in a program the geometry isn't mathematically positioned, but rather arbitrarily. So would we have to subtract the vector of each triangle's position by the vector of the camera's position to figure out the length of the ray between them? • • So let's say we had a parametric equation in 5 dimensions. Would we have to write out
``Ie₀ = T(e₀)Ie₁ = T₁(e*)...Ie₄ = T₄(e****)``

, or is there an easier way? • - 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. • • OMG why is this so boring? I was having fun with this until I got to here, this lesson is not very interesting (To me at least.) I want it to be fun.
(1 vote) • - 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. 