I'm working on an application that isn't too complicated, but I'm not sure how to do it.

It's an overhead view of a hockey rink designed to be a goalie positioning tutor. Here's what I need it to do:

The two goal posts are point A and point B. The puck (which will be movable by the mouse, and I know how to do that) will be point C.

At all times, points A, B, and C should make a triangle that's shaded another color.

Secondly, there is a green rectangle representing the goalie. This rectangle should always have its edges (shoulders) touching the lines between the posts and puck. It should also rotate so that it is always square to the puck (in other words, enough to touch both lines without having to move any farther away from the goal line).

I'm not sure where to start with this. I don't expect anyone to spell it out for me but here's a few questions:

1) How do I make more rotating directions for the goalie? I know there's a way to do it since we've got the Racecar movement and all, but embarrassingly, I don't know how.

2) How can I go about making the triangle zone?

3) Ideas on how to program the rotation and placement of the goalie?

Please don't take a bunch of time feeling like you need to do anything for me. Just anything to point me in the right direction is great.

Thanks!