# Distance of point to line (cross product)

## Homework Statement

hi

i was wondering how exactly one should find the distance of a point to a line using cross product

for example, the distance from A(1,2,0) to a line running through B(0,1,2) & C(3,1,1) with Y being angle between BA and BC

BC = 3,0,-1
BA = 1,1,-2

so by using cross product formula, i get |BA|sin(Y) = |BAxBC| / |BC|

## The Attempt at a Solution

i tried to calculate |BAxBC| by using the determinant method and i got 0, so the length = 0 too. how come?

so how do i compute the value |BAxBC| ? if i equate to |BA||BC|sinY, wouldn't it cancel out everything in the equation?

so i tried just calculating |BA|sinY by squaring & subsituting sin2Y to (1-cos2Y) and then using the dot product rule and then squarerooting it to get the answer sqrt3.5

so what have i done wrong? is my concept wrong? which way is correct? thanks!

chiro

## Homework Statement

hi

i was wondering how exactly one should find the distance of a point to a line using cross product

for example, the distance from A(1,2,0) to a line running through B(0,1,2) & C(3,1,1) with Y being angle between BA and BC

BC = 3,0,-1
BA = 1,1,-2

so by using cross product formula, i get |BA|sin(Y) = |BAxBC| / |BC|

## The Attempt at a Solution

i tried to calculate |BAxBC| by using the determinant method and i got 0, so the length = 0 too. how come?

so how do i compute the value |BAxBC| ? if i equate to |BA||BC|sinY, wouldn't it cancel out everything in the equation?

so i tried just calculating |BA|sinY by squaring & subsituting sin2Y to (1-cos2Y) and then using the dot product rule and then squarerooting it to get the answer sqrt3.5

so what have i done wrong? is my concept wrong? which way is correct? thanks!

The easiest way I can think of off the top of my head is to project the vector on to the line and then subtract the projected vector from the point vector.

So to recap:

1) Project "point-vector" on to the "line-vector"
2) Subtract result of 1) from "point-vector"
3) Calculate the distance of vector in 2 to get your distance

The easiest way I can think of off the top of my head is to project the vector on to the line and then subtract the projected vector from the point vector.

So to recap:

1) Project "point-vector" on to the "line-vector"
2) Subtract result of 1) from "point-vector"
3) Calculate the distance of vector in 2 to get your distance

ah thank you for telling me another alternative

but i still don't understand how to use the cross product to calculate the distance, because my notes says one can use cross product to do so.

chiro
ah thank you for telling me another alternative

but i still don't understand how to use the cross product to calculate the distance, because my notes says one can use cross product to do so.

Think back to trigonometry. When you have the sin of the angle and the length of a side, what can you deduce about finding the other respective side?

Also remember that one side will be perpendicular since that is the shortest vector between the point and the line.

Think back to trigonometry. When you have the sin of the angle and the length of a side, what can you deduce about finding the other respective side?

Also remember that one side will be perpendicular since that is the shortest vector between the point and the line.

i know that sin theta will give you the opposite perpendicular side, but if you see the formula that i have written on my 1st post, the formula in essence is self cancelling.
which puzzles me on how exactly should i compute |BA|sin(Y) = |BAxBC| / |BC|

"so how do i compute the value |BAxBC| ? if i equate to |BA||BC|sinY, wouldn't it cancel out everything in the equation?"

chiro
i know that sin theta will give you the opposite perpendicular side, but if you see the formula that i have written on my 1st post, the formula in essence is self cancelling.
which puzzles me on how exactly should i compute |BA|sin(Y) = |BAxBC| / |BC|

"so how do i compute the value |BAxBC| ? if i equate to |BA||BC|sinY, wouldn't it cancel out everything in the equation?"

What you are doing is correct:

The definition of A x B (A and B are vectors) is

A x B = |A||B|sin(theta)N where N is the normal vector.

Based on this we can calculate |A X B| as

|A x B| = |A||B|sin(theta)|N| = |A||B|sin(theta) x 1 = |A||B|sin(theta)

Dividing by |A| you get

|A X B|/|A| = |B|sin(theta)

which is what you want.

What you are doing is correct:

The definition of A x B (A and B are vectors) is

A x B = |A||B|sin(theta)N where N is the normal vector.

Based on this we can calculate |A X B| as

|A x B| = |A||B|sin(theta)|N| = |A||B|sin(theta) x 1 = |A||B|sin(theta)

Dividing by |A| you get

|A X B|/|A| = |B|sin(theta)

which is what you want.

oh so i just use the determinant formula to get |A X B| and then find the magnitude and then divide by the magnitude of |A|?

chiro
oh so i just use the determinant formula to get |A X B| and then find the magnitude and then divide by the magnitude of |A|?

To find A x B you use the determinant

| i j k |
| Ax Ay Az|
| Bx By Bz|

where the x,y,z are the components of the respective axis and (i,j,k) are the standard basis in euclidean 3 space.

To Find |A X B| use the norm which is basically

d = SQRT(x^2 + y^2 + z^2) where (x,y,z) = A x B

Finding |A| is the same.

To find A x B you use the determinant

| i j k |
| Ax Ay Az|
| Bx By Bz|

where the x,y,z are the components of the respective axis and (i,j,k) are the standard basis in euclidean 3 space.

To Find |A X B| use the norm which is basically

d = SQRT(x^2 + y^2 + z^2) where (x,y,z) = A x B

Finding |A| is the same.

ah i see thanks!