One of the sections of homework that is due Monday has this problem:
Determine whether these points lie on a straight line:
A(2, 4, 2) B(3, 7, -2) C(1, 3, 3)
Now these are points in 3D space, which is why they have three coordinates each. At first, I couldn't think how to solve this problem easily. (In 2D, you could try drawing them and see if they look like a straight line - though that wouldn't be a precise answer - but my 3D drawing isn't good enough and the paper is too flat to see very well whether the points would be on a line.) After a while, I came up with a solution that I'll describe in a bit.
In class last night, the professor brought this up as a homework problem that students typically don't know how to solve, and she told us how to solve it. This official method is much simpler and more elegant than mine, so here is how it works.
If three points are on the same line, then the distance from the first one to the last one (along the line) should be the sum of the two distances inbetween. Here's a diagram I drew:
You can see in the top figure, the points are in the line, so the distance "c" is the same as the sum of a & b. In the bottom figure, the points are not in a line, so "c" is the third side of a triangle, and thus it's a shortcut from a to c, so it's shorter than a + b.
Makes sense, right? Why didn't I think of that?
So here is the overly complex solution I used. I know how to take 2D points and get the equation for the line they would be on - this is something you learn in algebra at some point. (It's possible to get the equation for a 3D line, but I don't know how - apparently we learn this later in the course.) So I reasoned that if the three points are a line in 3D space, they must also be a line in all three of the 2D combinations.
In math terms, what I mean is, given the points above:
A(2, 4, 2) B(3, 7, -2) C(1, 3, 3)
where the first value is the x-coordinate, the second is the y-coordinate, and the third is the z-coordinate, the points should form a line in each two-coordinate system, meaning these points should be on a line:
xy: (2, 4) (3, 7) (1, 3)
yz: (4, 2) (7, -2) (3, 3)
xz: (2, 2) (3, -2) (1, 3)
When my teacher gave the method of solving this in class, I mentioned having used a different method, so over the break, I showed it to her. She had to think a minute before deciding I was right.
The key is that showing the line in each of the 2 dimensions is the same as projecting it onto each plane formed by the axes of the graph. You can imagine a 3D graph if you look at the corner of the room you are in. The corner that goes up and down is the z axis (by the conventions used in this class), the bottom of the wall that goes to the left is the x axis, and the bottom of the wall that goes to the right is the y axis.
So now imagine that in the room, we place three points (just dangling in space), which may or may not be in a line, and we string ropes between them. Of course, if you really did that, you could probably see if the points were in a line or not. But to project them onto each of the three planes (the same as my method of seeing if the three sets of 2D points are on a line), you could shine a light through the points onto each of the two walls and the floor. If the points are in a line, a line shadow will show up on each wall (and the floor). If they're not, you might get a line on one or even two walls, but at least one wall will show an angle (two sides of a triangle) instead.
Once the professor agreed with me about this (not the room analogy, just the "projection onto each plane" thing) I felt very clever, even though the "official" way of solving this problem is much simpler and more elegant.