UVa 10011 - Where Can You Hide?

10011 - Where Can You Hide?

 * http://acm.uva.es/p/v100/10011.html

Summary
Given angle, inscribed circle and point, check if this point is after the given circle and find maximal radius of circle inside this angle with center in given point, not overlapping given circle. Angle corner is located at (0,0).

Explanation
Computational Geometry problem. Angle is formed by tangents to the tree from radiation source (0,0). Maximum radius is minimum of distance between point and angle sides and "distance between point and center of the tree minus radius of the tree". Plus checks of where point located, of course.

Gotcha's

 * Cartesian walk only straight lines and can not go through tree. So his circle should not overlap tree's circle.
 * Checking that house is before the tree by comparing distanse from (0,0) to house and to the tree's center is incorrect.