Sort:  

Thank you @sergejkarkarov. Yeah, I didn't expect it to be so complicated when I first worked on it either. It is simple enough in concept, but the geometry and algebra add a bit of complexity. This would be a good senior high school problem solving challenge.