Showing posts with label intersection. Show all posts
Showing posts with label intersection. Show all posts

Sunday, 13 June 2010

What's the Point

When I talked about the vector (or parametric) equations of a line, I failed to touch on one of the common questions from early linear algebra; to find the point where the two lines intersect.

When we have L1 = P + t U and L2 = Q + r V for direction vectors U and V, and point vectors P and Q, the two lines lie in a single plane (and thus intersect) if (P-Q), U, and V are form a dependent system. If there is a point where L1 and L2 are equal, then P + t U=Q + r V.
Reordering this we get (P-t) = rV-tU. This says that if there is a solution, there must be a linear combination of V and U that equals (P-Q) or that the three vectors form a dependent system. Remember back to Alg II when you learned about determinants and recall that if the determinant of a nxn matrix was =0, the system was called a dependent system. And hopefully you knew that meant there was a way to combine multiples of n-1 of the vectors to get the remaining one.

A linear combination of three vectors U, V, and W would be something like aU + bV + cW; and focusing on three space; if three vectors are all independent (they have a non-zero determinant) then you can use a linear combination of the three of them to find any point in three space. But if they are dependent (the determinant is zero) then a linear combination of the three vectors can only generate points on a plane or in extreme cases, on a line.

I will use the following two lines L1: (4,1,5)+t<1, -1, 2> and L2: (8,9,4)+r<2,2,1> to illustrate how to find the intersection.
We first need to know if there is actually an intersection so we construct the matrix with the vectors (P-Q), U, and V.. In this example (P-Q) = 4,8,-1; U= 1,-1, 2; and V= 2,2,1. When we find the determinant it is zero.
This means that P-Q can be written as some linear combination of U and V for appropriate values of t and r.

To find the value of t and r that will produce the linear combination, we set two of the parametric equations equal. For example, 4+t = 8+2r from the first (x) terms and 5+2t = 4+r from the third (z) can be rewritten as the system 2r-t=-4 and r-2t=1. A solution is r=-3, t=-2.

If we insert these into L1: (4,1,5)+t<1, -1, 2> and L2: (8,9,4)+r<2,2,1> we get L1: (4,1,5)-2<1, -1, 2> and L2: (8,9,4)-3<2,2,1>; both yielding the point (2,3,1) for a common point to both lines.

And that is really all there is to finding the intersection of two lines; but the idea also lets you do something a little more complex. You can use it to help find the shortest line segments between two skew lines.

But if instead we had L1=(4,1,5)+t<1, -1, 2>and L2= (3,4,4)+r<2,2,1>, then the determinant of the Matrix formed with vectors (P-Q), U, and V) would have a determinant of -10

which means that there is no linear combination of U and V that will give us P-Q. The
geometrical interpretation is that lines L1 and L2 are skew lines, lines that are not in the same plane.

It is possible to find the two parallel Planes that contain the two lines by using the cross product of the two direction vectors. The cross product of <1, -1, 2> and <2,2,1> is <5, -3, -4> so each plane can be written as 5x - 3y - 4 z = d for some d. The value of d for each line is the dot product of <5, -3, -4> with any point on the respective lines. For example the dot product of <5, -3, -4> and (4,1,5) is -3, so the equation of the plane containing L1 is 5x - 3y - 4 z = -3. Similarly we can find that L2 lies in the plane 5x - 3y - 4 z = -13. If we divide the difference, 10, by the unit vector in the direction <5, -3, -4>, (sqrt(50)), we find the distance between the two planes is sqrt(2). It should be easy to see that this will be the smallest distance between any two points on the respective lines.

To find the endpoints of this shortest segment between L1 and L2, we can imagine moving them onto the same plane and finding the point of intersection, and then use that intersection to find the points on the original lines.

To move the point (3,4,4) on L2 some number of units perpendicular to the two planes, we create the values (x,y,z)= (3,4,4)+s<5, -3, -4>

If this point is to be on the plane 5x - 3y - 4 z = -3 which L1 is on, it must be true that 5(3+5s) -3(4-3s) - 4(4-4s) = -3. This will simplify to 15 + 25 s - 12 + 16s -16 + 16s = -3 or 50 s = 10.

So s=1/5 and the new equation for L1 on the same plane as L2 is (x,y,z)= (3,4,4)+1/5 <5, -3, -4> + r<2,2,1> . That can be simplified down to (x,y,z)= (4, 3.4, 3.2)+r(2,2,1). Solving for the values of r and t that give an intersection we get 4+2r = 4+t so t=2r from the x(t) relations of the two lines.. and from z(t) we get 3.2+r = 5+2t and substituting t=2r; 3.2+r = 5+4r so 3r=-1.8 or r= -.6 and t=-1.2

The point of intersection in this common plane is (4, 3.4, 3.2) -.6<2,2,1>= (2.8,2.2, 2.6) and checking to be sure...(4,1,5)-1.2<1, -1, 2>=(2.8,2.2, 2.6), so all appears well.


Now we can apply these same parametric values (r=-.6 and t=-1.2) to find the end points on the original lines at (4,1,5)-1.2<1, -1, 2> = (2.8,2.2, 2.6) on the plane containing L1 and and (3,4,4)-.6<2,2,1>= (1.8, 2.8, 3.4). Just one last check to make sure that these are indeed a distance of sqrt(2) apart, we take the dot-product of the vector from one point to the other <2.8-2, 2.2-2.8, 2.6-3.4> and indeed we get a dot product of 2.

Monday, 9 March 2009

Planes in Space- part One

Take your basic bright kid in alg II or pre-calc, or often in calculus, and ask, "What is the intersection of two lines?"... They say, "A point."... good answer.

"Can you write the equation of a line?" Again they are on target.
"If I give you the equation of two lines on the plane; can you find their point of intersection?" The good ones can, and know they can.

Now ask the same bright kids, "What is the intersection of two planes in space?". They answer correctly again, "A line."
So far everything is great, but now we ask them to write the equation of a plane.... uhhh... gee..... and at this point, when asked about one of the fundamental structures of plane geometry, their analytic geometry skills are exhausted. Still, a very few may actually be able to produce x+y+z=1 or some other for the equation of a plane. Now we ask about the intersection of two planes, and almost none of them can do it. The scary part, is that very (very) few of the teachers of alg II and above that I have questioned about this could provide an answer either .
We begin by recalling that an equation in three variables, such as 2x+3y+z=6 can represent a plane in space. When students had three such equations that intersected in a unique point, they found the solution by one of several methods. Most students learn to solve such equations by the methods called elimination and substitution at the very least. Others may have also been introduced to Cramer’s rule for solving systems with determinants and perhaps two methods using matrices.

The most commonly taught matrix method is to write a matrix equation and then solve it using the inverse matrix method. A second, and as we will point out, more efficient and general method is the Gauss-Jordan reduced row-echelon form (RREF) of an augmented matrix. We give an example of both below to clarify the terminoligy.

We begin with three planes determined by the equations {x + y – 2z = 9; 2x – 3y + z = -2; and x + 3y + z = 2} This same system of equations can be expressed as the matrix equation.

Notice that the left matrix is made up of the coefficients of the three variable terms in each equation, and the right matrix contains the constant terms. We can find the intersection by taking the inverse of the left matrix and multiplying on the left of both sides of the equation. The simplified result gives


This seems to be the most commonly taught method, and the one that students and teachers seem to prefer, and yet it has two major disadvantages. The first disadvantage is that it tells you little or nothing about systems which have a solution, but not a single unique solution. In fact it most students (or teachers?) can not distinguish between the cases (and there are several different ones) with no solutions frorm the ones with an infinite number of solutons. This same defect applies to attempts to use Cramers Rule. The second problem is that the inverse method is more computationally complex, that is, it takes more operations for the solution than the alternative RREF method, and the difference grows as problems reach higher orders of magnitude. For the problems that are generally assigned at the high school level, the difference in computability presents no real problem, but the difference in the range of applicable questions can be very significant in a students understanding of general systems of three equations.

In contrast with the Inverse method that will only work if the three planes intersect in a single point, the RREF form will allow us to work with systems which do not even have the same number of equations as unknowns. This is the type of situation created when we try to find the line of intersection of two planes.

RREF for two planes

We will use the equations 2x + 3y – 3z = 14 and –3x + y + 10z = -32. When we write an augmented matrix for the system of only two equations we get a 2x4 matrix, shown here:


When we reduce this system, by matrices or otherwise, we get

which is a matrix expression of x - 3z = 10 and y + z = -2.

We notice that both equations contain a z variable, it might occur to us to ask, “What happens if we substitute different values in for z?”. For example, if we try z=0 we note that from the first equation we get x=10 and from the second we get y=-2. What does this tell us about the point (10, -2, 0). If we check it against the two original equations we notice that the point makes both equations true, 2(10) + 3(-2) – 3(0) = 14 and –3(10) + (-2) + 10(0) = -32. So the point (10, -2, 0) is on both planes and therefore must lie on the line that is their intersection.

Can we find more points? What happens if we try z=1 or z=2 or other values. Using z=1 we get x – 3(1) = 10 which simplifies to x=13 ; and y +(1) = -2 which simplifies to y=-3. Checking the point (13, -3, 1) we see that it also makes both equations true, and so it must also be on the line of intersection.

Writing the parametric equation of a line in three space

So now we have two points on the line of intersection; (10,-2, 0) and (13, -3, 1). How can we describe the line? One way is to write a formula for all the points so that someone could find as many values of (x,y,z) as they wish. We do this with parametric equations. A parametric equation is an equation that explains the values of one set of variables (in this case x, y, and z) in terms of another “parameter” which we will call t. We will define the line in terms of one point, and instructions to get from one point to another; sort of a three-space equivalent of slope.

When we worked with slope in a plane we had to find the change in x and the change in y, but now in three space we need a change in z also. If we look at our two known points, we can see that from the first we found, (10,-2, 0), to the second, (13, -3, 1), the x-value increases 3, the y-value decreases 1, and the z value increased 1. Let’s record those as a ordered triple, but to keep it separate from our points we will use brackets to enclose the changes; like this [3, -1, 1] .

We can even use this to find more points. If we add [3, -1, 1] to the last point we found (13, -3, 1) we get (16, -4, 2); and we know it is on both planes because it makes both the original equations true (Remember? They were 2x + 3y – 3z = 14 and –3x + y + 10z = -32) . Of course we do not have to add integer multiples of t, and if we allow t to be ANY real value, then we can write a general expression for all the points on the line of intersection in the form (x, y, z) = (10, -2, 0) + t [3, -1, 1] . [some texts will write this as a vector form (x, y, z) = (10+3t, -2 – t, t ) ].
And we have written the equation of the line of intersection. One of the nice things about the matrix approach is that it allows us to focus on interpreting the results... do three planes intersect in a line, in two parallel lines, in three lines all heading in the same direction? I will try to talk about these issues next, and then a little more about the equations of planes in space.