The example didn't work out for you?
The point marked as target is the current target
Black points are within range and angle
White points are outside range and/or angle
The dotted line represents valid angle and range
Blue area is where targets can be considered valid - that is, the firing range.
Tell me what you need and I'll whip something together for you.