Find the distance between the two lines (linear algebra)

In summary, the formula for finding the distance between two lines in linear algebra is d = |(a1x + b1y + c1) - (a2x + b2y + c2)| / √(a1² + b1²). The distance between two lines in geometric terms can be thought of as the shortest distance between any two points on the two lines, and can be positive or negative. To calculate the distance, you will need to know the coefficients of both lines, which can be found by representing the equations in standard form. The distance between two lines can be zero if the lines are parallel and have the same slope. This concept is commonly used in fields such as engineering, physics, and
  • #1
nicknaq
67
0

Homework Statement


Find the distance between the two lines.
b) L1: (2,1,0)+t[1,1,2]^T and L2: (2,3,-1)+t[-1,1,-3]

Homework Equations



see below at my attempt.

The Attempt at a Solution


I assume that I can't use the distance formula because these lines are not parallel? Is that a correct assumption?
So instead I will calculate the projection ...

P1 (2,1,0) d1= [1,1,2]
P2 (2,3,-1) d2=[-1,1,-3]
normal=d1xd2= [-5,1,2]^T
v=p1p2= [0,2,01]^T
v1=projn(v)= 0?

Not sure what to do with a proj=0 !

Help, quick!
 
Physics news on Phys.org
  • #2
Maybe the lines intersect.
 
  • #3
Hi LCKurtz,

So what work is to be shown for this question?

If proj=0, does that mean the lines intersect?

Thanks for the continued help.
 
  • #4
nicknaq said:

Homework Statement


Find the distance between the two lines.
b) L1: (2,1,0)+t[1,1,2]^T and L2: (2,3,-1)+t[-1,1,-3]

Homework Equations



see below at my attempt.

The Attempt at a Solution


I assume that I can't use the distance formula because these lines are not parallel? Is that a correct assumption?
So instead I will calculate the projection ...

P1 (2,1,0) d1= [1,1,2]
P2 (2,3,-1) d2=[-1,1,-3]
normal=d1xd2= [-5,1,2]^T
v=p1p2= [0,2,01]^T
v1=projn(v)= 0?

Not sure what to do with a proj=0 !

Help, quick!

nicknaq said:
Hi LCKurtz,

So what work is to be shown for this question?

If proj=0, does that mean the lines intersect?

Thanks for the continued help.

Above you said you would "calculate the projection". I would ask you what projection did you calculate? The projection of what on what? If you can answer that you may see why the projection being 0 means the lines intersect.
 
  • #5
LCKurtz said:
Above you said you would "calculate the projection". I would ask you what projection did you calculate? The projection of what on what? If you can answer that you may see why the projection being 0 means the lines intersect.

Proj of v on normal.
 
  • #6
LCKurtz said:
Above you said you would "calculate the projection". I would ask you what projection did you calculate? The projection of what on what? If you can answer that you may see why the projection being 0 means the lines intersect.

nicknaq said:
Proj of v on normal.

So do you understand or not? Can you explain why the projection being zero means the lines intersect?
 
  • #7
LCKurtz said:
So do you understand or not? Can you explain why the projection being zero means the lines intersect?

Would it entail that the lines are orthogonal?

For example, the projection of x=0 on y=0 would be zero since y=0 has no component in the direction of x=0. If that makes sense?
 
  • #8
Well, you can use the distance formula. Parametrize one line by t, the other by s, write down the distance formula and minimize it over s and t.
 
  • #9
arkajad said:
Well, you can use the distance formula. Parametrize one line by t, the other by s, write down the distance formula and minimize it over s and t.

Does that involve calculus? If so, it's really not necessary.
 
  • #10
Of course calculus is not necessary, but it instantly gives the conditions for the normals.
 
  • #11
arkajad said:
Of course calculus is not necessary, but it instantly gives the conditions for the normals.

So if I want to stay away from calc, is the best way to prove distance=0 by simply showing the projection is zero?
 
  • #12
I do not know what textbook or conventions you are using - I have no idea what your particular notation means.
 
  • #13
arkajad said:
I do not know what textbook or conventions you are using - I have no idea what your particular notation means.

well..
projv(w) would mean the projection of w on v. For example.
d is direction vector
n is normal

...anything else you need to know?
 
  • #14
nicknaq said:
Would it entail that the lines are orthogonal?

For example, the projection of x=0 on y=0 would be zero since y=0 has no component in the direction of x=0. If that makes sense?

No, it doesn't make sense. See below.

arkajad said:
Well, you can use the distance formula. Parametrize one line by t, the other by s, write down the distance formula and minimize it over s and t.

Of course he could, making a two variable minimization problem out of a simple geometric one.

nicknaq said:
So if I want to stay away from calc, is the best way to prove distance=0 by simply showing the projection is zero?

Yes. It's the best way even if you like calculus. I have included a picture below to show you why it works. The top picture shows two skew lines with the normal N between a and b marking the closest the lines come to each other. Remember that your vector V went from a point on one line to a point on the other (that is important). I have labeled these points P and Q. The lower view is looking at the picture from the "edge", where the skew lines appear parallel. Of course, they aren't because one is going into the viewing plane and the other out of it. The dotted lines show the perpendicular projection of V on N. This shows why the length of that projection is the distance between the lines.

forumprojection.jpg
 
  • #15
Just one remark: the only calculus you need is to know that the derivative of x^2 is 2x. Then it instantly follows that the minimal distance equations are that the line connecting the two lines at the minimum distance is perpendicular to both lines.

Of course this is the way for those like me, who do not have a sufficiently developed 3d geometrical imagination.
 

FAQ: Find the distance between the two lines (linear algebra)

What is the formula for finding the distance between two lines?

The formula for finding the distance between two lines in linear algebra is:
d = |(a1x + b1y + c1) - (a2x + b2y + c2)| / √(a1² + b1²)
Where a1, b1, c1 are the coefficients of the first line and a2, b2, c2 are the coefficients of the second line.

Can you explain the concept of distance between two lines in geometric terms?

The distance between two lines in geometric terms can be thought of as the shortest distance between any two points on the two lines. This distance can be positive or negative, depending on the relative position of the two lines.

How can I find the coefficients of the two lines in order to calculate the distance between them?

In order to calculate the distance between two lines, you will need to know the coefficients of both lines. These coefficients can be found by representing the equations of the lines in standard form: ax + by + c = 0. Once you have the equations in this form, the coefficients a, b, and c can be easily identified.

Is it possible for the distance between two lines to be zero?

Yes, it is possible for the distance between two lines to be zero. This occurs when the two lines are parallel and have the same slope. In this case, the distance between them is always measured as zero.

How can I use the distance between two lines in real-life applications?

The concept of distance between two lines is commonly used in fields such as engineering, physics, and computer graphics. It is used to determine the shortest distance between two objects or to measure the accuracy of a line or curve in relation to a desired position. For example, it can be used in calculating the distance between two parallel roads or the accuracy of a laser-guided machine in manufacturing processes.

Back
Top