## Ken's POTW

Two Lines and a Table
1. Find the perpendicular distance between the two parallel lines: y=mx+a and y=mx+b in terms of a, b, and m.

2. Put a round table into a (right-angled) corner so that the table top touches both walls and the feet are firmly on the ground. If there is a point on the perimeter of the table which is 10 inches from one wall and 5 inches from the other, what is the diameter of the table?

Source: 1. Original, Ken's POTD 3/24/94 2. Internet newsgroup rec.puzzles, Ken's POTD 5/4/94

Solution:
1. This was solved by several people, including: Wilfred Theunissen, PaulWogJ@aol.com, and Bill Chapp. The answer is:

```   |a-b|
-----------
2
sqrt(m  +1)
```
Bill Chapp's Solution:
```1. abs((a-b)/sqrt(m^2+1))

Let line A be y=m*x+a, and
line B be y=m*x+b.

Pick point (0,a) on line A.  The line through this point and
perpendicular to line A is:

line C, y=(-1/m)*x+a

Find the intersection of lines B and C at point (xc,yc):

yc = m*xc + b
yc = (-1/m)*xc + a

m*xc + b = (-1/m)*xc + a
(m + 1/m) * xc = a - b

xc = (a - b) * (1/(m + 1/m))
= (m / (m^2 + 1)) * (a - b)

yc = m * (m / (m^2 + 1)) * (a - b) + b
= (m^2 / (m^2 + 1)) * a + (1 / (m^2 +1)) * b
= (1 / (m^2 + 1)) * (m^2*a - b)

Find distance from (0,a) to (xc,yc):

D = sqrt((xc-0)^2 + (yc-0)^2)
= sqrt((m/(m^2+1)*(a-b))^2 + (1/(m^2+1)*(m^2*a+b) - a)^2)
= sqrt((m/(m^2+1)*(a-b))^2 + (m/(m^2+1)*(m*a + b/m - (m^2+1)/m*a))^2))
= sqrt((m/(m^2+1))^2 * ((a-b)^2 + ((m^2*a + b - m^2*a -a)/m)^2))
= abs(m/(m^2+1)) * sqrt((a-b)^2 + ((a-b)/m)^2)
= abs(m/(m^2+1)) * sqrt((a-b)^2 * ((m^2+1)/m^2))
= abs((a-b)/(m^2+1)) * sqrt(m^2+1)
= abs(a-b)/sqrt(m^2+1)
```

2. This was solved by Wilfred Theunissen, PaulWogJ@aol.com, and Bill Chapp.

The diameter can be either 10 in. or 50 in.

Bill Chapp's Solution:

```   Looking from the top, let the walls be the x and y axes.  Then the
equation for the circle of the table is:

(x-R)^2 + (y-R)^2 = R^2   (Eqn 1)

To have points on the perimeter of the circle 10" from one wall and
5" from the other, the point (10,5) must be on the circle:

(10-R)^2 + (5-R)^2 = R^2
100 - 20R + R^2 + 25 - 10R + R^2 = R^2
R2 - 30R + 125 = 0
(R-5)*(R-25) = 0

Therefore R equals 5 or 25 inches.
[KD: And D equals 10 or 50 inches.]
```
PaulWogJ's solution:
I made a radius to the place on the table that was 10 inches from one wall and 5 inches from the other. Then you make a right triangle with the radius just made as the hypotenuse, all of another radius but the ten inches as another, and a line connecting the point in the problem to the other leg to finish the right triangle. By the pythagorean theorem
```R^2 = (R-5)^2 + (R - 10) ^ 2
R^2 = R^2 - 10R + 25 + R^2 - 20R + 100
0 = R^2 - 30R + 125
0 = (R - 5)(R - 25)
R = 5 or 25
D = 2R = 10 or 50 inches.
```

Mail to Ken