Distance Between Parallel Lines

Before this, knowDistance Between a Point and a Line

Read · 1 min

Given two parallel lines

l1:Ax+By+C1=0l_1:Ax+By+C_1=0

l2:Ax+By+C2=0l_2:Ax+By+C_2=0

Noticed that the coefficient of xx and yy of both line are respectively the same, this is because the slope of both line, m1m_1 and m2m_2 are the same, with

m1=m2=−ABm_1=m_2=-\frac{A}{B}

However, for easier understanding, I'll let it be A1,B1A_1, B_1 for l1l_1 and A2,B2A_2,B_2 for l2l_2, but bear in mind that they are actually the same.

Since the distance between parallel lines are the same in any given point, we simply set a point P(x0,y0)P(x_0,y_0) on l1l_1 and take its distance from l2l_2. Here, we use the formula of distance between a point and a line.

d=∣A2x0+B2y0+C2A2+B2∣d=\left|\frac{A_2x_0+B_2y_0+C_2}{\sqrt{A_2+B_2}}\right|

Since A1=A2A_1=A_2 and B1=B2B_1=B_2, the formula can be expressed as

d=∣A1x0+B1y0+C2A2+B2∣d=\left|\frac{A_1x_0+B_1y_0+C_2}{\sqrt{A_2+B_2}}\right|

Then, we also have

l1:A1x0+B1y0+C1=0l_1:A_1x_0+B_1y_0+C_1=0

l1:A1x0+B1y0=−C1l_1:A_1x_0+B_1y_0=-C_1

Substitute to the formula we have

d=∣−C1+C2A2+B2∣d=\left|\frac{-C_1+C_2}{\sqrt{A_2+B_2}}\right|

Finally, we can remove everything unnecessary and arrange the formula, we get

d=∣C2−C1A2+B2∣d=\left|\frac{C_2-C_1}{\sqrt{A^2+B^2}}\right|

Read · 1 min

Suppose that we have 22 parallel planes: P1:Ax+By+Cz+D1=0P_1: Ax+By+Cz+D_1=0 P2:Ax+By+Cz+D2=0P_2: Ax+By+Cz+D_2=0 We wish to find the distance between these 22 planes. Note that we want to find the shortest possible distance between the two planes, i.e. the distance if one traveled from P1P_1 to P2P_2 along a segment parallel to the normal vector.

A normal vector to both of these planes is n⃗=<A,B,C>\vec{n}=\left<A,B,C\right>. Note that ∣n⃗∣=A2+B2+C2|\vec{n}|=\sqrt{A^2+B^2+C^2}.

Suppose you move along the normal vector such that your displacement is kn⃗=<kA,kB,kC>k\vec{n}=\left<kA,kB,kC\right>, for some scalar kk. For all points P=(x,y,z)∈R3P=(x,y,z)\in\mathbb{R}^3, define f(P)=Ax+By+Czf(P)=Ax+By+Cz. Then: f(P+kn⃗)=A(x+kA)+B(y+kB)+C(z+kC)f(P+k\vec{n})=A(x+kA)+B(y+kB)+C(z+kC) f(P+kn⃗)=(Ax+By+Cz)+k(A2+B2+C2)f(P+k\vec{n})=(Ax+By+Cz)+k(A^2+B^2+C^2) f(P+kn⃗)−f(P)=k∣n⃗∣2f(P+k\vec{n})-f(P)=k|\vec{n}|^2 Therefore, a movement of k∣n⃗∣k|\vec{n}| in the normal direction produces a change of k∣n⃗∣2k|\vec{n}|^2 in f(P)f(P). Suppose that we have 22 points M1∈P1M_1\in P_1 and M2∈P2M_2\in P_2 such that M1M2⊥P1,P2M_1M_2\perp P_1,P_2. Then: f(M2)−f(M1)=(−D2)−(−D1)=D1−D2f(M_2)-f(M_1)=(-D_2)-(-D_1)=D_1-D_2 D1−D2=k∣n⃗∣2D_1-D_2=k|\vec{n}|^2 k∣n⃗∣=D1−D2A2+B2+C2k|\vec{n}|=\frac{D_1-D_2}{\sqrt{A^2+B^2+C^2}} Note that k∣n⃗∣k|\vec{n}| is just the displacement in the normal direction! Thus, since geometric distances are always nonnegative, we can say: M1M2=∣D1−D2∣A2+B2+C2M_1M_2=\frac{|D_1-D_2|}{\sqrt{A^2+B^2+C^2}} This means that the distance dd between 22 parallel planes of the above form is: d=∣D1−D2∣A2+B2+C2d=\frac{|D_1-D_2|}{\sqrt{A^2+B^2+C^2}} This argument can easily be generalized to any number of dimensions. Suppose we have 22 parallel (n−1)(n-1)-dimensional hyperplanes in nn-dimensional hyperspace of the form: P1:A1x1+A2x2+...+Anxn+B1=0P_1: A_1x_1+A_2x_2+...+A_nx_n+B_1=0 P2:A1x1+A2x2+...+Anxn+B2=0P_2: A_1x_1+A_2x_2+...+A_nx_n+B_2=0 Then, the distance dd between them is: d=∣B1−B2∣A12+A22+...+An2d=\frac{|B_1-B_2|}{\sqrt{A_1^2+A_2^2+...+A_n^2}}

Type a concept, like “slope” or “photosynthesis”.

↑ ↓ to choose · Enter to openSearch explanations and problems