Scoring a goal

Topic:
Calculus
Investigate the optimum position on the soccer field to score a goal. A soccer player is running along a straight line toward the endline. Her path is perpendicular to the endline. She decides to try to shoot a goal when the angle θ that the goal subtends at her position is maximized. Click and drag the player to see how θ varies. How many feet y from the endline should she shoot? (All relevant distances, in feet, are shown in the diagram) Now vary her line of approach, by moving the black point on the endline. Can you find an expression that describes the optimal distance y from the endline in terms of the distance x?