Distance of line to origin

Jbreezy

1. Homework Statement

Say you have an equation of a line in 3 space and you want to find the distance from the line to the origin how do you go about it?
I guess by definition the distance of a line to a point ( say the origin in this case) is the minimum distance such that the line and some vector are perpendicular. That kind of sucks how I said it.

So x is a unique point on the line so you want the distance xo ( where o is the origin) such that xo is perpendicular to the line L . Not really sure how to do this. It is in the cross product section so maybe that would work. I tried to use dot product but I don't know how to get the shortest point. If I did I should dot xo with L and it would be 0. Well that was my thinking. I don't really know how to go about this.
Thanks

Related Precalculus Mathematics Homework Help News on Phys.org

LCKurtz

Homework Helper
Gold Member
1. Homework Statement

Say you have an equation of a line in 3 space and you want to find the distance from the line to the origin how do you go about it?
I guess by definition the distance of a line to a point ( say the origin in this case) is the minimum distance such that the line and some vector are perpendicular. That kind of sucks how I said it.

So x is a unique point on the line so you want the distance xo ( where o is the origin) such that xo is perpendicular to the line L . Not really sure how to do this. It is in the cross product section so maybe that would work. I tried to use dot product but I don't know how to get the shortest point. If I did I should dot xo with L and it would be 0. Well that was my thinking. I don't really know how to go about this.
Thanks
In general: Draw a line L and label a point P on the line. Draw a direction vector D for the line with its tail at P. Take a point Q off the line and draw a vector V=PQ. Drop a perpendicular from Q to the line and label its length h. Label the angle between V and D as $\theta$. What is the length of h using that little triangle you see. The formula you get should remind you of something about the cross product. See if that helps when you apply it to your problem.

Jbreezy

I don't understand. How does it guarantee it is the shortest distance that is perpendicular and goes through the origin?
I don''t understand this
Take a point Q off the line and draw a vector V=PQ. Drop a perpendicular from Q to the line and label its length h.
Thanks

Mark44

Mentor
Edited to include the quote from LCKurtz. Click the Quote button to see how I did it.
I don't understand. How does it guarantee it is the shortest distance that is perpendicular and goes through the origin?
I don''t understand this
LCKurtz said:
Take a point Q off the line and draw a vector V=PQ. Drop a perpendicular from Q to the line and label its length h.
Thanks

LCKurtz

Homework Helper
Gold Member
I don't understand. How does it guarantee it is the shortest distance that is perpendicular and goes through the origin?
I don''t understand this
Take a point Q off the line and draw a vector V=PQ. Drop a perpendicular from Q to the line and label its length h.
Thanks
If you draw any other line K from the point Q to your given line L, then K, L, and the line labeled h make a right triangle with K as the hypotenuse and h a leg. h will always be less than the length of K. Draw a picture.

Jbreezy

I apologize I can't follow you. I grew a picture but I can't connect it to my problem I don't see how an equation for h is related to the cross product.I would think it is Pythagoras to find h. But once again to me it seems to far away from my problem I can't draw this together.

LCKurtz

Homework Helper
Gold Member
Can't you use a triangle trigonometry formula to write h in terms the length of V and the variable $\theta$?

Jbreezy

Vsinθ = h
PQsinθ = h

OK but at the same time this line is not so pretty as the one you have described.
My position vectors are a = <2 , 1, 7> : b = <1 , 4, -1>
Just connect points A and B this is the line. Thanks

LCKurtz

Homework Helper
Gold Member
Vsinθ = h
PQsinθ = h

OK but at the same time this line is not so pretty as the one you have described.
My position vectors are a = <2 , 1, 7> : b = <1 , 4, -1>
Just connect points A and B this is the line. Thanks
I'm not worried about your particular values at the moment. I'm trying to show you what your problem has to do with a cross product. You have $|V|\sin\theta = h$. Notice that is the length of $V$, not $V$ itself in the formula. Now in your picture, imagine D being divided by its length giving a unit vector $\hat D$. Draw a little short vector on top of $D$ representing $\hat D$. What is the formula for $|V \times \hat D|$, the magnitude of the cross product of those two vectors?

Jbreezy

How do you write out your answers really good like that ? Like how the symbols are in your last post?
VDsin(theta) is the magnitude of the cross product of the v cross d.
So what does Vsin(theta) have to do with it?
OK I drew it. Still not landing this concept. I don't get this problem. Thanks

LCKurtz

Homework Helper
Gold Member
How do you write out your answers really good like that ? Like how the symbols are in your last post?
VDsin(theta) is the magnitude of the cross product of the v cross d.
So what does Vsin(theta) have to do with it?
OK I drew it. Still not landing this concept. I don't get this problem. Thanks
Remember $\hat D$ is a unit vector so you have$$|\vec V \times \hat D|=|\vec V||\hat D|\sin \theta|$$Now since $\hat D$ is a unit vector, its length is $1$. So you have$$|\vec V \times \hat D|=|\vec V||\hat D|\sin \theta=|\vec V| \sin\theta = h$$Now how does this help you with your problem? Using your given position vectors, you can make a direction vector $\vec D$ and make a unit vector $\hat D$ out of it. What can you use for P and Q in your problem so you can calculate $\vec V = \overline{PQ}$? Once you have $\hat D$ and $\vec V$, just calculate $\vec V \times \hat D$ and take its length to get h.

To read about typing equations, read the pinned FAQ at the top of this forum.

Jbreezy

Can I just use position vector a as PQ?

LCKurtz

Homework Helper
Gold Member
Can I just use position vector a as PQ?
Yes, because the point that you are interested in that is not on the line is the origin. That is your Q. It doesn't matter if you use PQ or QP because only the length of the vector matters in the formulas.

Jbreezy

I feel like this problem isn't correct. The approach I mean.

LCKurtz

Homework Helper
Gold Member
I feel like this problem isn't correct. The approach I mean.
In post #8 you seemed to understand from the triangle $|\vec V|\sin\theta = h$

And we have$$|\vec V \times \hat D|=|\vec V||\hat D|\sin \theta=|\vec V|\cdot1\cdot \sin\theta$$so it gives $h$. It doesn't matter what you "feel like".

Jbreezy

Yeah I understand that. Is there a way to draw on here? How can you show the diagram.
I think if you cross the position vectors it give you a vector orthogonal to the plane. Then you can cross that with the vector that is give by subtraction the position vectors ( what you call D). That will form a new vector in the plane of a and b. You turn it into a unit vector and dot it with the position vector b.

LCKurtz

Homework Helper
Gold Member
Yeah I understand that. Is there a way to draw on here? How can you show the diagram.
I think if you cross the position vectors it give you a vector orthogonal to the plane. Then you can cross that with the vector that is give by subtraction the position vectors ( what you call D). That will form a new vector in the plane of a and b. You turn it into a unit vector and dot it with the position vector b.
And what does dotting it with the position vector b get you? Nothing relevant that I can see.

You are making it much harder than it is. You have two points $a$ and $b$ determining the line and a point $p$ not on the line. You can think of all three as position vectors to the points or coordinates of the points.$$\vec D = b-a$$ $$\vec V = p-a$$Both of those are trivial to calculate. Make a unit vector $\hat D$ out of $\vec D$ by dividing it by its length. Now calculate $\vec V \times \hat D$ and calculate its length and you are done.

Jbreezy

Dotting with b will get you the length. You say that a is perpendicular to the line?

LCKurtz

Homework Helper
Gold Member
Dotting with b will get you the length. You say that a is perpendicular to the line?
No it won't and no I didn't say that and no it isn't.

Jbreezy

I think you are finding a different length.

Forgive my word drawing but it works. I was looking for the blue length. I think it will show up blue.

So,

a x b = V , this is a vector orthogonal to the plane.
AB x V = U
This vector is in orthogonal to AB.
So we make a unit vector out of it. Call it u.
Then we take the dot product of u with b which will give us the length.
Could you open the drawing?

Attachments

• 12.3 KB Views: 100

LCKurtz

Homework Helper
Gold Member
OK. Since the point that is not on the line is the origin in your problem, if you take the absolute value of u dot b, that will give you the distance from the origin. That method will not work if you want the distance from the line to any point that isn't the origin. That is what I meant about saying your method won't work.

The method I have outlined for you will work your problem and it will work any distance from point to line problem. And it is easier than what you have done, requiring only one cross product. Have you tried it? It is worth learning.

Jbreezy

That method will not work if you want the distance from the line to any point that isn't the origin.
I have done both methods. Why won't mine work as you say in your quote?
Thanks

LCKurtz

Homework Helper
Gold Member
I have done both methods. Why won't mine work as you say in your quote?
Thanks
Because your method takes the projection of a position vector to a point on the line along the normal to the line. Normally the vector from the external point to the line will not be a position vector. Just try both methods using a point other than the origin for your external point and you will see they don't give the same answers.

Jbreezy

Normally the vector from the external point to the line will not be a position vector
What will it be then ?

LCKurtz

Homework Helper
Gold Member
Look, I have explained everything I know how to about this problem. Post #17 summarizes and shows you exactly what you need to do for the general problem of distance from a point to a line. You can learn from it or not, but I don't have anything more to add to this thread.

"Distance of line to origin"

Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving