00:01
Hello, for problem 32, you are referencing exercise 4 .31, which tests whether or not a point is on an unbounded line.
00:14
For this problem, we want to test whether or not the point is on the line segment.
00:21
So a lot of this will be the same as the previous problem where you enter or sorry, prompts the user to enter three points x0 y0 x1 x1 and x2 y2 calculate a conditional statement and then based off of that condition you want to determine whether or not it is on the line segment so from problem 31 we know that it is on the same line if the conditional statement is equal to zero so if it is equal to zero, then we can do some other stuff.
01:02
Otherwise, it's not on the line segment for sure.
01:06
If it is equal to zero, we still don't know if it's just on the line or if it is on the line segment.
01:12
So it will definitely be on the line segment.
01:17
If the x value of the entered point is between the x values of the line and the y value of the given point is between the y values of the end points of the given line.
01:36
And we have to check both cases because we don't know what order the user will enter the points in.
01:42
So it could be greater than or equal to x0 and less than are equal to x1 or greater than or equal to x1 and less than are equal to x2 and so on and so forth...