I think there is an error in your Pythagoras calculation...
Doh, that makes it much less elegant :) Thanks for checking and the hint.
reply
I didn't check further, but this small difference on the perpendicular probably explains the small mismatch at the end with the value given by @didiplaywell.
reply