All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars
 perplexus dot info

 All integers (Posted on 2005-01-17)
The sides of a trapezoid are 5, 8, 11, and 13, and its diagonals are also integer numbers; what are they?

 See The Solution Submitted by Federico Kereki Rating: 4.5000 (2 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
 re: Solution, by hand | Comment 12 of 14 |
(In reply to Solution, by hand by Old Original Oskar!)

My bug was in my implementation of the arccos function:

DEF fnac (x) = ATN(SQR(1 - x * x) / x)

It returns a negative value (quadrant IV) rather than the correct second quadrant answer when x is negative, so when evaluating this solution it had the altitude as sqrt(315)/2 on one side and the negative of that on the other.

If they had been the correct (same) sign, even if slightly off due to rounding differences, the leeway afforded by the comparison would have found a match:

r = alt1 / alt2
IF ABS(r - 1) < .00000001# THEN

 Posted by Charlie on 2005-01-18 20:23:52

 Search: Search body:
Forums (0)