Read · 1 min
Lines
For the most part, finding the intersection of two lines is pretty straightforward. We are the most familiar with doing it in two dimensions, so let's start with that. Let's say that we have the lines and .
All we have to do now is set these two equal to each other to find an intersection point:
and plug it back into either one of the equations:
Pretty easy! But here's an extension: what if we want to find the intersection of two lines in more than two dimensions?
For those of us who know anything about vectors (and if you don't, I'd recommend you go read up on what they are!), this is actually not too intimidating. Let's define line 1 as passing through with vector , and let's define line 2 as passing through with vector . We can parametrize these equations like so for our needs:
Any point on line 1 can be described as:
and any point on line 2 can be described as:
with s and t being real number parameters.
We can write parametric equations for both of these lines:
Line 1:
Line 2:
This looks familiar! Now all we have to do is set x, y, and z equal for both equations and solve for s and t:
and plug s and t back into the original equation. And we're done! The nice thing about this method is that it'll work in any dimension you want - just increase the dimensions of your vector and the amount of variables.