00:03
Okay, good day, ladies and gentlemen.
00:07
So today we're looking at problem number 7 .9, and it's on intersection.
00:13
Now, this problem is a little bit different than some of the ones we've been doing recently, or that i've done in the last few videos.
00:22
Basically, it's sort of asking us to apply one of the classes we've used earlier, and before we get to the actual implementation of it, i want to sort of sketch out what's going on and then we'll get to the next step.
00:46
So if you read the problem, you understand basically what we have.
00:54
So we have a line, so we have these points here.
01:00
We'll say this point is, we'll call this x1, y, one.
01:08
Okay.
01:10
And we have another point over here.
01:15
We'll call this x2, y2.
01:29
And we have a line between these two, so a line like this, which, of course, goes on.
01:36
Like that, added finitum, you know, like that.
01:42
Okay.
01:44
And a couple equations we can get for this line is we have to use slope.
01:52
The slope, the slope, the slope, the slope formula to get the equation for the line of the form x, minus x1 uh sorry yeah times y um actually i want to write it like this i want to write it uh y 1 minus y 2 um times x plus um uh x 2 minus x1 y 2 equals x 2 minus x 1 y to equal to this is let me see it's supposed to be x2 minus x1 times some constant we'll call that just e okay and the the way i got this is that you use the so the slope intersect force i mean there's ways you can write this, but one way to do it is to say, well, y is equal to mx plus b, okay? and we have that m is equal to y1 or y2 minus y1.
03:38
And this is sort of the rise overrun idea, which is x2 minus x1.
03:46
Okay.
03:47
And then when i multiply through, i end up with this equation over here once i subtract.
03:55
The main reason i want this form, okay, is because when i do what i want, when i, when i'm using the linear equations.
04:11
If you recall our linear equations module were at, oops, so our linear equation module had the form like this.
04:22
It had ax plus b, y equals to e, and cx plus by equals to f.
04:36
Okay? and the module then, of course, we plugged in in the a, b, c, d, e, and f, and spit out values for the solution.
04:47
So what i wanted to do, basically, is get this into something like this form.
04:55
So i'd have, you know, the first equation, my a now would be y1 minus y2.
05:01
My b would be x2 minus x1.
05:04
And my e would be, well, in this case, it would actually be the intersect value, and the e here actually is, if you solve, you get that e is actually equal to, this should be, let's see, y1, i should be careful about how i do this.
05:32
It's y1 minus y2 times x1 plus what is that? yeah, x2 minus x1 times y1.
05:57
And actually, now they look at this, you could have simplified that.
06:01
I'm just realizing now that could have simplified more than i realized.
06:05
But the key is that this would be the e value that you use.
06:14
But you put all these values in from the variables you get.
06:23
When you start the program, you gather x1, y, 1, x2, y3, and x4, y4, which, of course, would be something like this.
06:40
We'd have like the points x3, y 3, and then some point over here.
06:49
Whoops, sorry, a different thing.
06:59
Irritating as heck, i can tell you that.
07:02
Irritating as heck.
07:04
X for y, four.
07:07
And again, we're going to get a line three.
07:12
These like this, so on and so forth.
07:16
And then you're going to get this line, and this line will go here, the top line goes there, and then you'll end up with the intersection right there.
07:27
And, of course, it's not always going to happen.
07:29
You're going to have any intersection in particular.
07:34
If the lines are parallel to each other, there will be no intersection.
07:38
And that's really the one case that you'd worry about if they're parallel...