Let a = |AX| = |BY|, b = |BX| = |AY|, p = |QX|,
u = measure of angle AQX,
v = measure of angle BQX,
x = measure of angle QAB, and
y = measure of angle QBA.
From triangles AQB, AQX, and BQX we get
d = a + b (1)
u + v + x + y = 180 (2)
a sin(x) = p sin(u) (3)
b sin(y) = p sin(v) (4)
Let z' denote dz/dx. Taking the derivative of these four equations gives
d' = a' + b' (1')
1 + y' = 0 (2')
a cos(x) + a' sin(x) = 0 (3')
b cos(y) y' + b' sin(y) = 0 (4')
To minimize d we set d' to zero. Eliminating the primed terms from the primed equations gives
b tan(x) = a tan(y)
or
|AY| tan(QAY) = |BY| tan(QBY)
Which is equivalent to AB being perpendicular to QY.
|