Distance in 3D
How to find the distance between a point and a plane?
Let
P
x
p
,
y
p
,
z
p
±
be any point in
R
3
, and
K
:
a
x
?
x
0
±
+
b
y
?
y
0
±
+
c
z
?
z
0
±
=
0
any plane. To find the distance
between
P
and
K
, we first find the projection of
P
0
P
=
²
x
p
?
x
0
,
y
p
?
y
0
+
z
p
?
z
0
³
onto
n
=
a
,
b
,
c
the normal vector
of
K
. Then
d
P
,
K
±
=
proj
n
P
0
P
=
n
6
P
0
P
n
.
Example 1.
Let
P
1,2,3
±
and
K
: 2
x
?
2
±
+
1
y
+
1
±
+
2
z
?
3
±
=
0
. Find the distance between
P
and
K
.
Solution:
Observe that
P
0
2,
?
1,3
±
and
n
=
2,1,2
,so
P
0
P
=
1
?
2,2
?
?
1
±
,3
?
3
=
?
1,3,0
. Therefore,
d
P
,
K
±
=
proj
n
P
0
P
=
n
6
P
0
P
n
=
2,1,2
6
?
1,3,0
2
2
+
1
2
+
2
2
=
1
3
How to find the distance between a point and a line?
Let
P
x
p
,
y
p
,
z
p
±
be any point in
R
3
, and
L
:
x
=
x
0
+
at
,
y
=
y
0
+
bt
, and
z
=
z
0
+
ct
any line. To find the distance
between
P
and
L
, we first find the projection of
P
0
P
=
²
x
p
?
x
0
,
y
p
?
y
0
+
z
p
?
z
0
³
onto
v
=
a
,
b
,
c
the direction vector
of
L
. Let
w
=
proj
v
P
0
P
=
v
6
P
0
P
v
2
v
, then
P
0
P
and
w