# Finding the intersection point of 2 vectors

Hi friends, I’m desperately trying to find the intersection point of two vectors. I know more or less how to find it, using the equation of a straight line, but I can’t figure out on how to track 2 points of each vectors (because they are moving around the scene) to find the equation and then, finally locate the intersection point.

Could anyone please give me a light?

Thanks!

If I got your problem right …
When your objects are moving then keep and update they current direction vector and not only coordinates

Hello!
You see, there is no such thing. Vectors represent Directions and Distances only, they don’t intersect. Two lines or straights (each one represented by 2 Vectors placement and direction!) may intersect, which is what I would think you mean. Using your favourite search engine with the term “Intersection of 2 lines” should yield nice results.

Regards,
Michael

You are probably trying to find the intersection of two rays. In all but the most special case, they will not intersect at all!

You should think of a ray as a point § plus a length (t) times a direction (V), so
A_Point_On_The_Ray = P + tV
if you vary t from -inf to inf you get the entire line! Usually you are interested only in positive values of t though for a ray.

so you have
P1 + t1V1 = P2 + t2V2

There are 3 equations and 2 variables (1 equation for each dimension (ie P1x + t1V1x = P2x + t2*V2x, etc) ) So there is not necessarily a solution, but if there is, then once you find either t1 or t2, you can find the point of intersection by substituting t1 into the equation of ray 1 or t2 into the equation of t2.

Hope this helps.

Dave