Given a triangle ABC, how can you find a point P on AC and a point Q on BC, such that AP=PQ=QB?
N.B. A construction method is sought, and only compass and straightedge are allowed.
This is not a construction, but a solution to the value of the length of AP and of BA so that they can be measured off from A and B.
Let the base be AB. The line PQ forms the base of a different triangle that also includes vertex (and angle) C.
Calling the lengths of the sides in the given (larger) triangle by the lower-case of the opposite angle, the law of cosines gives
c^2=a^2+b^2-2ab cos C
cos C = (a^2+b^2-c^2)/(2ab)
Then, letting x be the sought distance, also the base of the smaller triangle:
x^2 = (a-x)^2 + (b-x)^2 - 2 (a-x)(b-x) cos C
This then eventually produces the quadratic
(1 - 2 cos C) x^2 + (a+b)(2 cos C - 2) x + c^2 = 0
The solution of this in which 0 < x < min(a,b) is the distance to measure off from A and from B.
When a or b (that is the length of either BC or AC) is more than twice the other, there is no such solution.
The following program evaluates this:
INPUT a, b, c
cosC = (a * a + b * b - c * c) / (2 * a * b)
coSq = 1 - cosC * 2
coLin = (a + b) * (cosC * 2 - 2)
con = c * c
rad = coLin * coLin - 4 * coSq * con
IF rad < 0 OR coSq = 0 THEN
PRINT "no answer"
root = SQR(rad)
ans1 = (-coLin + root) / (2 * coSq)
ans2 = (-coLin - root) / (2 * coSq)
IF ans1 <= a AND ans1 <= b AND ans1 >= 0 THEN PRINT ans1
IF ans2 <= a AND ans2 <= b AND ans2 >= 0 THEN PRINT ans2
IF (ans1 > a OR ans1 > b OR ans1 < 0) AND (ans2 > a OR ans2 > b OR ans2 < 0) THEN
PRINT "No conventional answer."
For an equilateral triangle, the answer should be halfway along AC; however, by the formula used, this would result in division by zero, and so no answer is given:
That is an exceptional condition. It can be gotten around by deviating slightly from the values:
Some other examples are:
No conventional answer.
The last is a case when side b is more than twice the length of side a. When it was exactly twice the length of side a, the solution was degenerate and P was coincident with C, and Q the midpoint of CB.
Posted by Charlie
on 2005-04-27 19:45:53